Browse Source

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

pull/152/head
Dan Ballard 8 months ago
parent
commit
abef1472d8

+ 2
- 0
android/AndroidManifest.xml View File

@@ -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 -->

BIN
android/res/drawable/cwtch_logo.png View File


+ 12
- 0
android/res/drawable/splash.xml View File

@@ -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>

+ 6
- 0
android/res/values/apptheme.xml View File

@@ -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
- 0
qml.qrc View File

@@ -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 View File


+ 67
- 45
qml/main.qml View File

@@ -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

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
visible: true

SplashPane {
anchors.fill: parent
}
}

ContactList{
anchors.fill: parent
}
}

Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
color: "#EEEEFF"
Layout.fillWidth: true
Layout.fillHeight: true
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: theStack
anchors.fill: parent
currentIndex: 0

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
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

property string title

ContactList{
anchors.fill: parent
}
}

Item { anchors.fill: parent } // empty
Rectangle { // THE RIGHT PANE WHERE THE MESSAGES AND STUFF GO
color: "#EEEEFF"
Layout.fillWidth: true
Layout.fillHeight: true

OverlayPane { // messagePane
title: theStack.title
anchors.fill: parent
}

SettingsPane{ anchors.fill: parent }
StackLayout {
id: theStack
anchors.fill: parent
currentIndex: 0

PeerSettingsPane { 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

GroupSettingsPane{ anchors.fill: parent }
property string title

AddGroupPane { anchors.fill: parent }
}
}

Item { anchors.fill: parent } // empty

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
- 0
qml/panes/SplashPane.qml View File

@@ -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 {}
}
}
}

+ 35
- 0
qml/styles/CwtchProgress.qml View File

@@ -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
}
}
}
}

+ 2
- 1
qml/widgets/MyProfile.qml View File

@@ -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
}
}
}
}

Loading…
Cancel
Save