Stopwatch function on a Watchface

Hello,

I recently started to dig deeper into the Garmin Universe, especially developing an own watchface. 

As far as today, I managed to have an analogue watchface with a stepcounter display and a date display. 

I also want to add a stopwatch function on my watchface, so by simply pressing a button, the stopwatch gets activated and counts the time till another button / the same button is being pressed.

The watchfaces energy consumption is not important for me now. I am only using the Simulator till now. 

Is this possible in your opinion? I searched for solutions, but couldn't find any. I would be thankful for any tips / advice. 

  • hi,

    it is not possible to use the buttons on a wathcface,

    you could do it with touchScreen devices.

    see here for compatible devices:developer.garmin.com/.../WatchFaceDelegate.html

  • I see, I am creating a watchface specifically for the Fenix 6SPro, sadly its not compatible. Thank you for your fast response!

  • Note that the method SHN suggested (onPress) would require the user to long press the screen. Even newer watches can’t handle a simple tap on a watchface, in CIQ (onPress was intended for the feature where long-pressing a complication launches the associated app).

    As a thought exercise, I can think of a couple of impractical ways to implement what you want, with varying levels of intuitiveness and usability.

    - implement on-device settings (return some sort of stopwatch controls menu from AppBase.getSettingsView).

    One problem here is that it’s 4 button presses just to get to settings from the watchface on a FR955: hold UP, press START, START, DOWN, START. Note that you can actually return any kind of view you want in the on-device settings, but you can forget about displaying the stopwatch time in there, since the last time I checked, settings views won’t be updated except when input is received from the user. So settings views can’t update themselves to show dynamic stats or a stopwatch 

    - implement a kind of “gesture”, such as the user scrolling away from the watchface and returning to it quickly.

    I actually do this with a data field, where the user can switch modes/screens by scrolling away and back. My app implements this by detecting when onShow is called twice within a few seconds (this works bc onShow is also called before that data field is hidden). Obviously this unituitive, can be easily triggered by accident, the sequence of calls to onShow/onHide may vary from device to device or firmware to firmware, hard or impossible to test in sim.

    My implementation may not work well for your use case bc onShow may be called several times while the watchface is scrolling off the screen, and onHide may not be called at all. For a watchface, you could instead try to detect how much time elapses between AppBase.onStop and AppBase.OnStart. To avoid accidental triggering, you could require the user to do the gesture twice (also within a short amount of time). Ofc even if the user is willing to put up with all of that, the gesture would only really be good for one function (say, start/stop). To reset the stopwatch you’d probably have to use on device settings. Lapping would also probably have to triggered by settings, but again that might be too slow.

    Anyway, neither of those ideas are particularly practical. It would be easier for the user to use the built in stopwatch or a CIQ stopwatch widget.