Avatar for rigrig

rigrig

Member since Apr 2020 • Last active May 2022
  • 7 conversations
  • 109 comments

Most recent activity

  • in Bangle.js
    Avatar for rigrig

    You can definitely bind to the event in more places: if (_GB) setTimeout(_GB,0,event); passes on the message after you handle it.
    But Gadgetbridge Music Controls deliberately doesn't pass on music events (to prevent the messages app from loading)

  • in Bangle.js
    Avatar for rigrig

    Is there a better way?

    Not really, and you probably need to load() the clock anyway after you're done, because it needs to fully redraw itself.
    The launcher only shows <appid>.app.js files, so you can just add e.g. <appid>.showAlert.js and load(<appid>.showAlert.js).

  • in Bangle.js
    Avatar for rigrig

    On the one hand, in my fork (still wip) I already changed the library to do Bangle.emit("message", type, event);, so it would be relatively easy to just split it up and do

    Bangle.on("message", (type, msg)=>{
          if (type !== 'text') return;
          // handle text messages here
    });
    

    One problem with splitting it up is that instead of just installing a messaging app, users would need to install 5 apps (also for alarms) to get all notifications (6 if you also count the android library). I think that would get rather messy even before you get multiple alternatives for each.

    On the other hand, I think it would indeed clean things up a fair bit to properly split the code, although switching between e.g. playing music and incoming messages might become less smooth.

  • in Bangle.js
    Avatar for rigrig

    This should work with the latest firmware:

    
        var list = [];
        list[0] = 10;
        list[1] = 20;
        list[2] = 30;
        list[3] = 40;
        list[4] = 50;
        list[5] = 60;
        list[6] = 70;
        var s = E.showScroller({
          h : 40, c : list.length,
          draw : (idx, r) => {
            g.clearRect(r.x,r.y,r.x+r.w-1,r.y+r.h-1)­;
            g.setFont("6x8:2").drawString(list[idx],­r.x+10,r.y+4);
          },
          select : (idx) => console.log("You selected ", idx)
          }
        );
      setInterval(function(){
          list = list.map(i => i-1);
          s.draw();
      }, 1000);
    
  • in Bangle.js
    Avatar for rigrig

    The fonts (and most other modules) aren't built-in to the watch: when you do require("Font8x12"), the uploader is smart enough to figure out you want to use Font8x12, and includes it in-line with the uploaded code.
    But the uploader isn't smart enough to figure out which module to include for require(<variable>).

  • in Bangle.js
    Avatar for rigrig

    Well, there definitely is a difference between Firefox and Chrome now (see attachments), so I actually wouldn't be too surprised if Chrome did change something.

  • in Bangle.js
    Avatar for rigrig

    For charging there is Bangle.isCharging.
    "Not on a wrist" is tricky, but I guess you could use the accelerometer and check if there is no movement for a certain period. Maybe even check for x and y being zero if you always place it face up/down.

  • in Bangle.js
    Avatar for rigrig

    The last time I tracked down a memory leak, this tool was very helpful.

    • 11 comments
    • 549 views
  • in Bangle.js
    Avatar for rigrig

    it feels like maybe there are more important things for everyone to work on fixing than whether the version numbers start with 1 or 0.

    You're probably right, as for showing the date: PR with last update in hover

Actions