Implement zoom navigation transition animation
This commit is contained in:
59
AnimatedStackView.qml
Normal file
59
AnimatedStackView.qml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import EVChargerApp
|
||||||
|
|
||||||
|
StackView {
|
||||||
|
popEnter: Transition {
|
||||||
|
PropertyAnimation {
|
||||||
|
property: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
ScaleAnimator {
|
||||||
|
from: 2
|
||||||
|
to: 1
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
popExit: Transition {
|
||||||
|
PropertyAnimation {
|
||||||
|
property: "opacity"
|
||||||
|
from: 1
|
||||||
|
to: 0
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
ScaleAnimator {
|
||||||
|
from: 1
|
||||||
|
to: 0.5
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pushEnter: Transition {
|
||||||
|
PropertyAnimation {
|
||||||
|
property: "opacity"
|
||||||
|
from: 0
|
||||||
|
to: 1
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
ScaleAnimator {
|
||||||
|
from: 0.5
|
||||||
|
to: 1
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pushExit: Transition {
|
||||||
|
PropertyAnimation {
|
||||||
|
property: "opacity"
|
||||||
|
from: 1
|
||||||
|
to: 0
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
ScaleAnimator {
|
||||||
|
from: 1
|
||||||
|
to: 2
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -12,6 +12,14 @@ Loader {
|
|||||||
return loader.item.backPressed()
|
return loader.item.backPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DevicesModel {
|
||||||
|
id: devicesModel
|
||||||
|
|
||||||
|
settings: theSettings
|
||||||
|
|
||||||
|
Component.onCompleted: start()
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: deviceList
|
id: deviceList
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ qt_add_qml_module(evcharger-app
|
|||||||
AboutPage.qml
|
AboutPage.qml
|
||||||
AccessPage.qml
|
AccessPage.qml
|
||||||
AddDeviceScreen.qml
|
AddDeviceScreen.qml
|
||||||
|
AnimatedStackView.qml
|
||||||
ApiKeyValueItem.qml
|
ApiKeyValueItem.qml
|
||||||
ApiSettingsPage.qml
|
ApiSettingsPage.qml
|
||||||
AppInstance.qml
|
AppInstance.qml
|
||||||
|
@@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import EVChargerApp
|
import EVChargerApp
|
||||||
|
|
||||||
StackView {
|
AnimatedStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
|
|
||||||
function backPressed() {
|
function backPressed() {
|
||||||
|
@@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import EVChargerApp
|
import EVChargerApp
|
||||||
|
|
||||||
StackView {
|
AnimatedStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
|
|
||||||
signal deviceSelected(url: string, password: string)
|
signal deviceSelected(url: string, password: string)
|
||||||
@@ -16,39 +16,6 @@ StackView {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// pushEnter: Transition {
|
|
||||||
// PropertyAnimation {
|
|
||||||
// property: "opacity"
|
|
||||||
// from: 0
|
|
||||||
// to:1
|
|
||||||
// duration: 200
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// pushExit: Transition {
|
|
||||||
// PropertyAnimation {
|
|
||||||
// property: "opacity"
|
|
||||||
// from: 1
|
|
||||||
// to:0
|
|
||||||
// duration: 200
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// popEnter: Transition {
|
|
||||||
// PropertyAnimation {
|
|
||||||
// property: "opacity"
|
|
||||||
// from: 0
|
|
||||||
// to:1
|
|
||||||
// duration: 200
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// popExit: Transition {
|
|
||||||
// PropertyAnimation {
|
|
||||||
// property: "opacity"
|
|
||||||
// from: 1
|
|
||||||
// to:0
|
|
||||||
// duration: 200
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
initialItem: BaseNavigationPage {
|
initialItem: BaseNavigationPage {
|
||||||
id: page
|
id: page
|
||||||
title: qsTr("Device list")
|
title: qsTr("Device list")
|
||||||
@@ -57,14 +24,6 @@ StackView {
|
|||||||
id: cloudUrlsModel
|
id: cloudUrlsModel
|
||||||
}
|
}
|
||||||
|
|
||||||
DevicesModel {
|
|
||||||
id: devicesModel
|
|
||||||
|
|
||||||
settings: theSettings
|
|
||||||
|
|
||||||
Component.onCompleted: start()
|
|
||||||
}
|
|
||||||
|
|
||||||
headerItems: [
|
headerItems: [
|
||||||
Button {
|
Button {
|
||||||
text: qsTr("App Settings")
|
text: qsTr("App Settings")
|
||||||
|
@@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import EVChargerApp
|
import EVChargerApp
|
||||||
|
|
||||||
StackView {
|
AnimatedStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
|
|
||||||
function backPressed() {
|
function backPressed() {
|
||||||
|
@@ -3,7 +3,7 @@ import QtQuick.Controls
|
|||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import EVChargerApp
|
import EVChargerApp
|
||||||
|
|
||||||
StackView {
|
AnimatedStackView {
|
||||||
id: stackView
|
id: stackView
|
||||||
|
|
||||||
function backPressed() {
|
function backPressed() {
|
||||||
|
1
qmldir
1
qmldir
@@ -3,6 +3,7 @@ module EVChargerApp
|
|||||||
EVChargerApp 1.0 AboutPage.qml
|
EVChargerApp 1.0 AboutPage.qml
|
||||||
EVChargerApp 1.0 AccessPage.qml
|
EVChargerApp 1.0 AccessPage.qml
|
||||||
EVChargerApp 1.0 AddDeviceScreen.qml
|
EVChargerApp 1.0 AddDeviceScreen.qml
|
||||||
|
EVChargerApp 1.0 AnimatedStackView.qml
|
||||||
EVChargerApp 1.0 ApiKeyValueItem.qml
|
EVChargerApp 1.0 ApiKeyValueItem.qml
|
||||||
EVChargerApp 1.0 ApiSettingsPage.qml
|
EVChargerApp 1.0 ApiSettingsPage.qml
|
||||||
EVChargerApp 1.0 AppInstance.qml
|
EVChargerApp 1.0 AppInstance.qml
|
||||||
|
Reference in New Issue
Block a user