From aee1b69e8e207081a3d8b2670980671a9fbc78b8 Mon Sep 17 00:00:00 2001 From: wang_zhiqiang Date: Wed, 13 Feb 2019 18:10:20 +0800 Subject: 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 --- sample/qml/phone.qml | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sample/qml/phone.qml (limited to 'sample/qml/phone.qml') 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 + } + +} -- cgit 1.2.3-korg