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. Custom Android themes and splash screens with Qt?
Forum Updated to NodeBB v4.3 + New Features

Custom Android themes and splash screens with Qt?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 4 Posters 3.7k Views 1 Watching
  • 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.
  • KostasK Offline
    KostasK Offline
    Kostas
    wrote on last edited by Kostas
    #1

    If I add a predefined theme without the action bar in AndroidManifest.xml the action bar is succesfuly not displayed :

    <activity android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen" .../>
    

    However if I create my own simple theme in android/res/values/themes.xml :

    <resources>
        <color name="background">#ff0000</color>
        <style name="MyTheme" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">
            <item name="android:windowBackground">@color/background</item>
        </style>
    </resources>
    

    and set it in AndroidManifest.xml :

    <activity android:theme="@style/MyTheme" .../>
    

    In this case the application starts without the action bar and then instantly shows the action bar again with an annoying flickering.

    I need the theme to have a smooth transition between the launching of the app and the moment my application has control of the display. In my case, just a background color is enough and then I show my splash screen using QML.

    I tried setting

    meta-data android:name="android.app.splash_screen_drawable"
    

    but there is still a black screen displayed for a few frames between the moment the android splash image disappears and before the QML is loaded. The color black is actually the background color of the android theme. It would be white with a Light theme. This is why I'm trying to setup a custom theme which avoids the flickering problem but then I can not get the action bar to disappear...

    Am I doing something wrong or does Qt interfere with the theme upon launching ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MajidKamali
      wrote on last edited by
      #2

      https://forum.qt.io/topic/38925/qt-on-android-working-example-of-a-splash-screen/16
      Benlau's post

      1 Reply Last reply
      0
      • KostasK Offline
        KostasK Offline
        Kostas
        wrote on last edited by Kostas
        #3

        Thank you, that's a great post.

        However the initial problem I stated is still there :
        When I use a custom FULLSCREEN theme, the Qt app seems to override the setting.

        <resources>
            <color name="background">#ff0000</color>
        
            <style name="MyTheme" parent="@android:style/Theme.Holo">
                <item name="android:windowBackground">@color/background</item>
            </style>
        
            <style name="MyThemeFullscreen" parent="@android:style/Theme.Holo.NoActionBar.Fullscreen">
                <item name="android:windowBackground">@color/background</item>
            </style>
        </resources>
        
        android:theme="@style/MyTheme"           // works
        android:theme="@style/MyThemeFullscreen" // does not work
        
        1 Reply Last reply
        0
        • deleted57D Offline
          deleted57D Offline
          deleted57
          wrote on last edited by
          #4

          Try the solution explained here:

          https://falsinsoft.blogspot.com/2017/07/qml-show-android-native-splash-screen.html

          1 Reply Last reply
          1
          • S Offline
            S Offline
            sassanh
            wrote on last edited by
            #5

            @Kostas Where you able to solve it?

            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