X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=homescreen%2Fqml%2FSpeechChrome.qml;h=123928c4d649a7c727263d80a17968c500938750;hb=refs%2Ftags%2Flamprey_12.1.16;hp=911d481b31d53efbf7763de042b4744a249d0b15;hpb=f3de2f5cad06a772ee55f58694d559a7cb012c02;p=apps%2Fhomescreen.git diff --git a/homescreen/qml/SpeechChrome.qml b/homescreen/qml/SpeechChrome.qml index 911d481..123928c 100644 --- a/homescreen/qml/SpeechChrome.qml +++ b/homescreen/qml/SpeechChrome.qml @@ -7,6 +7,7 @@ Item { clip: true property bool agentPresent: speechChromeController.agentPresent + property string agentName: speechChromeController.agentName visible: agentPresent @@ -25,7 +26,7 @@ Item { } Image { - id: pushToTalk + id: pushToTalkLeft height: parent.height * 0.80 width: height @@ -33,7 +34,28 @@ Item { anchors.left: parent.left anchors.leftMargin: parent.width / 128 anchors.verticalCenter: parent.verticalCenter - source: "./images/SpeechChrome/push_to_talk.svg" + source: agentName === "Alexa" ? "./images/SpeechChrome/push_to_talk_alexa.png" : "./images/SpeechChrome/push_to_talk.svg" + + MouseArea { + anchors.fill: parent + onPressed: speechChromeController.pushToTalk() + } + + Behavior on opacity { + NumberAnimation { duration: 250 } + } + } + + Image { + id: pushToTalkRight + + height: parent.height * 0.80 + width: height + + anchors.right: parent.right + anchors.rightMargin: parent.width / 128 + anchors.verticalCenter: parent.verticalCenter + source: agentName === "Alexa" ? "./images/SpeechChrome/push_to_talk_alexa.png" : "./images/SpeechChrome/push_to_talk.svg" MouseArea { anchors.fill: parent @@ -55,7 +77,12 @@ Item { x: 0 } PropertyChanges { - target: pushToTalk + target: pushToTalkLeft + opacity: 1.0 + enabled: true + } + PropertyChanges { + target: pushToTalkRight opacity: 1.0 enabled: true } @@ -69,7 +96,12 @@ Item { x: 0 } PropertyChanges { - target: pushToTalk + target: pushToTalkLeft + opacity: 0.0 + enabled: false + } + PropertyChanges { + target: pushToTalkRight opacity: 0.0 enabled: false } @@ -83,7 +115,12 @@ Item { x: root.width - chromeBarImage.width } PropertyChanges { - target: pushToTalk + target: pushToTalkLeft + opacity: 0.0 + enabled: false + } + PropertyChanges { + target: pushToTalkRight opacity: 0.0 enabled: false } @@ -97,7 +134,12 @@ Item { x: (root.width - chromeBarImage.width) * 0.5 } PropertyChanges { - target: pushToTalk + target: pushToTalkLeft + opacity: 0.0 + enabled: false + } + PropertyChanges { + target: pushToTalkRight opacity: 0.0 enabled: false } @@ -111,7 +153,12 @@ Item { x: 0 } PropertyChanges { - target: pushToTalk + target: pushToTalkLeft + opacity: 1.0 + enabled: true + } + PropertyChanges { + target: pushToTalkRight opacity: 1.0 enabled: true }