Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android splash screen logo gets pushed down

Android splash screen logo gets pushed down

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 873 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kviktor
    wrote on last edited by kviktor
    #1

    I've been using this guide to make a splashscreen for my app: https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af however right after the Qt libraries are loaded and the Java activity actually starts (around I/ActivityManager( 594): Displayed com.my.app/.MyActivity: +601ms ) the logo gets pushed down by a few pixels, I'm using <bitmap android:src="@drawable/splash_logo" android:gravity="center" /> to position the image.

    Following the guide closely didn't actually work and I had to make these modifications

    QtActivity.java

    -            QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"};
    -            QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light";
    +            QT_ANDROID_THEMES = new String[] {"Theme_NoTitleBar"};
    +            QT_ANDROID_DEFAULT_THEME = "Theme_NoTitleBar";
             } else {
    -            QT_ANDROID_THEMES = new String[] {"Theme_DeviceDefault_Light"};
    -            QT_ANDROID_DEFAULT_THEME = "Theme_DeviceDefault_Light";
    +            QT_ANDROID_THEMES = new String[] {"Theme_NoTitleBar"};
    +            QT_ANDROID_DEFAULT_THEME = "Theme_NoTitleBar";
    

    I also tried these but they didn't really change anything
    QtActivityLoader.java

    // m_activity.requestWindowFeature(Window.FEATURE_ACTION_BAR);
    
    //m_activity.setTheme(Class.forName("android.R$style").getDeclaredField(QT_ANDROID_DEFAULT_THEME).getInt(null));         
      m_activity.setTheme(Class.forName(com.my.app.R$style").getDeclaredField("MyAppTheme_NoTitleBar").getInt(null));
    

    Anyone knows any workaround or fix for this?

    edit.: I'm using Qt 5.9.1 and it appears on all Android versions

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kviktor
      wrote on last edited by
      #2

      Looks like the way Qt creates the splash screen in QtActivityDelegate.java makes the splash screen pushed down, if I remove android.app.splash_screen_drawable from my AndroidManifest.xml (and add m_activity.setTheme(Class.forName(com.my.app.R$style").getDeclaredField("MyAppTheme_NoTitleBar").getInt(null));) the splash screen does behave like expected.

      (unfortunately because of this I can't use this workaround for the flickering that happens between the transition between splash and qml https://bugreports.qt.io/browse/QTBUG-43558?focusedCommentId=344174&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-344174 but at it's something)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pcspets
        Qt Champion 2021
        wrote on last edited by
        #3

        It's not caused by Qt. Qt displays the splashscreen correctly, respecting insets (like statusbar) but you are most probably using "android:windowBackground" in the theme and this just doesn't respect any insets. API 26+ has adressed that issue by introducing "android:windowSplashscreenContent".

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved