From 0e8d7a5d6c57f54be2e503b2c0f60d2535d2f001 Mon Sep 17 00:00:00 2001 From: chren Date: Tue, 7 Jun 2016 18:24:03 +0200 Subject: [PATCH] add static seed layout --- src/apps/seed/__init__.py | 17 +++++++++++++++++ src/apps/seed/layout_seed.py | 25 +++++++++++++++++++++++++ src/apps/seed/res/small-arrow.png | Bin 0 -> 1270 bytes src/apps/seed/res/small-arrow.toig | Bin 0 -> 195 bytes src/main.py | 2 ++ 5 files changed, 44 insertions(+) create mode 100644 src/apps/seed/__init__.py create mode 100644 src/apps/seed/layout_seed.py create mode 100644 src/apps/seed/res/small-arrow.png create mode 100644 src/apps/seed/res/small-arrow.toig diff --git a/src/apps/seed/__init__.py b/src/apps/seed/__init__.py new file mode 100644 index 00000000..6d4fadc1 --- /dev/null +++ b/src/apps/seed/__init__.py @@ -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) diff --git a/src/apps/seed/layout_seed.py b/src/apps/seed/layout_seed.py new file mode 100644 index 00000000..7ebdb297 --- /dev/null +++ b/src/apps/seed/layout_seed.py @@ -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()]) diff --git a/src/apps/seed/res/small-arrow.png b/src/apps/seed/res/small-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..26a80b8724e93bb3be185e8c1a843ae204a4772e GIT binary patch literal 1270 zcmVX00000175+#00009a7bBm001r{ z001r{0eGc9b^rha7->U8P*7-ZbZ>KLZ*U+lnSp_Ufq@}0xwybFAi#%#fq@|}KQEO56)-X|e7nZL z$iTqBa9P*U#mSX{G{Bl%P*lRez;J+pfx##xwK$o9f#C}S14DXwNkIt%17i#W1A|CX zc0maP17iUL1A|C*NRTrF17iyV0~1e4YDEbH0|SF|enDkXW_m`6f}y3QrGjHhep0GJ zaAk2xYHqQDXI^rCQ9*uDVo7QW0|Nup4h9AW240u^5(W3f%sd4n162kpgNVo|1qcff zJ_s=cNG>fZg9jx8g8+j9g8_pBLjXe}Lp{R+hNBE`7{wV~7)u#fFy3PlV+vxLz;uCG zm^qSpA@ds+OO_6nTdaDlt*rOhEZL^9ePa)2-_4=K(Z%tFGm-NGmm}8}ZcXk5JW@PU zd4+f<@d@)yL(o<5icqT158+-B6_LH7;i6x}CW#w~Uy-Pgl#@Irl`kzV zeL|*8R$ca%T%Wv){2zs_iiJvgN^h0dsuZZ2sQy$tsNSU!s;Q*;LF<6_B%M@UD?LHI zSNcZ`78uqV#TeU~$eS{ozBIdFzSClfs*^S+dw;4dus<{M;#|MXC)T}S9v!D zcV!QCPhBq)ZyO(X-(bH4|NMaZz==UigLj2o41F2S6d@OB6%`R(5i>J(Puzn9wnW{e zu;hl6HK{k#IWjCVGqdJqU(99Cv(K+6*i`tgSi2;vbXD1#3jNBGs$DgVwO(~o>mN4i zHPtkqZIx>)Y(Ls5-Br|mx>vQYvH$Kwn@O`L|D75??eGkZnfg$5<;Xeg_o%+-I&+-3%01W^SH2RkDT>t<8AY({UO#lFTB>(_`g8%^e z{{R4h=>PzAFaQARU;qF*m;eA5Z<1fdMgRZ-SV=@dRCwBa(#bAFK>&r}L$KlAOD!5r z8=8n!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