Simple Example WF that shows a bunch of things

I put together an example watch faces that demonstrates a whole bunch of things, all in one place.

Here's how it looks in the sim for the Venu3

Starting at the top, the date is shown using drawRadialText() if scaleable fonts are available on the watch.  If not. it uses a standard font with drawText()

The next line is the result of a simple background service.  It just returns a string with the time the background ran

Then the time.  On devices with onPartialUpdate() (MIP devices) seconds update all the time.  On AMOLED devices, when in low power mode, the time moves around to prevent burnin.  On a real device, the screen blanks on AMOLED screens if AOD is off

The Heartrate is displayed in one of two ways.  On devices with complications, it subscribes to COMPLICATION_TYPE_HEART_RATE, and if the device also has touch, pressing on it opens the heart rate glance. On devices that don't have complications, it gets the HR from Activity.Info

The last line changes based on if the device is in wheelchair mode (Venu3 and Vivoactive5 right now). "P:" indicates wheelchair mode and shows pushes. otherwise "S:" for steps.

It has app-settings for a few colors, and on-device settings for a leading 0 for hours.

Here's a zip of the project:

ComplexWF.zip

Top Replies

  • Monkey.jungle turns type checking off, so not a problem. 

    Well it would, if that line wasn't commented out.

    Of course, even the monkey c extension gives you a warning that turning off…

All Replies

  • Hey!  Thanks for doing this...however, it crashes.  ComplexWFView.mc, line 179

    179,12: Undefined symbol ':pushes' detected.

  • Which device?  Pushes means it has something to do with wheelchair mode. Is that on or off?

    The latest SDK and device files?

  • It initially gave me issues with some of the watches you made it for, so I deleted everything but the Venu 2 series.  it does not run deep enough for me to select a device nor to start up the simulator for me to do any settings changes.

    I just verified all my stuff was up to date.

    If you download it and run it, does it work for you?

  • I did not say it enough before...

    Thank you for this example.  I am able to see and learn a lot from it.

  • So...apparently NOT the current SDK.  I do now... Oops.

  • Thanks! How does getVectorFont reference work? e.g. here you reference faces "RobotoCondensedRegular" and "RobotoRegular" but they are not included in the Resources folder.

  • They are standard fonts, not custom fonts.  Not all devices have scalable fonts, but for example, you see this in the simulator.json file for the fr965:

                        "filename": "Roboto-Regular",
                        "name": "RobotoRegular",
                        "type": "system_ttf"
                    },
                    {
                        "filename": "Roboto-Italic",
                        "name": "RobotoItalic",
                        "type": "system_ttf"
                    },
                    {
                        "filename": "RobotoCondensed-Bold",
                        "name": "RobotoCondensedBold",
                        "type": "system_ttf"
                    },
                    {
                        "filename": "RobotoCondensed-Regular",
                        "name": "RobotoCondensedRegular",
                        "type": "system_ttf"
                    }

  • Thank you very much. I have learned a lot about "in device settings" and the corresponding dialog.

  • Thank you so much for posting this code. Unfortunately it does not compile... with following errors:

    ComplexWFApp.mc:35: Cannot override '$.Toybox.Application.AppBase.getInitialView' with a different return type.

    ComplexWFApp.mc:47,8: Object of type '$.Toybox.Lang.Array<$.Toybox.WatchUi.BehaviorDelegate or $.Toybox.WatchUi.ConfirmationDelegate or $.Toybox.WatchUi.InputDelegate or $.Toybox.WatchUi.Menu2InputDelegate or $.Toybox.WatchUi.MenuInputDelegate or $.Toybox.WatchUi.NumberPickerDelegate or $.Toybox.WatchUi.PickerDelegate or $.Toybox.WatchUi.TextPickerDelegate or $.Toybox.WatchUi.ViewLoopDelegate or $.Toybox.WatchUi.WatchFaceDelegate or $.Toybox.WatchUi.Confirmation or $.Toybox.WatchUi.Menu or $.Toybox.WatchUi.NumberPicker or $.Toybox.WatchUi.ProgressBar or $.Toybox.WatchUi.TextPicker or $.Toybox.WatchUi.View or $.Toybox.WatchUi.ViewLoop>' does not match return type 'PolyType<Null or $.Toybox.Lang.Array[$.Toybox.WatchUi.Views] or $.Toybox.Lang.Array[$.Toybox.WatchUi.Views, $.Toybox.WatchUi.InputDelegates]>'.

    I have tried with the following watches:

    Fenix5Pro, Venu2, Venu3.

    It looks like the AppBase class comes from the watch... I'm not sure where or how so not sure where to find the definition of this class.

    Any suggestions?