muyids / SwissRailwayClock

An analog watchface for Garmin watches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image image

Swiss Railway Clock - An analog watchface for Garmin smartwatches

  • This analog watchface is an implementation of the iconic Swiss railway clock design for Garmin smartwatches, with a second hand in both high- and low-power mode;
  • The operation differs from the original Swiss railway clock in that the second hand updates only every second and it does not pause at 12 o'clock. There is also an option to make the second hand disappear in low-power mode, after about 30s;
  • On-device settings allow the configuration of battery level indicator (a classic battery shaped one or a modern one), date display, dark mode, 3D effects and some other options (see the picture with all the "configurable clutter" above). The menu implements three different types of menu items as well as a basic time picker;
  • Symbols for active alarms, phone connection and notifications, as well as the heart rate and recovery time indicators use icons from a custom font;
  • A global settings class synchronises the selected options to persistent storage and makes them available across the app;
  • The program compiles with only a single warning with the compiler type checking level set to "Strict";
  • Newer watches with support for layers and sufficient memory or a graphics pool (since Connect IQ 4.0) use layers. Older devices without layer support or insufficient memory use a buffered bitmap. The distinction is made using Jungle file build instructions. minApiLevel is set to 3.2.0 as that's the minimum level required for on-device settings. Devices with AMOLED displays are not supported.
  • Memory usage on older devices is now really close to the limit. I highly recommend using the Prettier Monkey C extension for Visual Studio Code to optimize the generated program as much as possible. (From my experience, memory usage of the optimized program is reduced by 2-4%.)

This program reflects the progress of my ongoing journey to learn Monkey C and the Garmin Connect IQ ecosystem to create an analog watchface. I am making it available in the hope that others will find it useful to grasp the necessary concepts more quickly than I did, and to perhaps get some feedback on what could be done better and how.

Credits

The Swiss railway clock design was created by Hans Hilfiker, who was employed by the Swiss Federal Railways (SBB) at that time, in the 1940s and 1950s. It continues to be used at every railway station in Switzerland until today.

I've used several samples that come with the Garmin SDK, in particular: Analog, Menu2Sample and Picker, looked at the code of some other watchface apps that are available on Github, and read lots of very helpful posts in the Garmin Developer forum.

Alarm, Bluetooth, Heart and SMS icons created by Google - Flaticon. License CC 3.0 BY.

Footsteps icon by Freepik, Flaticon license.

Recovery time icon by Urs Huggel.

License

Copyright (C) Andreas Huggel ahuggel@gmx.net

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

An analog watchface for Garmin watches

License:MIT License


Languages

Language:Monkey C 100.0%