splash pane with custom loading progressbar; custom pre splash screen for android

This commit is contained in:
Dan Ballard 2019-03-19 13:35:31 -07:00
bovenliggende b75b374e57
commit abef1472d8
10 gewijzigde bestanden met toevoegingen van 158 en 47 verwijderingen

Bestand weergeven

@ -4,6 +4,7 @@
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="cwtch"
android:theme="@style/AppTheme"
android:screenOrientation="unspecified"
android:launchMode="singleTop">
<intent-filter>
@ -39,6 +40,7 @@
<!-- Messages maps -->
<!-- Splash screen -->
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
<!-- 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"/ -->
<!-- Splash screen -->

Binair bestand niet weergegeven.

Na

Breedte:  |  Hoogte:  |  Grootte: 11 KiB

Bestand weergeven

@ -0,0 +1,12 @@
<?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="#FFFFFFFF"/>
</shape>
</item>
<item>
<bitmap android:src="@drawable/cwtch_logo"
android:gravity="center" />
</item>
</layer-list>

Bestand weergeven

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash</item>
</style>
</resources>

Bestand weergeven

@ -12,6 +12,7 @@
<file>qml/panes/OverlayPane.qml</file>
<file>qml/panes/PeerSettingsPane.qml</file>
<file>qml/panes/SettingsPane.qml</file>
<file>qml/panes/SplashPane.qml</file>
<file>qml/styles/CwtchComboBoxStyle.qml</file>
<file>qml/styles/CwtchExpandingButton.qml</file>
<file>qml/styles/CwtchTextAreaStyle.qml</file>
@ -34,5 +35,7 @@
<file>i18n/translation_en.qm</file>
<file>i18n/translation_fr.qm</file>
<file>i18n/translation_pt.qm</file>
<file>qml/images/cwtch_logo.png</file>
<file>qml/styles/CwtchProgress.qml</file>
</qresource>
</RCC>

BIN
qml/images/cwtch_logo.png Normal file

Binair bestand niet weergegeven.

Na

Breedte:  |  Hoogte:  |  Grootte: 11 KiB

Bestand weergeven

@ -106,66 +106,88 @@ ApplicationWindow {
}
}*/
RowLayout { // CONTAINS EVERYTHING EXCEPT THE TOOLBAR
/* anchors.left: ratio >= 0.92 ? parent.left : toolbar.right
anchors.top: ratio >= 0.92 ? toolbar.bottom : parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom */
anchors.fill: parent
spacing: 0
StackLayout {
id: parentStack
currentIndex: 0
anchors.fill: parent
Rectangle { // Splash pane
color: "#FFFFFF"
//Layout.fillHeight: true
//Layout.minimumWidth: Layout.maximumWidth
//Layout.minimumHeight: parent.height
anchors.fill: parent
visible: true
SplashPane {
anchors.fill: parent
}
}
Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS
color: "#D2C0DD"
Layout.fillHeight: true
Layout.minimumWidth: Layout.maximumWidth
Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : 450
visible: (ratio <= 1.08 && windowItem.width >= 700) || theStack.pane == theStack.emptyPane
RowLayout { // CONTAINS EVERYTHING EXCEPT THE TOOLBAR
/* anchors.left: ratio >= 0.92 ? parent.left : toolbar.right
anchors.top: ratio >= 0.92 ? toolbar.bottom : parent.top
anchors.right: parent.right
anchors.bottom: parent.bottom */
anchors.fill: parent
spacing: 0
ContactList{
anchors.fill: parent
}
}
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
color: "#EEEEFF"
Layout.fillWidth: true
Layout.fillHeight: true
Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS
color: "#D2C0DD"
Layout.fillHeight: true
Layout.minimumWidth: Layout.maximumWidth
Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : 450
visible: (ratio <= 1.08 && windowItem.width >= 700) || theStack.pane == theStack.emptyPane
StackLayout {
id: theStack
anchors.fill: parent
currentIndex: 0
ContactList{
anchors.fill: parent
}
}
property alias pane: theStack.currentIndex
readonly property int emptyPane: 0
readonly property int messagePane: 1
readonly property int settingsPane: 2
readonly property int userProfilePane: 3
readonly property int groupProfilePane: 4
readonly property int addGroupPane: 5
property string title
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
color: "#EEEEFF"
Layout.fillWidth: true
Layout.fillHeight: true
Item { anchors.fill: parent } // empty
StackLayout {
id: theStack
anchors.fill: parent
currentIndex: 0
OverlayPane { // messagePane
title: theStack.title
anchors.fill: parent
}
property alias pane: theStack.currentIndex
readonly property int emptyPane: 0
readonly property int messagePane: 1
readonly property int settingsPane: 2
readonly property int userProfilePane: 3
readonly property int groupProfilePane: 4
readonly property int addGroupPane: 5
SettingsPane{ anchors.fill: parent }
property string title
PeerSettingsPane { anchors.fill: parent }
GroupSettingsPane{ anchors.fill: parent }
Item { anchors.fill: parent } // empty
AddGroupPane { anchors.fill: parent }
}
}
OverlayPane { // messagePane
title: theStack.title
anchors.fill: parent
}
SettingsPane{ anchors.fill: parent }
PeerSettingsPane { anchors.fill: parent }
GroupSettingsPane{ anchors.fill: parent }
AddGroupPane { anchors.fill: parent }
}
}
}
}
PropertyAnimation { id: anmPopup; easing.type: Easing.InQuart; duration: 7000; target: popup; property: "opacity"; to: 0; }
@ -207,4 +229,4 @@ ApplicationWindow {
theStack.title = str
}
}
}
}

30
qml/panes/SplashPane.qml Normal file
Bestand weergeven

@ -0,0 +1,30 @@
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import "../styles"
Item {
Image {
id: splashImage
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source: "qrc:/qml/images/cwtch_logo.png"
}
ProgressBar {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: splashImage.bottom
anchors.topMargin: 10
indeterminate: true
style: ProgressBarStyle {
progress: CwtchProgress {}
}
}
}

Bestand weergeven

@ -0,0 +1,35 @@
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Rectangle {
border.color: "#D2C0DD"
color: "red"
// Indeterminate animation by animating alternating stripes:
Item {
anchors.fill: parent
anchors.margins: 1
visible: control.indeterminate
clip: true
Row {
Repeater {
Rectangle {
color: index % 2 ? "#D2C0DD" : "#b29dbe"
width: 20 ; height: control.height
}
model: control.width / 20 + 2
}
XAnimator on x {
from: 0 ; to: -40
loops: Animation.Infinite
running: parentStack.currentIndex == 0
}
}
}
}

Bestand weergeven

@ -229,6 +229,7 @@ ColumnLayout {
lblNick.text = _nick
onion = _onion
image = _image
parentStack.currentIndex = 1
}
onTorStatus: function(code, str) {
@ -236,4 +237,4 @@ ColumnLayout {
rectTorStatus.message = str
}
}
}
}