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>
This is the API:
drawable.line(x1, y1, x2, y2, color)
The function has optimizations for the case of vertical or horizontal lines.
Signed-off-by: Kozova1 <mug66kk@gmail.com>
[daniel@redfelineninja.org.uk: Minor update to commit message]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Carlos Gil Gonzalez <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: Fixed board support for simulator and
sphinx (a.k.a. doc builder)]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Johannes Wache <jbwa@posteo.de>
[daniel@redfelineninja.org.uk: Removed some couple of unwanted merge artifacts]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the widgets react to touch when the alarm is ringing (and they
are invisible. For now we fix this by disabling the alarm on a touch
event. Maybe the app should reject touch events since they could acidentally
dismiss the alarm... but we already disable the alarm if we get a swipe
event so this doesn't make things much worse than they already are!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The long term plan is to retire and remove the 1-bit RLE code from wasp-os
so we don't want new icons using that encoding.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the swipe handling added for the confirmation view has a number
of prolems: it does not work at all for multi-screen notifications, it
interferes with the haptic feedback if we keep swiping down and an up
swipe incorrectly dismisses whole notification app.
Fix these.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the confirmation view remains active when we switch away from
the notification view. Ensure we dismiss when we background the
application.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently there are detailed hit boxes in the confirmation view widget
but any inaccurate hit is treated as No anyway by the notification app.
Additionally selecting 'No' dismisses the whole notification app rather
than just the confirmation view.
Fix the event handling so that we ignore touches outside the hit box and
only dismiss the whole notification app if we actually clear the
notifications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Aidan Houlihan <aidandhoulihan@gmail.com>
[daniel@redfelineninja.org.uk: Minor changes to .gitignore]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
wasp.system cannot be safely be used from app __init__ methods. Move
the initial value settings to the foreground method instead.
Fixes: b1326e1609 ("apps: settings: Fix initial slider value")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
When the Settings app is launched, it shows the "Mid" text (this is
correct), but the slider is at the lowest position. After moving the
slider it functions correctly, so this fix is mostly cosmetic.
Signed-off-by: kozova1 <mug66kk@gmail.com>
Additionally we rename the screenshot to conform to the naming
convention (app.NAME + 'App.png') used for simulator screenshots.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: fix regressions on simulator, disable by
default (for now) on real hardware and remove a couple of whitespace
changes to existing files]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
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>
For some users the icon is pointless because they would rather install
the clock on the quick ring but this clock is something of a novelty so
it would be quite reasonable to only launch it when in the mood for
decoding something!
Happily the icon compresses nicely too!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Johannes Wache <jbwa@posteo.de>
[daniel@redfelineninja.org.uk: Tidy up the "git soup", dropped the manifest
changes and integrated the description from the original PR into the
docstring for the app]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This app serves as an example of using the filesystem to make an
application more flexible. Both the verses and the icon will be
loaded from the filesystem rather than being burned into the
wasp-os binaries.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
On a device with NEXT support we need to make sure we reset the stopwatch
when switching away from it (if it is not running) since there may not
be any other way to reset it.
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.
The algorithm is fairly crude and the GUI is pretty simple but, if you stay
still for 10 seconds, there's a good chance of an accurate pulse
reading.
Of course if you jog on the spot for ten seconds it more likely to
calculate how many steps per minutes you are performing!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The heart rate analysis step is still a work in progress but the current
app allows us to visualize the the results of the signal conditioning.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
We also change the colour scheme slightly because the increased size of
the clock interferes visually with the main display when it is bright
white.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently there's no fancy algorithms to estimate stride length. Just
pure simple step counting directly from the hardware's "intelligence
engine".
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The logo module is currently unused but it simply sits there consuming
flash. Let's shift it to the demo app to is can consume RAM instead (but
only when we upload the demo to the watch).
wasp-os contains circular import dependancies (wasp includes apps which
include wasp) but this is normally harmless.
However using __init__.py exagerated to the problem and since the benefit
of the __init__ file is pretty anyway the let's just remove it.
We now have a couple of applications (stopwatch, Game of Life) that benefit
from sub-second precision. The micropython RTC/utime code for nrf still
needs a major overhaul but this allows us to paper over the cracks for
just a little longer.
This is getting us much closer to the final UI concept. We have a
quick ring from which we can select typical apps such as clock and
stopwatch which will (eventually) be supplemented with step counting
and heart rate monitoriing. More exotic apps (currenrtly torch, self
test, settings) are all relagated to the launcher ring.
There are still some holes here. In particular the RTC resolution on
nRF devices (such as PineTime) is currently a full second (meaning
the centiseconds will always be zero. Nevertheless that isn't the apps
fault... as we can see when we run on the simulator.
If an application crashes let's report it on the device so it can be
distinguished from a hang (if nothing else it should mean we get better
bug reports).
As we enrich the navigation options we will increasinly need to visualize
between apps where up/down will switch us between rings and there
up/down is needed to scroll through content.
Here the biggest changes are in the test application because we
refactor a number of the tests to make better use of the button.
Although applications may consume button events it does have a
default behavior which is to switch to the default application
(usually the clock).
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
This is something of an experiment but now the app roll is traversed using
horizontal swipes and applications should primarily use vertical swipes
to navigate internally. This is mostly because if "feels" better but it
also leaves the vertical scrolling hardware available for use by the
app.
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.