1
0
Fork 0
Commit graph

100 commits

Author SHA1 Message Date
Daniel Thompson
ff958d154f apps: snake: Update artwork
Update the icon so it more closely resembles the in-game visual style
(and also so it compresses better) and update the screenshot since the
old one is the wrong size (FullHD instead of 358x406) and doesn't render
correctly in the documentation.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28 10:08:15 +00:00
Daniel Thompson
f38e7f8936 apps: snake: Fix screenshots
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27 19:35:09 +00:00
Daniel Thompson
286a5ffe2d apps: chrono: Minor visual improvements
Make the ticks and hands larger and shorten the hands slightly to avoid
visual glitches during "undraw".

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27 18:19:07 +00:00
Johannes Wache
6d3f2126bf apps: snake: fix a couple of errors
Signed-off-by: Johannes Wache <jbwa@posteo.de>
2020-12-27 18:16:03 +00:00
Daniel Thompson
726d5c8554 apps: chrono: Implement a simple analogue watch face
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27 09:13:49 +00:00
Daniel Thompson
8c03ddbb7a draw565: Add width to the line drawing function
Currently all lines are a single pixel wide. To draw wider lines we
must draw two parallel lines with a single pixel offset and this is
a *very* inefficient approach, espeically on ST7789 where we spend
longer setting the clipping window than we do drawing each pixel.

Fix this by constructing a line using a variable sized square rather than
a single pixel. This will "overdraw" (some pixels will be drawn more than
once) but since square blocks can be efficiently transferred to the
display the overdraw is acceptable.

Note: It is a difficult decision whether to maintain the convention that
      color is the last argument or to keep compatibility with existing
      line drawing tests. This patch opts for the former and fixes up
      all uses within the existing codebase.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27 08:52:54 +00:00
Daniel Thompson
e44e605b7a apps: clock: Fix theme handling
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13 16:51:07 +00:00
kozova1
2624a6e998 Added basic theming engine.
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>
2020-12-13 16:51:07 +00:00
Daniel Thompson
784c9bb36d apps: testapp: Automatically report free memory
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13 16:07:24 +00:00
Daniel Thompson
338925b4a8 apps: testapp: Make the line benchmark use 360 degrees
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12 18:19:57 +00:00
Kozova1
c17abd1728 draw565: Added line drawing function
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>
2020-12-12 18:18:01 +00:00
Daniel Thompson
339b835782 apps: snake: Remove redundant import
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12 18:15:33 +00:00
kozova1
502efa7493 apps: settings: Add Scroll Indicator
This commit adds a ScrollIndicator widget to the settings app,
to help users realize they can scroll there.

Signed-off-by: kozova1 <mug66kk@gmail.com>
2020-12-05 20:51:27 +00:00
Carlosgg
3fb1faceab Notify level in settings app
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>
2020-11-29 20:20:03 +00:00
Johannes Wache
e450ccf9f0 apps: snake: Add a snake game application
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>
2020-11-29 20:08:59 +00:00
Daniel Thompson
39c9344b14 apps: alarm: Fix touch handling when the alarm is ringing
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>
2020-11-29 19:14:31 +00:00
Daniel Thompson
707c4e2fa7 apps: alarm: Adopt 2-bit RLE for the icon
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>
2020-11-29 19:14:31 +00:00
Siroj42
27413eb5e1 apps: alarm: Add Alarm application based on the new alarm system
Signed-off-by: Joris Warmbier <siroj42@t-online.de>
2020-11-29 19:14:31 +00:00
Daniel Thompson
057c140f0e apps: pager: notifications: improve swipe handling
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>
2020-11-29 09:12:14 +00:00
Daniel Thompson
c6d5e841a0 apps: pager: notifications: dismiss confirmation view on app exit
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>
2020-11-29 09:12:14 +00:00
Daniel Thompson
bcf616f7bc apps: pager: notifications: fix handling of touch messages
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>
2020-11-29 09:12:14 +00:00
Daniel Thompson
40ac92094e apps: pager: notifications: Fix typo in clear notification message
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-29 09:12:14 +00:00
Aidan Houlihan
393dfefc86 apps: pager: notifications: Added remove all notifications dialog
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>
2020-11-29 09:12:03 +00:00
Daniel Thompson
4c0120aa1e apps: settings: Avoid circular dependancies during app init
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>
2020-11-26 21:23:38 +00:00
kozova1
b1326e1609 apps: settings: Fix initial slider value
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>
2020-11-26 21:09:22 +00:00
Daniel Thompson
6f0238415f apps: music: Add to application index
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>
2020-11-22 09:22:50 +00:00
Daniel Thompson
e105c8bb68 apps: testapp: Add an alarm test
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-14 20:36:41 +00:00
Daniel Thompson
dd5a1e75af apps: steps: Use the alarm system to reset the step counter at midnight
This is way better than zeroing it the first time in the day we use the
step counter!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-14 12:25:32 +00:00
Daniel Thompson
5796a0c113 apps: music: Fix double track name bug
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-12 21:47:38 +00:00
Carlosgg
306a1ec0a4 apps: Add music player app with GadgetBridge support
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>
2020-11-12 21:44:22 +00:00
Daniel Thompson
06f1ed36b0 docs: Add an Application Library chapter
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-08 14:28:38 +00:00
Daniel Thompson
8e89e38175 manager: Introduce shared "system bar"
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>
2020-11-04 19:00:37 +00:00
Daniel Thompson
f95f45cda3 apps: fibonacci clock: Updates to structure like clock app
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-25 08:55:58 +00:00
Daniel Thompson
1b99764e8d apps: clock: Simplify and increase commenting
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>
2020-10-25 08:55:20 +00:00
Daniel Thompson
37f8a47220 apps: steps: Switch over the status bar widget
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:29:15 +01:00
Daniel Thompson
fd4017c729 apps: stopwatch: Switch over the status bar widget
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:28:49 +01:00
Daniel Thompson
fc502cdcaa widgets: Rename StatusBar to NotificaitonBar
This is not (yet) a useful change but we'll be creating a new StatusBar
soon.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-20 18:56:08 +01:00
Daniel Thompson
52de478682 apps: fibonacci_clock: Nudge the clock down a few pixels
The better manages the space between the battery meter and the clock.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 21:42:51 +01:00
Daniel Thompson
a5f69ffe26 apps: fibonacci_clock: Enable status bar for notifications
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 21:42:51 +01:00
Daniel Thompson
aef95e6d80 apps: fibonacci_clock: Add an simple icon
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>
2020-10-10 14:06:44 +01:00
Johannes Wache
4942e3e935 apps: fibonacci_clock: Add a Fibonacci clock application
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>
2020-10-10 13:12:39 +01:00
Daniel Thompson
11640d8362 apps: haiku: Add a simple Haiku viewer
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>
2020-10-10 12:12:59 +01:00
Daniel Thompson
942e9f0bb4 apps: pager: Avoid crashes for notifications with no body
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 11:28:25 +01:00
Daniel Thompson
9877ea99bd README: Add a (fairly) comprehensive screenshot tour
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-16 18:48:15 +01:00
Daniel Thompson
cd97893d2c apps: stopwatch: Add NEXT support
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>
2020-08-15 20:43:22 +01:00
Daniel Thompson
326e06bc6b StatusBar: Rename and add BLE connection status icon
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>
2020-07-24 17:04:46 +01:00
Daniel Thompson
a01fb7df57 Introduction basic notification support
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.
2020-07-19 20:50:33 +01:00
Daniel Thompson
11be7ca328 apps: stopwatch: Improve splits... and colour scheme
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-27 14:34:36 +01:00
Daniel Thompson
95e129e331 ppg: Pull the PPG signal processing into a seperate library
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-25 21:59:32 +01:00
Daniel Thompson
e6811bb693 apps: heart: Initial heart rate detection
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>
2020-06-24 21:20:47 +01:00