Making a Dock app and want to know what is possible.

Posted on
  • Hi
    I made that attached bangle Dock after seeing @Gordon awesome wood one so I just want to show that off to start :-P

    Due to lock down my bangle spends most of its time in this dock so I want to make a more elaborate app to go with it rather than the current Dock app, which is fine but I feel is meant for when you have things to monter.
    Current list of possible features.
    1) start the app when places in charger dock (should be easy with the current Dock code)
    2) simple clock (like the one currently done in Dock app, but bigger)
    3) Move widgets to the left-hand side of the screen (now top in the dock). - I am not sure how to do this one? Is there a universal value for the widget bar that can be changed by other apps?
    4) have notifications pop up on this repositioned widget bar
    5) Power saving -I know it will be on change anyway but was thinking of having a setting for times when the led brightness is lowered to 0.2, i.e. during the middle of the night

    The point is to make the bangle into more of a smart bedside clock when it is the dock.
    I have let to start working with bangle code so I wanted to check if I was attempting a bit more then was currently posable with the widgets etc?
    Either way, something to do during lockdown so happy new year everyone.


    1 Attachment

    • IMG_20201231_105112-COLLAGE.jpg
  • Nice! It's great that you can make something usable even with a few bits of tape :)

    3) Move widgets to the left-hand side of the screen (now top in the dock). - I am not sure how to do this one? Is there a universal value for the widget bar that can be changed by other apps?

    WIDGETS.forEach(w=>w.area="tl");Bangle.d­rawWidgets(); should do it :)

    4) have notifications pop up on this repositioned widget bar

    Should be ok - you'd need to make your own notify module for this but you could check out the existing notify/notifyfs for examples.

    5) Power saving -I know it will be on change anyway but was thinking of having a setting for times when the led brightness is lowered to 0.2, i.e. during the middle of the night

    This is something that there's an issue open for already, so it might get made a separate app at some point - but it'd be pretty easy to add something to your dock app.

  • For the WIDGETS part of WIDGETS.forEach(w=>w.area="tl");Bangle.d­rawWidgets(); do I need to define WIDGETS ? Or do I need to make my own WIDGETS for this to work?
    Thanks

  • You just need to have called Bangle.loadWidgets() before - which is what an app that uses widgets should have to do anyway.

  • Ok, but then I get the error "Uncaught Error: Function "forEach" not found!"
    Is that just as I am running it on the emulator and thus there are no widgets running for it to run over?

  • Ow I tested it on the watch but I think the widgets are only called when you are one the watch face? I will have a look at some of the lancher/other apps that use the widgets and work it out :-)

  • Ahh - actually sorry, I think that was bad code on my part. WIDGETS is an object, not an array - so for (var w of WIDGETS) w.area="tl"; would be better

  • That's works better :-)
    Thou I think the position of the widgets is changed along the now top, so that now the battery one, for example, use to be on the far right but now it is in the middle with other widgets either side of it.
    Might have to play around with it to see why that is

  • The order of them is just due to the installation order at the moment (although I guess it might make sense to have a 'sortorder' field in there). Nothing stops you from changing the order if items in the WIDGETS object though:

    function moveToRight(n) {
      var w = WIDGETS[n];
      delete WIDGETS[n];
      WIDGETS[n] = w;
    }
    
  • Good point thank you

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Making a Dock app and want to know what is possible.

Posted by Avatar for DrBard @DrBard

Actions