From 95fbbc19a674b5ad7003b8fbfceb02b465b23747 Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Tue, 12 Sep 2023 10:54:30 +0200 Subject: [PATCH] example 'meshtastic': add animation in broadcast mode --- examples/meshtastic/qml/ext/Group.qml | 2 ++ examples/meshtastic/qml/ext/Messages.qml | 32 ++++++++++++++++++++++++ examples/meshtastic/qml/main.qml | 1 + examples/meshtastic/readme.md | 12 +++------ 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/examples/meshtastic/qml/ext/Group.qml b/examples/meshtastic/qml/ext/Group.qml index f5ba51e..a04354f 100644 --- a/examples/meshtastic/qml/ext/Group.qml +++ b/examples/meshtastic/qml/ext/Group.qml @@ -69,6 +69,7 @@ Rectangle { if (person.current) { view.currentIndex = broadcast ? 0 : i view.positionViewAtIndex(view.currentIndex, ListView.Contain) + rootItem.broadcast = broadcast } } @@ -154,6 +155,7 @@ Rectangle { function selected() { view.currentIndex = index Lisp.call("lora:change-receiver", model.nodeNum>>>0) // uint32 + rootItem.broadcast = (index === 0) } MouseArea { diff --git a/examples/meshtastic/qml/ext/Messages.qml b/examples/meshtastic/qml/ext/Messages.qml index 4f4b7e4..a4ad3c2 100644 --- a/examples/meshtastic/qml/ext/Messages.qml +++ b/examples/meshtastic/qml/ext/Messages.qml @@ -286,6 +286,38 @@ Rectangle { } } } + + Image { + id: broadcast + anchors.right: send.left + anchors.bottom: parent.top + anchors.margins: 3 + width: 38 + height: width + opacity: 0.7 + source: "../img/broadcast.png" + visible: send.visible && animation.running + + SequentialAnimation { + id: animation + loops: Animation.Infinite + running: rootItem.broadcast + + ScaleAnimator { + target: broadcast + from: 0.8; to: 1.0 + duration: 500 + easing.type: Easing.InOutSine + } + + ScaleAnimator { + target: broadcast + from: 1.0; to: 0.8 + duration: 500 + easing.type: Easing.InOutSine + } + } + } } Ext.Emojis { diff --git a/examples/meshtastic/qml/main.qml b/examples/meshtastic/qml/main.qml index 783d24a..0ec3f48 100644 --- a/examples/meshtastic/qml/main.qml +++ b/examples/meshtastic/qml/main.qml @@ -13,6 +13,7 @@ Item { property double headerHeight: 48 property bool mobile: (Qt.platform.os === "android") || (Qt.platform.os === "ios") + property bool broadcast: false function showKeyboard(show) { show ? Qt.inputMethod.show() : Qt.inputMethod.hide() diff --git a/examples/meshtastic/readme.md b/examples/meshtastic/readme.md index 41afa2c..18c5e62 100644 --- a/examples/meshtastic/readme.md +++ b/examples/meshtastic/readme.md @@ -75,15 +75,11 @@ doesn't have a display, use `123456` as your PIN. On Windows it didn't work for me if not paired previously. -It may occur that your radio device is sometimes not found; first +It may occur that your radio device is sometimes not found; some suggestions: -* try to press-and-hold on the radio icon (will restart device discovery) - -Only if this doesn't work, you may - -* try to turn bluetooth off and on again, and/or: -* try to reboot your radios, and/or: -* try to unpair your radios from all computers/devices +* try to unpair your radio from current device +* try to turn bluetooth off and on again +* try to reboot your radio A generic bluetooth app like **nRF Connect** may help in order to see if the devices themselves work and are able to connect.