summaryrefslogtreecommitdiffstats
path: root/sample/qml
diff options
context:
space:
mode:
authorwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-02-13 18:10:20 +0800
committerwang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>2019-02-15 10:56:06 +0800
commitaee1b69e8e207081a3d8b2670980671a9fbc78b8 (patch)
tree86e71a4d08908c8c6711400a810bbbb00f19f803 /sample/qml
parent483c21f9d648f2cd58e00f39fcbee7b5dcbe2bc5 (diff)
Add onscreenapp
Onscreenapp is a qt application for showing onscreens. Applications can show/hide onscreen by calling homescreen-service's showWindow/hideWindow verb. Applications also can customize onscreen's title,type, display contents and buttons. Some images about onscreen pattern had uploaded in JIRA SPEC-1967. Bug-AGL: SPEC-1967 Change-Id: I421193f7d089584a26db629be27414d050a74337 Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Diffstat (limited to 'sample/qml')
-rw-r--r--sample/qml/images/answer.pngbin0 -> 2688 bytes
-rw-r--r--sample/qml/images/disable.pngbin0 -> 2714 bytes
-rw-r--r--sample/qml/images/heart_1079x400.pngbin0 -> 20429 bytes
-rw-r--r--sample/qml/images/images.qrc9
-rw-r--r--sample/qml/images/oval_1079x400.pngbin0 -> 18800 bytes
-rw-r--r--sample/qml/images/reject.pngbin0 -> 4820 bytes
-rw-r--r--sample/qml/msg.qml91
-rw-r--r--sample/qml/phone.qml118
-rw-r--r--sample/qml/system.qml59
-rw-r--r--sample/qml/vics.qml47
10 files changed, 324 insertions, 0 deletions
diff --git a/sample/qml/images/answer.png b/sample/qml/images/answer.png
new file mode 100644
index 0000000..4707a23
--- /dev/null
+++ b/sample/qml/images/answer.png
Binary files differ
diff --git a/sample/qml/images/disable.png b/sample/qml/images/disable.png
new file mode 100644
index 0000000..8c08c03
--- /dev/null
+++ b/sample/qml/images/disable.png
Binary files differ
diff --git a/sample/qml/images/heart_1079x400.png b/sample/qml/images/heart_1079x400.png
new file mode 100644
index 0000000..e1fe683
--- /dev/null
+++ b/sample/qml/images/heart_1079x400.png
Binary files differ
diff --git a/sample/qml/images/images.qrc b/sample/qml/images/images.qrc
new file mode 100644
index 0000000..b75641f
--- /dev/null
+++ b/sample/qml/images/images.qrc
@@ -0,0 +1,9 @@
+<RCC>
+ <qresource prefix="/images">
+ <file>oval_1079x400.png</file>
+ <file>heart_1079x400.png</file>
+ <file>answer.png</file>
+ <file>reject.png</file>
+ <file>disable.png</file>
+ </qresource>
+</RCC>
diff --git a/sample/qml/images/oval_1079x400.png b/sample/qml/images/oval_1079x400.png
new file mode 100644
index 0000000..fb850df
--- /dev/null
+++ b/sample/qml/images/oval_1079x400.png
Binary files differ
diff --git a/sample/qml/images/reject.png b/sample/qml/images/reject.png
new file mode 100644
index 0000000..d6586e1
--- /dev/null
+++ b/sample/qml/images/reject.png
Binary files differ
diff --git a/sample/qml/msg.qml b/sample/qml/msg.qml
new file mode 100644
index 0000000..f89ffa0
--- /dev/null
+++ b/sample/qml/msg.qml
@@ -0,0 +1,91 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+
+Item {
+ id: onScreenMsg
+ visible: true
+ width: 1079
+ height: 400
+ scale: screenInfo.scale_factor()
+
+ function qmlOnScreenParameter(message) {
+ console.log(qsTr('OnScreenVICS:QML:System >>> qmlOnScreenMessage.'), message);
+ var message_json = JSON.parse (message);
+ data1.text = message_json.data1;
+ data2.text = message_json.data2;
+ data3.text = message_json.data3;
+ }
+
+ RowLayout {
+ id: line1
+ x: 40
+ y: 72
+ width: 1000
+ height: 200
+ spacing: 20
+ Label {
+ id: data1
+ color: "#eeeeec"
+ text: "show data1"
+ font.pixelSize: 20
+ textFormat: Text.AutoText
+ font.wordSpacing: 0
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ Label {
+ id: data2
+ color: "#eeeeec"
+ text: "show data2"
+ font.pixelSize: 20
+ textFormat: Text.AutoText
+ font.wordSpacing: 0
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ Label {
+ id: data3
+ color: "#eeeeec"
+ text: "show data3"
+ font.pixelSize: 20
+ textFormat: Text.AutoText
+ font.wordSpacing: 0
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ }
+
+ RowLayout {
+ anchors.top: line1.bottom
+ anchors.topMargin: 60
+ anchors.horizontalCenter: parent.horizontalCenter
+ Button {
+ id: button1
+ text: qsTr("Button1")
+ onClicked: {
+ eventHandler.onScreenReply("Button1");
+ }
+ }
+ Button {
+ id: button2
+ text: qsTr("Button2")
+ onClicked: {
+ eventHandler.onScreenReply("Button2");
+ }
+ }
+ Button {
+ id: button3
+ text: qsTr("Button3")
+ onClicked: {
+ eventHandler.onScreenReply("Button3");
+ }
+ }
+ }
+
+}
diff --git a/sample/qml/phone.qml b/sample/qml/phone.qml
new file mode 100644
index 0000000..1b25ed3
--- /dev/null
+++ b/sample/qml/phone.qml
@@ -0,0 +1,118 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+
+Item {
+ id: onScreenPhone
+ visible: true
+ width: 1079
+ height: 400
+ scale: screenInfo.scale_factor()
+ property string messageText: "Incoming Call"
+
+ function qmlOnScreenParameter(message) {
+ console.log(qsTr('OnScreenApp:QML:Phone >>> qmlOnScreenParameter.'), message);
+ var message_json = JSON.parse (message);
+ var text = message_json.status
+
+ if(text === "incoming call")
+ {
+ messageText = "Incoming Call";
+ answerButton.active = true;
+ answerButton.checked = false;
+ }
+ else if(text === "call answered")
+ {
+ messageText = "Call Answered";
+ answerButton.active = false;
+ answerButton.checked = true;
+ }
+ else if(text === "call rejected")
+ {
+ messageText = "Call Rejected";
+ answerButton.active = false;
+ answerButton.checked = true;
+ }
+ else {
+ messageText = text;
+ }
+ }
+
+ Image {
+ id : background_image
+ anchors.fill: parent
+ anchors.topMargin: 0
+ anchors.bottomMargin: 0
+ source: "images/heart_1079x400.png"
+ }
+
+ ToggleButton {
+ id: answerButton
+ x: 53
+ y: 147
+ width: 228
+ height: 230
+ onImage: 'images/disable.png'
+ offImage: 'images/answer.png'
+ property bool active: true
+
+ onCheckedChanged: {
+ if(!checked && !active) {
+ checked = true;
+ }
+ if(active && checked)
+ {
+ messageText = "Call Answer"
+ eventHandler.onScreenReply("call answer");
+ active = false;
+ }
+ }
+ }
+
+ ImageButton {
+ id: rejectButton
+ x: 804
+ y: 142
+ width: 228
+ height: 230
+ offImage: 'images/reject.png'
+
+ onClicked: {
+ messageText = "Call Reject"
+ eventHandler.onScreenReply("call reject");
+ }
+ }
+
+ Label {
+ x: 400
+ y: 115
+ width: 280
+ height: 100
+ color: "#000000"
+ text: messageText
+ textFormat: Text.AutoText
+ wrapMode: Text.WordWrap
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 50
+ font.weight: Font.ExtraBold
+ }
+
+ Label {
+ x: 395
+ y: 112
+ width: 280
+ height: 100
+ color: "#6BFBFF"
+ text: messageText
+ textFormat: Text.AutoText
+ wrapMode: Text.WordWrap
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: 50
+ font.weight: Font.DemiBold
+ }
+
+}
diff --git a/sample/qml/system.qml b/sample/qml/system.qml
new file mode 100644
index 0000000..d42eeb7
--- /dev/null
+++ b/sample/qml/system.qml
@@ -0,0 +1,59 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+
+Item {
+ id: onScreenSystem
+ visible: true
+ width: 1079
+ height: 400
+ scale: screenInfo.scale_factor()
+
+ function qmlOnScreenParameter(message) {
+ console.log(qsTr('OnScreenSys:QML:System >>> qmlOnScreenMessage.'), message);
+ var message_json = JSON.parse (message);
+ var text = message_json.text
+ label.text = text;
+ }
+
+ Image {
+ id : background_image
+ anchors.fill: parent
+ anchors.topMargin: 0
+ anchors.bottomMargin: 0
+ source: "images/oval_1079x400.png"
+ }
+
+ Label {
+ id: label
+ x: 40
+ y: 72
+ width: 1000
+ height: 100
+ color: "#eeeeec"
+ text: "system alert"
+ font.pixelSize: 50
+ textFormat: Text.AutoText
+ font.wordSpacing: 0
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ Button {
+ id: button
+// x: 490
+// y: 250
+ anchors.top: label.bottom
+ anchors.topMargin: 100
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: qsTr("OK")
+
+ onClicked: {
+// label.text = "system reject"
+ eventHandler.onScreenReply("OK");
+ }
+ }
+
+}
diff --git a/sample/qml/vics.qml b/sample/qml/vics.qml
new file mode 100644
index 0000000..2848fbc
--- /dev/null
+++ b/sample/qml/vics.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+
+Item {
+ id: onScreenVICS
+ visible: true
+ width: 1079
+ height: 400
+ scale: screenInfo.scale_factor()
+
+ function qmlOnScreenParameter(message) {
+ console.log(qsTr('OnScreenVICS:QML:System >>> qmlOnScreenMessage.'), message);
+ var message_json = JSON.parse (message);
+ vics_info.text = message_json.info;
+ }
+
+ Label {
+ id: vics_info
+ x: 40
+ y: 72
+ width: 1000
+ height: 200
+ color: "#eeeeec"
+ text: "show vics inofo"
+ font.pixelSize: 50
+ textFormat: Text.AutoText
+ font.wordSpacing: 0
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ }
+
+ Button {
+ id: button
+ anchors.top: vics_info.bottom
+ anchors.topMargin: 100
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: qsTr("OK")
+
+ onClicked: {
+ eventHandler.onScreenReply("OK");
+ }
+ }
+
+}