mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-26 16:18:22 +00:00
add static seed layout
This commit is contained in:
parent
9ca6d61bcc
commit
0e8d7a5d6c
17
src/apps/seed/__init__.py
Normal file
17
src/apps/seed/__init__.py
Normal file
@ -0,0 +1,17 @@
|
||||
from trezor.dispatcher import register
|
||||
from trezor.utils import unimport_func
|
||||
|
||||
|
||||
@unimport_func
|
||||
def dispatch_Initialize(mtype, mbuf):
|
||||
from trezor.messages.Initialize import Initialize
|
||||
|
||||
message = Initialize.loads(mbuf)
|
||||
|
||||
from .layout_seed import layout_seed
|
||||
return layout_seed(message)
|
||||
|
||||
|
||||
def boot():
|
||||
Initialize = 0
|
||||
# register(Initialize, dispatch_Initialize)
|
25
src/apps/seed/layout_seed.py
Normal file
25
src/apps/seed/layout_seed.py
Normal file
@ -0,0 +1,25 @@
|
||||
from trezor import ui, dispatcher, loop, res, wire
|
||||
from trezor.ui.swipe import Swipe
|
||||
from trezor.utils import unimport_gen
|
||||
|
||||
|
||||
def swipe_to_rotate():
|
||||
while True:
|
||||
degrees = yield from Swipe(absolute=True).wait()
|
||||
ui.display.orientation(degrees)
|
||||
|
||||
|
||||
def animate_logo():
|
||||
def func(foreground):
|
||||
ui.display.icon(105, 200, res.load('apps/seed/res/small-arrow.toig'), foreground, ui.BLACK)
|
||||
yield from ui.animate_pulse(func, ui.WHITE, ui.BLACK, speed=190000)
|
||||
|
||||
|
||||
@unimport_gen
|
||||
def layout_seed(initialize_msg=None):
|
||||
# header title
|
||||
ui.display.text(10, 30, 'Write down your seed', ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
|
||||
|
||||
yield loop.Wait([dispatcher.dispatch(),
|
||||
swipe_to_rotate(),
|
||||
animate_logo()])
|
BIN
src/apps/seed/res/small-arrow.png
Normal file
BIN
src/apps/seed/res/small-arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
src/apps/seed/res/small-arrow.toig
Normal file
BIN
src/apps/seed/res/small-arrow.toig
Normal file
Binary file not shown.
@ -6,12 +6,14 @@ from apps import playground
|
||||
from apps import homescreen
|
||||
from apps import management
|
||||
from apps import wallet
|
||||
from apps import seed
|
||||
|
||||
# Initialize all applications
|
||||
playground.boot()
|
||||
homescreen.boot()
|
||||
management.boot()
|
||||
wallet.boot()
|
||||
seed.boot()
|
||||
|
||||
# just a demo to show how to register USB ifaces
|
||||
msg.setup([(1, 0xF53C), (2, 0xF1D0)])
|
||||
|
Loading…
Reference in New Issue
Block a user