-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding b app: showing an alternative of you
- Loading branch information
1 parent
6d47cc2
commit ed223c5
Showing
4 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import displayio | ||
|
||
import zeos | ||
from message import Message | ||
from ui import MessageKey as UIKeys | ||
|
||
|
||
class ZeAlterEgoApp: | ||
def __init__(self, os: zeos.ZeBadgeOs): | ||
self.os = os | ||
self.subscription_ids = [] | ||
|
||
def run(self): | ||
self.subscription_ids += [ | ||
self.os.subscribe( | ||
zeos.MessageKey.BUTTON_CHANGED, | ||
lambda os, message: self._show() | ||
), | ||
] | ||
|
||
self._show() | ||
|
||
def unrun(self): | ||
for subscription in self.subscription_ids: | ||
self.os.unsubscribe(subscription) | ||
|
||
def _show(self): | ||
odb = displayio.OnDiskBitmap("zeAlternative.bmp") | ||
self.os.messages.append( | ||
Message( | ||
UIKeys.SHOW_BITMAP, | ||
(odb, odb.pixel_shader) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters