splash pane with custom loading progressbar; custom pre splash screen for android
This commit is contained in:
parent
b75b374e57
commit
abef1472d8
|
@ -4,6 +4,7 @@
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||||
android:name="org.qtproject.qt5.android.bindings.QtActivity"
|
android:name="org.qtproject.qt5.android.bindings.QtActivity"
|
||||||
android:label="cwtch"
|
android:label="cwtch"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
android:screenOrientation="unspecified"
|
android:screenOrientation="unspecified"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -39,6 +40,7 @@
|
||||||
<!-- Messages maps -->
|
<!-- Messages maps -->
|
||||||
|
|
||||||
<!-- Splash screen -->
|
<!-- 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_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_sticky" android:value="true"/ -->
|
||||||
<!-- Splash screen -->
|
<!-- Splash screen -->
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -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>
|
|
@ -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>
|
3
qml.qrc
3
qml.qrc
|
@ -12,6 +12,7 @@
|
||||||
<file>qml/panes/OverlayPane.qml</file>
|
<file>qml/panes/OverlayPane.qml</file>
|
||||||
<file>qml/panes/PeerSettingsPane.qml</file>
|
<file>qml/panes/PeerSettingsPane.qml</file>
|
||||||
<file>qml/panes/SettingsPane.qml</file>
|
<file>qml/panes/SettingsPane.qml</file>
|
||||||
|
<file>qml/panes/SplashPane.qml</file>
|
||||||
<file>qml/styles/CwtchComboBoxStyle.qml</file>
|
<file>qml/styles/CwtchComboBoxStyle.qml</file>
|
||||||
<file>qml/styles/CwtchExpandingButton.qml</file>
|
<file>qml/styles/CwtchExpandingButton.qml</file>
|
||||||
<file>qml/styles/CwtchTextAreaStyle.qml</file>
|
<file>qml/styles/CwtchTextAreaStyle.qml</file>
|
||||||
|
@ -34,5 +35,7 @@
|
||||||
<file>i18n/translation_en.qm</file>
|
<file>i18n/translation_en.qm</file>
|
||||||
<file>i18n/translation_fr.qm</file>
|
<file>i18n/translation_fr.qm</file>
|
||||||
<file>i18n/translation_pt.qm</file>
|
<file>i18n/translation_pt.qm</file>
|
||||||
|
<file>qml/images/cwtch_logo.png</file>
|
||||||
|
<file>qml/styles/CwtchProgress.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
114
qml/main.qml
114
qml/main.qml
|
@ -106,66 +106,88 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
RowLayout { // CONTAINS EVERYTHING EXCEPT THE TOOLBAR
|
StackLayout {
|
||||||
/* anchors.left: ratio >= 0.92 ? parent.left : toolbar.right
|
id: parentStack
|
||||||
anchors.top: ratio >= 0.92 ? toolbar.bottom : parent.top
|
currentIndex: 0
|
||||||
anchors.right: parent.right
|
anchors.fill: parent
|
||||||
anchors.bottom: parent.bottom */
|
|
||||||
anchors.fill: parent
|
Rectangle { // Splash pane
|
||||||
spacing: 0
|
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
|
RowLayout { // CONTAINS EVERYTHING EXCEPT THE TOOLBAR
|
||||||
color: "#D2C0DD"
|
/* anchors.left: ratio >= 0.92 ? parent.left : toolbar.right
|
||||||
Layout.fillHeight: true
|
anchors.top: ratio >= 0.92 ? toolbar.bottom : parent.top
|
||||||
Layout.minimumWidth: Layout.maximumWidth
|
anchors.right: parent.right
|
||||||
Layout.maximumWidth: theStack.pane == theStack.emptyPane ? parent.width : 450
|
anchors.bottom: parent.bottom */
|
||||||
visible: (ratio <= 1.08 && windowItem.width >= 700) || theStack.pane == theStack.emptyPane
|
anchors.fill: parent
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
|
||||||
ContactList{
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
|
Rectangle { // THE LEFT PANE WITH TOOLS AND CONTACTS
|
||||||
color: "#EEEEFF"
|
color: "#D2C0DD"
|
||||||
Layout.fillWidth: true
|
Layout.fillHeight: true
|
||||||
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 {
|
ContactList{
|
||||||
id: theStack
|
anchors.fill: parent
|
||||||
anchors.fill: parent
|
}
|
||||||
currentIndex: 0
|
}
|
||||||
|
|
||||||
property alias pane: theStack.currentIndex
|
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
|
||||||
readonly property int emptyPane: 0
|
color: "#EEEEFF"
|
||||||
readonly property int messagePane: 1
|
Layout.fillWidth: true
|
||||||
readonly property int settingsPane: 2
|
Layout.fillHeight: true
|
||||||
readonly property int userProfilePane: 3
|
|
||||||
readonly property int groupProfilePane: 4
|
|
||||||
readonly property int addGroupPane: 5
|
|
||||||
|
|
||||||
property string title
|
|
||||||
|
|
||||||
|
|
||||||
Item { anchors.fill: parent } // empty
|
StackLayout {
|
||||||
|
id: theStack
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: 0
|
||||||
|
|
||||||
OverlayPane { // messagePane
|
property alias pane: theStack.currentIndex
|
||||||
title: theStack.title
|
readonly property int emptyPane: 0
|
||||||
anchors.fill: parent
|
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; }
|
PropertyAnimation { id: anmPopup; easing.type: Easing.InQuart; duration: 7000; target: popup; property: "opacity"; to: 0; }
|
||||||
|
@ -207,4 +229,4 @@ ApplicationWindow {
|
||||||
theStack.title = str
|
theStack.title = str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -229,6 +229,7 @@ ColumnLayout {
|
||||||
lblNick.text = _nick
|
lblNick.text = _nick
|
||||||
onion = _onion
|
onion = _onion
|
||||||
image = _image
|
image = _image
|
||||||
|
parentStack.currentIndex = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
onTorStatus: function(code, str) {
|
onTorStatus: function(code, str) {
|
||||||
|
@ -236,4 +237,4 @@ ColumnLayout {
|
||||||
rectTorStatus.message = str
|
rectTorStatus.message = str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue