Add splashscreen to demo app

This commit is contained in:
FalsinSoft 2020-04-24 13:24:54 +02:00
parent 4e4c4c7e63
commit 282b715981
4 changed files with 24 additions and 5 deletions

View File

@ -23,13 +23,15 @@ int main(int argc, char *argv[])
QIcon::setThemeName("tools");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
#ifdef Q_OS_ANDROID
QtAndroidTools::InitializeQmlTools();
#endif
QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit()));
engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
if(engine.rootObjects().isEmpty()) return -1;
PrepareSharedFiles("sharedfiles");
QtAndroid::hideSplashScreen();
return app.exec();
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<manifest package="com.falsinsoft.QtAndroidToolsDemo" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleTop" android:theme="@style/SplashScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@ -59,8 +59,8 @@
are done populating your window with content. -->
<!-- meta-data android:name="android.app.splash_screen_drawable_portrait" android:resource="@drawable/logo_portrait" / -->
<!-- meta-data android:name="android.app.splash_screen_drawable_landscape" android:resource="@drawable/logo_landscape" / -->
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splashscreen"/>
<meta-data android:name="android.app.splash_screen_sticky" android:value="true"/>
<!-- Splash screen -->
<!-- Background running -->

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<solid android:color="#FFFFFF" />
</shape>
</item>
<item>
<bitmap android:src="@drawable/icon" android:gravity="center" />
</item>
</layer-list>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashScreenTheme">
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
</resources>