summaryrefslogtreecommitdiff
path: root/wasp/apps
AgeCommit message (Collapse)Author
2021-01-03apps: software: Add an apps to enable/disable other appsDaniel Thompson
Currently wasp-os enables a narrow set of applications because we don't want to consume RAM by importing the module and constructing the application. We can improve on this situation by providing a small (stateless) application that can be used to enable or diable applications. This allows all the ROMed applications to be enabled using the GUI without compromising on the ability to develop applications. In fact this application significantlly reduces the RAM consumed in the default case becasue the Self Test app does not need to maintain its state. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03apps: settings: Use theme colours for text labelsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03apps: launcher: Use theme colours for text labelsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03apps: heart: Use theme colours for text labelsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31apps: calc: Use the UI colours to generate a backgroundDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31manager: Recategorize the theme labels for appsDaniel Thompson
By default bright and mid are white/grey tones, the ui widgets are blue and the spot colours are different variants of orange. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-30apps: steps: Fix typo in docstringsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-30widgets: ConfirmationView: Fix hit box problemsDaniel Thompson
The ConfirmationView became broken when we converted it's images over to 2-bit RLE. That happened because the confirmation view relied on the the 1-bit RLE to dynamically generate hit boxes. Currently the code pre-calculates the hit box which is a waste of RAM. Let's rip out the existing hit box logic and replace it with much larger ("fat finger") hit targets. We make the touch() method more closely adopt the idioms of other UI components (e.g. don't return the dialog status... just whether or not we handled the touch). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: alarm: add a full colour iconDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: alarm: Adopt the spinner widgetDaniel Thompson
Replace the open coded spinner widget with the newly introduced system one. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: alarm: avoid setting a "silly" alarm during app initDaniel Thompson
The alarm is off by default so there's no reason to set an alarm that is disabled. Let's stop doing that. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: Spinner: Add a simple spinner widgetDaniel Thompson
We are able to add this to the self tests without having to create a special page. Instead we can modify the existing notifications test to utilize the spinner. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: alarm: Adopt the checkbox widgetDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29widgets: Checkbox: Add a simple checkbox widgetDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Remember the results between invocationsDaniel Thompson
Currently if you spend more then 15 seconds looking up figures or transcribing the answer then the system will switch back to the clock and the answer will be lost. Fix this by remembering the output between invocations. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Rewrite the display and calculation engineDaniel Thompson
Currently calculations such as 22/7 do not work correctly on the simulator (which uses double precision floating point). Fix this by explicitly truncating the strings when needed. Additionally the current calculate() method has some problems when the calculation cannot be evaluated since it will needlessly clear out the calculation. Push calculate (and the exception handling) into the caller and report errors using the vibration motor instead. Finally we rename display_output() to the more idiomatic _update(). Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Optimize the fields lookup structureDaniel Thompson
Currently the fields is a list of lists of strings. This will needlessly consume RAM so lets switch it over to a simple string (which is immutable and can be stored in flash). We also replace indices with simple x and y variables. In addition to avoiding a (temporary) memory allocation this is also easier to use when looking up in fields. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Draw a closed gridDaniel Thompson
Currently the calculator uses an open grid. It's a matter of taste but I prefer a closed grid. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29apps: calc: Correct after draw565 bug fixDaniel Thompson
Currently the coordindates used for line drawing are "tuned" for a bug in the line drawing code (and now draw off the edge of the screen). Fix this. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Adopt the system theme for accent colorsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Move the copyright header to the top of the file.Daniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28apps: calc: Created memory-saving calculator appJohannes Wache
Signed-off-by: Johannes Wache <jbwa@posteo.de>
2020-12-28icons, fonts.digits: Switch over to 2-bit RLE encodingDaniel Thompson
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>
2020-12-28apps: snake: Update artworkDaniel Thompson
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-27apps: snake: Fix screenshotsDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27apps: chrono: Minor visual improvementsDaniel Thompson
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-27apps: snake: fix a couple of errorsJohannes Wache
Signed-off-by: Johannes Wache <jbwa@posteo.de>
2020-12-27apps: chrono: Implement a simple analogue watch faceDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-27draw565: Add width to the line drawing functionDaniel Thompson
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-13apps: clock: Fix theme handlingDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13Added basic theming engine.kozova1
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-13apps: testapp: Automatically report free memoryDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12apps: testapp: Make the line benchmark use 360 degreesDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12draw565: Added line drawing functionKozova1
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-12apps: snake: Remove redundant importDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-05apps: settings: Add Scroll Indicatorkozova1
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-11-29Notify level in settings appCarlosgg
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-29apps: snake: Add a snake game applicationJohannes Wache
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-29apps: alarm: Fix touch handling when the alarm is ringingDaniel Thompson
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-29apps: alarm: Adopt 2-bit RLE for the iconDaniel Thompson
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-29apps: alarm: Add Alarm application based on the new alarm systemSiroj42
Signed-off-by: Joris Warmbier <siroj42@t-online.de>
2020-11-29apps: pager: notifications: improve swipe handlingDaniel Thompson
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-29apps: pager: notifications: dismiss confirmation view on app exitDaniel Thompson
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-29apps: pager: notifications: fix handling of touch messagesDaniel Thompson
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-29apps: pager: notifications: Fix typo in clear notification messageDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-29apps: pager: notifications: Added remove all notifications dialogAidan Houlihan
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-26apps: settings: Avoid circular dependancies during app initDaniel Thompson
wasp.system cannot be safely be used from app __init__ methods. Move the initial value settings to the foreground method instead. Fixes: b1326e16092b ("apps: settings: Fix initial slider value") Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-26apps: settings: Fix initial slider valuekozova1
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-22apps: music: Add to application indexDaniel Thompson
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-14apps: testapp: Add an alarm testDaniel Thompson
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>