The 2-bit RLE encoding, in addition to supporting colour is also fully
ROMable meaning we can save 32 bytes of RAM per image by switching to
2-bit encoding.
Switch everything in icons and font.clock over to 2-bit encoding.
Note: this requires all the clock PNG files to be reencoded (because
they were originally in 1-bit grayscale format and this is no
longer supported by the encoder).
This reduces RAM overhead by 480 bytes and has only a negligable effect
on FLASH usage (+4 bytes).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This theming engine uses a bytestring (but supports anything indexable,
as long as the index results are a byte long),
stored as `wasp.system._theme`.
It has a default value, which should not change anything about the way this looks currently.
The theme can be set via `wasp.system.set_theme`,
but this should *ONLY* be used in `main.py`.
`wasp.system.set_theme` will return True if it was successful,
or False if the theme is of an old format.
Using an old format theme will *not* crash the watch,
but will use the default theme instead.
To theme this, one has to use tools/themer.py (use flag -h for complete explanation)
to generate a bytestring that's added in main.py (see diff).
The bytestring is then loaded into 'wasp.system._theme'.
Theme values can be looked up by apps by using `wasp.system.theme("theme-key")`.
Theme keys appear in the function body of `wasp.system.theme()`.
I've took the liberty of converting existing apps to use this method,
and it seems to work well.
A test theme is provided in `tools/test_theme.py`
Signed-off-by: kozova1 <mug66kk@gmail.com>
Providing a status bar for all apps to use allows us to reduce allocations
within the applications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The main simplification is to adopt the status bar (with the status bar
clock disabled) and to restructure the way draw and redraw are handled.
Since the clock application is one of the most popular to customize it
has also had extensive commenting added to describe how it works.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Notifier was a dumb name so make it better. Now that we have a decent
name it should be obvious how to handle the BLE connection status icon!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This requires a modified version of Gadgetbridge and currently works by
implementing the BangleJS protocol.
In Gadgetbridge ensure "Sync time" is *not* set and choose "Don't pair"
when adding the PineTime device.
After a bit of testing I have not yet come up with a fast, visually
acceptable horizontal animated effect. Instead we simply reply on
screen blanking during the redraw... meaning there is no need for an
effect hint.
This is a big change that break compatiblity with existing applications
*and* with existing installed versions of main.py.
When upgrading it is import to update main.py:
./tools/wasptool --upload wasp/main.py
Moving it from applications into the watch is useful for two reasons.
Firstly it means applications don't need to know as much about the
display color depth and secondly it makes it easier to replace the
drawing routines with wasptool.