mirror of
https://github.com/QuasarApp/QtAndroidTools.git
synced 2025-05-11 03:29:35 +00:00
Add splashscreen to demo app
This commit is contained in:
parent
4e4c4c7e63
commit
282b715981
@ -23,13 +23,15 @@ int main(int argc, char *argv[])
|
|||||||
QIcon::setThemeName("tools");
|
QIcon::setThemeName("tools");
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
#ifdef Q_OS_ANDROID
|
|
||||||
QtAndroidTools::InitializeQmlTools();
|
QtAndroidTools::InitializeQmlTools();
|
||||||
#endif
|
|
||||||
QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit()));
|
QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit()));
|
||||||
engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/Main.qml")));
|
||||||
if(engine.rootObjects().isEmpty()) return -1;
|
if(engine.rootObjects().isEmpty()) return -1;
|
||||||
PrepareSharedFiles("sharedfiles");
|
PrepareSharedFiles("sharedfiles");
|
||||||
|
|
||||||
|
QtAndroid::hideSplashScreen();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?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">
|
<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">
|
<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>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
@ -59,8 +59,8 @@
|
|||||||
are done populating your window with content. -->
|
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_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_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_drawable" android:resource="@drawable/splashscreen"/>
|
||||||
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
|
<meta-data android:name="android.app.splash_screen_sticky" android:value="true"/>
|
||||||
<!-- Splash screen -->
|
<!-- Splash screen -->
|
||||||
|
|
||||||
<!-- Background running -->
|
<!-- Background running -->
|
||||||
|
11
QtAndroidToolsDemo/android/res/drawable/splashscreen.xml
Normal file
11
QtAndroidToolsDemo/android/res/drawable/splashscreen.xml
Normal 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>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<style name="SplashScreenTheme">
|
||||||
|
<item name="android:windowBackground">@drawable/splashscreen</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user