summaryrefslogtreecommitdiffstats
path: root/demo3/vertical/restriction/app/main.qml
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-14 13:01:56 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-14 13:01:56 +0900
commit36fe083c39bef0a17328f008d4935a562efa123b (patch)
tree2aeff4166711be57aa79cad0bf9b74f0468f5dd0 /demo3/vertical/restriction/app/main.qml
parent990474de8e93bf295e2aa65610c5298c4faac364 (diff)
This applciation is used to display restriction text, When car is running and videoplayer is showing. Change-Id: If8f287cd129638ccc0c87d03cc9dc7c53953f916 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'demo3/vertical/restriction/app/main.qml')
-rw-r--r--demo3/vertical/restriction/app/main.qml67
1 files changed, 67 insertions, 0 deletions
diff --git a/demo3/vertical/restriction/app/main.qml b/demo3/vertical/restriction/app/main.qml
new file mode 100644
index 0000000..15369cf
--- /dev/null
+++ b/demo3/vertical/restriction/app/main.qml
@@ -0,0 +1,67 @@
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+
+ApplicationWindow {
+ id: root
+
+ color: "#00000000"
+
+ Label {
+ id: message
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ anchors.margins: 20
+ font.pixelSize: 75
+ wrapMode: Text.WordWrap
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "white"
+ text: "Only the video’s sound will be available while driving."
+ }
+
+ background : Image {
+ id: backgroundImg
+ anchors.fill: parent
+ anchors.topMargin: 0
+ anchors.bottomMargin: 0
+
+ visible: true
+ fillMode: Image.Stretch
+ source: 'images/black_normal.png'
+
+ state: "begin"
+ states: [
+ State {
+ name: "begin"
+ PropertyChanges { target: backgroundImg; opacity: 0.25 }
+ },
+ State {
+ name: "end"
+ PropertyChanges { target: backgroundImg; opacity: 0.75 }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ from: "begin"; to: "end"
+ PropertyAnimation {target: backgroundImg; properties: "opacity"; duration: 2000}
+ }
+ ]
+ }
+
+ function showImage(area) {
+ if (area === 'normal') {
+ backgroundImg.source = 'images/black_normal.png'
+ } else {
+ backgroundImg.source = 'images/black_split.png'
+ }
+ backgroundImg.state = "end"
+ }
+
+
+ function hideImage() {
+ backgroundImg.state = "begin"
+ }
+}