aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-19 12:42:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-19 12:42:58 -0800
commit04e994b57558ed9db0e5175c89c131f7f87d1bb7 (patch)
tree9235e0323d952db75f988d05fb416e5a14c51a9b /qt-mobile/qml
parentf466ee61da75705abd615a2a0d3cbaca12e3c902 (diff)
downloadsubsurface-04e994b57558ed9db0e5175c89c131f7f87d1bb7.tar.gz
Subsurface-mobile on Android: change the splash screen methodology
This is based on post by Ben Laud https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af It creates a theme that uses a splash drawable that Android will show immediately when the application is launched. And then starts the QML application with visibility set to false adn only makes it visible (and replace the splash screen) once initialization is finished. We still get a little flicker with the switch from splash to start page to dive list, but over all the experience is hugely improved. And the bug that the splash screen stays around when starting Subsurface-mobile in landscape also appears to be fixed. Fixes #994 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qml')
-rw-r--r--qt-mobile/qml/main.qml20
1 files changed, 19 insertions, 1 deletions
diff --git a/qt-mobile/qml/main.qml b/qt-mobile/qml/main.qml
index bcbc310f1..b2c94f4f4 100644
--- a/qt-mobile/qml/main.qml
+++ b/qt-mobile/qml/main.qml
@@ -17,7 +17,8 @@ MobileComponents.ApplicationWindow {
id: fontMetrics
}
- visible: true
+ visible: false
+ opacity: 0
globalDrawer: MobileComponents.GlobalDrawer {
title: "Subsurface"
@@ -200,6 +201,14 @@ MobileComponents.ApplicationWindow {
initialPage: DiveList {
anchors.fill: detailsPage
id: diveDetails
+ opacity: 0
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 200
+ easing.type: Easing.OutQuad
+ }
+ }
+
}
QMLManager {
@@ -244,5 +253,14 @@ MobileComponents.ApplicationWindow {
Component.onCompleted: {
manager.finishSetup();
+ rootItem.visible = true
+ diveDetails.opacity = 1
+ rootItem.opacity = 1
+ }
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 200
+ easing.type: Easing.OutQuad
+ }
}
}