You are reading a single comment by @rigrig and its replies. Click here to read the full conversation.
  • This would be very nice, fiddling with UI positions is definitely one of my least favorite activities.

    I think we also want align:, and a way to specify which part of the screen to use. a) so you can use it with or without widgets, and b) to test if a layout fits on a smaller screen.
    (But default to just using the whole screen, or even check if Bangle.loadwidgets() has been called?)

    It would also be nice if you could make one part get all "remaining" space, so you could do something like this:

    var layout = ["vertical",
      {type:"text", font:"6x8", txt:"Temperature"},   // centered? at top of screen
      ["horizontal",               // right below "Temperature"
        {type:"text", font:"30%", txt:"20.0"},    // against left screen edge
        {type:"text", font:"6x8", txt:"'C"}       // against right screen edge
      ],
      {type:"custom", size:"fill", render:drawThermometer},//draw in middle of screen
      {type:"button", txt:"more...", touch:myTouchHandler},   // centered? at bottom
    ];
    function drawThermometer(x,y,w,h) {
      // x,y,w,h: available space after other parts are placed
    }
    

    Some more questions:

    • What happens if you re-render just one "6x8" text, but it now has a different length?
    • How to handle buttons on a Bangle.js 1.0?
About

Avatar for rigrig @rigrig started