diff --git a/apps.json b/apps.json index 50f76f875..c8f0a58c7 100644 --- a/apps.json +++ b/apps.json @@ -1768,8 +1768,8 @@ "name": "Find Phone", "shortName":"Find Phone", "icon": "app.png", - "version":"0.01", - "description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳", + "version":"0.02", + "description": "Find your phone via Gadgetbridge. Click any button to let your phone ring. 📳 Note: The functionality is available even without this app, just go to Settings, App Settings, Gadgetbridge, Find Phone.", "tags": "tool,android", "readme": "README.md", "allow_emulator": true, diff --git a/apps/findphone/ChangeLog b/apps/findphone/ChangeLog index 9297fc6c7..86558abf5 100644 --- a/apps/findphone/ChangeLog +++ b/apps/findphone/ChangeLog @@ -1 +1,2 @@ -0.01: First Version \ No newline at end of file +0.01: First Version +0.02: Remove HID requirement, update screen diff --git a/apps/findphone/README.md b/apps/findphone/README.md index 870847222..c655457a2 100644 --- a/apps/findphone/README.md +++ b/apps/findphone/README.md @@ -2,8 +2,7 @@ Ring your phone via GadgetBridge if you lost it somewhere. -1. Enable HID in settings -2. Connect GadgetBridge -3. Lose phone -4. Open app -5. Click any button or screen +1. Connect GadgetBridge +2. Lose phone +3. Open app +4. Click any button or screen diff --git a/apps/findphone/app.js b/apps/findphone/app.js index a532e3b50..4b9ea02f5 100644 --- a/apps/findphone/app.js +++ b/apps/findphone/app.js @@ -1,33 +1,34 @@ -var storage = require('Storage'); - //notify your phone -function find(){ - Bluetooth.println(JSON.stringify({t:"findPhone", n:true})); + +var finding = false; + +function draw() { + // show message + g.clear(); + require("Font8x12").add(Graphics); + g.setFont("8x12",3); + g.setFontAlign(0,0); + g.setColor(0x03E0); + if (finding) { + g.drawString("Finding...", g.getWidth()/2, (g.getHeight()/2)-20); + g.drawString("Click to stop", g.getWidth()/2, (g.getHeight()/2)+20); + } else { + g.drawString("Click to find", g.getWidth()/2, g.getHeight()/2); + } + g.flip(); } -//init graphics -g.clear(); -require("Font8x12").add(Graphics); -g.setFont("8x12",3); -g.setFontAlign(0,0); -g.flip(); +function find(){ + finding = !finding; + draw(); + Bluetooth.println("\n"+JSON.stringify({t:"findPhone", n:finding})); +} -//init settings -const settings = storage.readJSON('setting.json',1) || { HID: false }; +draw(); -//check if HID enabled and show message -if (settings.HID=="kb" || settings.HID=="kbmedia") { - g.setColor(0x03E0); - g.drawString("click to find", g.getWidth()/2, g.getHeight()/2); - - //register all buttons and screen to find phone - setWatch(find, BTN1); - setWatch(find, BTN2); - setWatch(find, BTN3); - setWatch(find, BTN4); - setWatch(find, BTN5); - -}else{ - g.setColor(0xf800); - g.drawString("enable HID!", g.getWidth()/2, g.getHeight()/2); -} \ No newline at end of file +//register all buttons and screen to find phone +setWatch(find, BTN1, {repeat:true}); +setWatch(find, BTN2, {repeat:true}); +setWatch(find, BTN3, {repeat:true}); +setWatch(find, BTN4, {repeat:true}); +setWatch(find, BTN5, {repeat:true});