How to display MovementBar in Watchface

Hello.

If I understood correctly, then in the figure, the red arrow indicates MovementBar .

How do I display it on the watch?
Is there an example code?



  • With ActivityMonitor.getInfo().moveBarLevel you get a number between 0 and 5, and with that you know how many segments to draw. (1 is the big one for an hour, 2 through 5 are the smaller ones for each 15 minutes.) To draw it, that kind of depends how what you want it to look like. drawArc can be used if you want arcs, but may not be what you want based on where you draw it or the actual watch itself.
  • I did this:


    var info = ActivityMonitor.getInfo();

    function renderMovePercent(dc)
    {
    var movePercent = info.moveBarLevel;
    var moveEnd = 0;

    if (movePercent > 0) {
    dc.setPenWidth(7);
    dc.setColor(Gfx.COLOR_GREEN,Gfx.COLOR_TRANSPARENT);

    if (movePercent >= 1) {
    moveEnd = 15;
    dc.setColor(Gfx.COLOR_RED, Gfx.COLOR_TRANSPARENT);
    dc.drawArc(screenPercent * 50, screenPercent * 50, 120, Gfx.ARC_CLOCKWISE, 310, 290);
    }
    if (movePercent >= 2) {
    moveEnd = 45;
    dc.setColor(Gfx.COLOR_DK_RED, Gfx.COLOR_TRANSPARENT);
    dc.drawArc(screenPercent * 50, screenPercent * 50, 120, Gfx.ARC_CLOCKWISE, 321, 311);
    }
    if (movePercent >= 3) {
    dc.setColor(Gfx.COLOR_DK_RED, Gfx.COLOR_TRANSPARENT);
    dc.drawArc(screenPercent * 50, screenPercent * 50, 120, Gfx.ARC_CLOCKWISE, 332, 322);
    }
    if (movePercent >= 4) {
    moveEnd = 45;
    dc.setColor(Gfx.COLOR_DK_RED, Gfx.COLOR_TRANSPARENT);
    dc.drawArc(screenPercent * 50, screenPercent * 50, 120, Gfx.ARC_CLOCKWISE, 343, 333);
    }
    if (movePercent == 5) {
    moveEnd = 45;
    dc.setColor(Gfx.COLOR_DK_RED, Gfx.COLOR_TRANSPARENT);
    dc.drawArc(screenPercent * 50, screenPercent * 50, 120, Gfx.ARC_CLOCKWISE, 350, 344);
    }
    }

    }



    What say?