Problem viewing some data when watching the clock display

Hi all,

I am developing a Watch Face where I display the time in binary format as well as the heart rate, the day steps and the percentage of remaining battery. While I have been successful in displaying the data (everything using dc functions and calling dc.clear() at the beginning of onUpdate function), there are several things that do not work properly, so any hints of how to solve the problem are welcome. Here are the problems I found:

  • The time is not properly updated when I am seeing the hour. I transform the hour or minutes to 0s and 1s, and show it as circles, not filled for 0 and filled for 1. The thing is, when the watch is in standby, it looks like the time is correctly showed in the display, whereas (dc.clear() maybe?) does not seem to work when I am trying to see what time it is.

  • I have a flag (global variable) to show some data if the watch is awake, such as the heart rate or day steps, that apparently works properly. In this case, when the day changes it seems that this variable is set to 0 as the data is no longer shown even if I move the watch to have a look at the display. Nevertheless, if I push the down button to open the menu and later the up button to see the watch face again, then the data is shown.

My code basically has the following structure:

class BinaryScreenView extends WatchUi.WatchFace {

    var isAwake = false; //Flag used to show or not show part of the data
    
    function initialize() {
        WatchFace.initialize();
    }

        function onShow() as Void {
            isAwake = true;
        }


    // Load your resources here
    function onLayout(dc as Dc) as Void {
        setLayout(Rez.Layouts.WatchFace(dc));
    }

    function onUpdate(dc as Dc) as Void {

        //variables

        dc.clear();

        dc.setColor(...);

        dc.drawText(...), dc.drawCircle(...), dc.fillCircle(...) and other functions to show the date and time

                 if(isAwake)

                 {

            //get heart rate, steps and battery status, showing it on the screen

                 }

   }

    function onExitSleep() as Void {
        isAwake = true;
    }

    function onEnterSleep() as Void {
        isAwake = false;
        WatchUi.requestUpdate();
    }

         function onHide() as Void {
         }

}

Thanks,

Javier