2023-11-30 18:28:55 +00:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2022-05-13 13:12:05 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2018-09-13 13:19:03 +00:00
|
|
|
|
2020-03-26 16:01:51 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
2018-09-13 13:19:03 +00:00
|
|
|
|
2023-05-11 02:27:08 +00:00
|
|
|
import WearableSettings
|
2018-09-13 13:19:03 +00:00
|
|
|
|
|
|
|
Item {
|
2023-11-30 18:28:55 +00:00
|
|
|
id: demoItem
|
|
|
|
required property StackView stackView
|
2018-09-13 13:19:03 +00:00
|
|
|
|
|
|
|
SequentialAnimation {
|
|
|
|
id: demoModeAnimation
|
2023-11-30 18:28:55 +00:00
|
|
|
loops: 2 //darkMode and lightMode
|
2023-05-11 02:27:08 +00:00
|
|
|
running: WearableSettings.demoMode
|
2018-09-13 13:19:03 +00:00
|
|
|
|
|
|
|
// Go back to the launcher page.
|
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the world clock page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.currentIndex = 0 }
|
|
|
|
PauseAnimation { duration: 1000 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("World Clock"), "WorldClockPage.qml", "") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
|
|
|
// Swipe across a few times.
|
|
|
|
SequentialAnimation {
|
|
|
|
loops: 6
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.children[0].incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2500 }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the navigation page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Navigation"), "NavigationPage.qml", "NavigationFallbackPage.qml") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
// Scroll through the route.
|
2018-09-13 13:19:03 +00:00
|
|
|
SequentialAnimation {
|
2023-11-30 18:28:55 +00:00
|
|
|
loops: 23
|
2018-09-13 13:19:03 +00:00
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementPoint() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the weather page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Weather"), "WeatherPage.qml", "") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
// Flick down..
|
2018-09-13 13:19:03 +00:00
|
|
|
SequentialAnimation {
|
2023-11-30 18:28:55 +00:00
|
|
|
loops: 3
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.children[0].flick(0, - 800) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the fitness page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Fitness"), "FitnessPage.qml", "") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
// Swipe across once.
|
2018-09-13 13:19:03 +00:00
|
|
|
SequentialAnimation {
|
2023-11-30 18:28:55 +00:00
|
|
|
loops: 1
|
2018-09-13 13:19:03 +00:00
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.children[0].incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
}
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
|
|
|
// Open the notifications page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Notifications"), "NotificationsPage.qml", "") }
|
2024-03-15 13:26:12 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
2018-09-13 13:19:03 +00:00
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the alarms page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Alarm"), "AlarmsPage.qml", "") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
|
|
|
// Toggle the switch.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(0).onSwitch.toggle() }
|
|
|
|
PauseAnimation { duration: 500 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(1).onSwitch.toggle() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(0).hourTumbler.currentIndex = 8 }
|
|
|
|
PauseAnimation { duration: 200 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(0).minuteTumbler.currentIndex = 15 }
|
|
|
|
PauseAnimation { duration: 300 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(1).hourTumbler.currentIndex = 9 }
|
|
|
|
PauseAnimation { duration: 200 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(1).minuteTumbler.currentIndex = 45 }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.addAlarm() }
|
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(2).onSwitch.toggle() }
|
|
|
|
PauseAnimation { duration: 100 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(0).onSwitch.toggle() }
|
|
|
|
PauseAnimation { duration: 100 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(1).onSwitch.toggle() }
|
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(2).hourTumbler.currentIndex = 10 }
|
|
|
|
PauseAnimation { duration: 200 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.alarmList.itemAtIndex(2).minuteTumbler.currentIndex = 30 }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 2000 }
|
|
|
|
|
2023-11-30 18:28:55 +00:00
|
|
|
|
2018-09-13 13:19:03 +00:00
|
|
|
// Open the settings page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.incrementCurrentIndex() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.launched(qsTr("Settings"), "SettingsPage.qml", "") }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 3000 }
|
|
|
|
|
|
|
|
// Toggle the switches.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.listView.brightnessItem.value = 80 }
|
|
|
|
PauseAnimation { duration: 1000 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.listView.bluetoothItem.toggle() }
|
|
|
|
PauseAnimation { duration: 1000 }
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.listView.wifiItem.toggle() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 1000 }
|
|
|
|
SequentialAnimation {
|
2023-11-30 18:28:55 +00:00
|
|
|
loops: 2
|
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.children[0].flick(0, - 800) }
|
|
|
|
PauseAnimation { duration: 500 }
|
2018-09-13 13:19:03 +00:00
|
|
|
}
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.currentItem.listView.darkmodeItem.toggle() }
|
2018-09-13 13:19:03 +00:00
|
|
|
PauseAnimation { duration: 3000 }
|
|
|
|
|
|
|
|
// Go back to the launcher page.
|
2023-11-30 18:28:55 +00:00
|
|
|
ScriptAction { script: demoItem.stackView.pop(null) }
|
2018-09-13 13:19:03 +00:00
|
|
|
}
|
|
|
|
}
|