Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140066

Blank screen for a short time when setting a theme that overrides the splash screen theme

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.8.4, 6.9.2, 6.10.0 Beta4
    • QPA: Android
    • None
    • Android

      If a user sets a splash screen theme for the QtActivity in the manifest

      <activity android:name="org.qtproject.qt.android.bindings.QtActivity" ... android:theme="@style/splashScreenTheme"> 

      Then if the user wants to override that theme, for example to avoid its background color showing under the other windows that are not taking the whole screen size. Atm, one can do that by calling setTheme() from own Activity:

      package my.package.name;
      
      import android.os.Bundle;
      import org.qtproject.qt.android.bindings.QtActivity;
      
      public class MyActivity extends QtActivity
      {
          @Override
          public void onCreate(Bundle savedInstanceState)
          { 
               // must be before super.onCreate(), otherwise overriding the theme will not work 
               setTheme(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q ?
                      android.R.style.Theme_DeviceDefault_DayNight :
                      android.R.style.Theme_Holo_Light);
               super.onCreate(savedInstanceState);
          }
      } 

      Doing this would set the new theme and override the splash screen theme, however, on many devices and depending on the app, there could be a short noticeable time where the app is just a blank screen that has nothing rendered.

      So atm reseting the theme this way, is not a proper solution and we need to figure out whether we can delay setting the new theme until the Qt content is ready so we don't end up in this situation.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtandroidteam Qt Android Team
            assam Assam Boudjelthia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes