diff --git a/apps/alyxclock/ChangeLog b/apps/alyxclock/ChangeLog new file mode 100644 index 000000000..9db0e26c5 --- /dev/null +++ b/apps/alyxclock/ChangeLog @@ -0,0 +1 @@ +0.01: first release diff --git a/apps/alyxclock/README.md b/apps/alyxclock/README.md new file mode 100644 index 000000000..7765a878f --- /dev/null +++ b/apps/alyxclock/README.md @@ -0,0 +1,4 @@ +# Half-Life Alyx Style clock + +![](screenshot_alyxclock.png) + diff --git a/apps/alyxclock/alyxclock.app.js b/apps/alyxclock/alyxclock.app.js new file mode 100644 index 000000000..57b7d7f48 --- /dev/null +++ b/apps/alyxclock/alyxclock.app.js @@ -0,0 +1,174 @@ +const icoH = [ + [0,1,1,0,0,1,1,0], + [1,1,1,1,1,1,1,1], + [1,1,1,1,1,1,1,1], + [1,1,1,1,1,1,1,1], + [0,1,1,1,1,1,1,0], + [0,0,1,1,1,1,0,0], + [0,0,0,1,1,0,0,0], + [0,0,0,0,0,0,0,0], +] + +const icoR = [ + [0,0,0,0,1,1,1,1,0,0,0,0], + [0,0,1,1,0,0,0,0,1,1,0,0], + [0,1,1,1,1,0,0,1,1,0,1,0], + [0,1,1,0,0,0,0,0,0,0,1,0], + [1,1,1,1,1,1,1,1,0,0,0,1], + [1,1,0,0,1,0,0,0,0,0,0,1], + [1,1,1,1,1,1,1,0,1,1,0,1], + [1,1,1,1,1,1,0,0,0,0,1,1], + [0,1,1,1,1,1,1,1,1,1,1,0], + [0,1,1,1,1,1,1,1,1,1,1,0], + [0,0,1,1,1,1,1,1,1,1,0,0], + [0,0,0,0,1,1,1,1,0,0,0,0], +] + +let idTimeout = null; + +function icon (icon, x, y, size, gap) { + const color = g.getColor(); + for (let r=0; r { let boxItem = boxes[boxKey]; @@ -272,6 +279,7 @@ * 9. Helper function for touch event * --------------------------------------------------------------- */ + let touchInText = function(e, boxItem, boxKey) { calcBoxSize(boxItem); const pos = calcBoxPos(boxKey); @@ -296,6 +304,7 @@ * 10. Setup function to configure event handlers * --------------------------------------------------------------- */ + let setup = function() { // ------------------------------------ // Define the touchHandler function @@ -343,6 +352,8 @@ // Define the dragHandler function // ------------------------------------ dragHandler = function(e) { + // Check if any box is being dragged + if (!Object.values(isDragging).some(Boolean)) return; // Calculate the movement distance movementDistance += Math.abs(e.dx) + Math.abs(e.dy); // Check if the movement distance exceeds a threshold @@ -396,6 +407,7 @@ * 11. Main execution part * --------------------------------------------------------------- */ + Bangle.loadWidgets(); widgets.swipeOn(); modSetColor(); diff --git a/apps/boxclk/metadata.json b/apps/boxclk/metadata.json index 6717b79d8..dd81ac436 100644 --- a/apps/boxclk/metadata.json +++ b/apps/boxclk/metadata.json @@ -1,7 +1,7 @@ { "id": "boxclk", "name": "Box Clock", - "version": "0.03", + "version": "0.05", "description": "A customizable clock with configurable text boxes that can be positioned to show your favorite background", "icon": "app.png", "screenshots": [ diff --git a/apps/clkinfosunrise/metadata.json b/apps/clkinfosunrise/metadata.json index d130c6453..7bcbb289b 100644 --- a/apps/clkinfosunrise/metadata.json +++ b/apps/clkinfosunrise/metadata.json @@ -5,6 +5,7 @@ "icon": "app.png", "type": "clkinfo", "tags": "clkinfo,sunrise", + "dependencies": {"mylocation":"app"}, "supports" : ["BANGLEJS2"], "storage": [ {"name":"sunrise.clkinfo.js","url":"clkinfo.js"} diff --git a/apps/podadrem/ChangeLog b/apps/podadrem/ChangeLog index 3c68f15ac..cfdf9fcd9 100644 --- a/apps/podadrem/ChangeLog +++ b/apps/podadrem/ChangeLog @@ -7,3 +7,4 @@ Addict. 0.06: Add compatibility with Fastload Utils. 0.07: Remove just the specific listeners to not interfere with Quick Launch when fastloading. +0.08: Issue newline before GB commands (solves issue with console.log and ignored commands) diff --git a/apps/podadrem/app.js b/apps/podadrem/app.js index 9c9ed8b04..01ee74231 100644 --- a/apps/podadrem/app.js +++ b/apps/podadrem/app.js @@ -144,6 +144,7 @@ let simpleSearchTerm = function() { // input a simple search term without tags, let searchPlayWOTags = function() { //make a search and play using entered terms searchString = simpleSearch; + Bluetooth.println(""); Bluetooth.println(JSON.stringify({ t: "intent", action: "android.media.action.MEDIA_PLAY_FROM_SEARCH", @@ -157,6 +158,7 @@ let searchPlayWOTags = function() { //make a search and play using entered terms }; let gadgetbridgeWake = function() { + Bluetooth.println(""); Bluetooth.println(JSON.stringify({ t: "intent", target: "activity", @@ -174,6 +176,7 @@ let actFn = function(actName, activOrServ) { // Send the intent message to Gadgetbridge let btMsg = function(activOrServ, cls, actName, xtra) { + Bluetooth.println(""); Bluetooth.println(JSON.stringify({ t: "intent", action: actFn(actName, activOrServ), diff --git a/apps/podadrem/metadata.json b/apps/podadrem/metadata.json index c58b9241d..02e255ca4 100644 --- a/apps/podadrem/metadata.json +++ b/apps/podadrem/metadata.json @@ -2,7 +2,7 @@ "id": "podadrem", "name": "Podcast Addict Remote", "shortName": "PA Remote", - "version": "0.07", + "version": "0.08", "description": "Control Podcast Addict on your android device.", "readme": "README.md", "type": "app", diff --git a/apps/swscroll/ChangeLog b/apps/swscroll/ChangeLog index 1adab01bb..9283a85da 100644 --- a/apps/swscroll/ChangeLog +++ b/apps/swscroll/ChangeLog @@ -2,4 +2,4 @@ 0.02: Rebasing on latest changes to showScroller_Q3 (https://github.com/espruino/Espruino/commit/2d3c34ef7c2b9fe2118e816aacd2e096adb99596). 0.03: Rebasing on latest changes to showScroller_Q3 (https://github.com/espruino/Espruino/commit/b6f8105b6348bb6f7cd03ac11efc1f3585c6ad79). Ensure that changing a menu item when half-scrolled off screen doesn't overwrite widgets. 0.04: Rebasing on latest changes to showScroller_Q3 (https://github.com/espruino/Espruino/commit/a0e2d9231df709849f81abf572a742b0fceab85b). Fixes missing `isActive` function that caused an error. - +0.05: Fix for the rebase in ver 0.04. Check boxes didn't behave but now they do. diff --git a/apps/swscroll/boot.js b/apps/swscroll/boot.js index 3c4b55817..1c5a84140 100644 --- a/apps/swscroll/boot.js +++ b/apps/swscroll/boot.js @@ -1,4 +1,4 @@ -E.showScroller = (function(options) { +E.showScroller = (function(options) { /* options = { h = height c = # of items @@ -19,20 +19,20 @@ E.showScroller = (function(options) { */ if (!options) return Bangle.setUI(); // remove existing handlers -var touchHandler = (_,e)=>{ - if (e.y=0) && i { + g.reset().clearRect(R).setClipRect(R.x,R.y,R.x2,R.y2); + var a = YtoIdx(R.y); + var b = Math.min(YtoIdx(R.y2),options.c-1); + for (var i=a;i<=b;i++) + options.draw(i, {x:R.x,y:idxToY(i),w:R.w,h:options.h}); + g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1); }; Bangle.setUI({ mode : "custom", back : options.back, remove : options.remove, + redraw : draw, swipe : (_,UD)=>{ pixels = 120; var dy = UD*pixels; @@ -45,13 +45,13 @@ Bangle.setUI({ rScroll = s.scroll &~1; dy = oldScroll-rScroll; if (!dy || options.c<=3) return; //options.c<=3 should maybe be dynamic, so 3 would be replaced by a variable dependent on R=Bangle.appRect. It's here so we don't try to scroll if all entries fit in the app rectangle. - g.reset().setClipRect(R.x,R.y,R.x2,R.y2); - g.scroll(0,dy); + g.reset().setClipRect(R.x,R.y,R.x2,R.y2).scroll(0,dy); var d = UD*pixels; if (d < 0) { - g.setClipRect(R.x,R.y2-(1-d),R.x2,R.y2); - let i = YtoIdx(R.y2-(1-d)); - let y = idxToY(i); + let y = Math.max(R.y2-(1-d), R.y); + g.setClipRect(R.x,y,R.x2,R.y2); + let i = YtoIdx(y); + y = idxToY(i); //print(i, options.c, options.c-i); //debugging info while (y < R.y2 - (options.h*((options.c-i)<=0)) ) { //- (options.h*((options.c-i)<=0)) makes sure we don't go beyond the menu entries in the menu object "options". This has to do with "dy = s.scroll - menuScrollMax-8" above. options.draw(i, {x:R.x,y:y,w:R.w,h:options.h}); @@ -59,10 +59,10 @@ Bangle.setUI({ y += options.h; } } else { // d>0 - g.setClipRect(R.x,R.y,R.x2,R.y+d); - let i = YtoIdx(R.y+d); - let y = idxToY(i); - //print(i, options.c, options.c-i); //debugging info + let y = Math.min(R.y+d, R.y2); + g.setClipRect(R.x,R.y,R.x2,y); + let i = YtoIdx(y); + y = idxToY(i); while (y > R.y-options.h) { options.draw(i, {x:R.x,y:y,w:R.w,h:options.h}); y -= options.h; @@ -70,7 +70,15 @@ Bangle.setUI({ } } g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1); - }, touch : touchHandler + }, touch : (_,e)=>{ + if (e.y=0) && i { - g.reset().clearRect(R.x,R.y,R.x2,R.y2); - g.setClipRect(R.x,R.y,R.x2,R.y2); - var a = YtoIdx(R.y); - var b = Math.min(YtoIdx(R.y2),options.c-1); - for (var i=a;i<=b;i++) - options.draw(i, {x:R.x,y:idxToY(i),w:R.w,h:options.h}); - g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1); -}, drawItem : i => { - var y = idxToY(i); - g.reset().setClipRect(R.x,Math.max(y,R.y),R.x2,Math.min(y+options.h,R.y2)); - options.draw(i, {x:R.x,y:y,w:R.w,h:options.h}); - g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1); - }, isActive : () => Bangle.touchHandler == touchHandler - }; + draw : draw, drawItem : i => { + var y = idxToY(i); + g.reset().setClipRect(R.x,Math.max(y,R.y),R.x2,Math.min(y+options.h,R.y2)); + options.draw(i, {x:R.x,y:y,w:R.w,h:options.h}); + g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1); + }, isActive : () => Bangle.uiRedraw == draw +}; var rScroll = s.scroll&~1; // rendered menu scroll (we only shift by 2 because of dither) s.draw(); // draw the full scroller g.flip(); // force an update now to make this snappier diff --git a/apps/swscroll/metadata.json b/apps/swscroll/metadata.json index 3258b9b21..3c0717d14 100644 --- a/apps/swscroll/metadata.json +++ b/apps/swscroll/metadata.json @@ -1,7 +1,7 @@ { "id": "swscroll", "name": "Swipe menus", - "version": "0.04", + "version": "0.05", "description": "Replace built in E.showScroller to act on swipe instead of drag. Navigate menus in discrete steps instead of a continuous motion.", "readme": "README.md", "icon": "app.png",