2016-04-28 21:43:34 +00:00
|
|
|
from trezor import ui
|
2016-05-17 16:37:26 +00:00
|
|
|
from trezor.ui.swipe import Swipe
|
2016-04-28 21:43:34 +00:00
|
|
|
from trezor import loop
|
2016-04-30 13:57:08 +00:00
|
|
|
|
2016-04-28 21:43:34 +00:00
|
|
|
|
2016-05-17 16:37:26 +00:00
|
|
|
def swipe_to_change_orientation():
|
|
|
|
while True:
|
|
|
|
degrees = yield from Swipe().wait()
|
|
|
|
ui.display.orientation(degrees)
|
|
|
|
|
|
|
|
|
2016-04-28 21:43:34 +00:00
|
|
|
def layout_homescreen():
|
|
|
|
print("Homescreen layout!")
|
|
|
|
|
2016-05-02 14:50:36 +00:00
|
|
|
f = open('apps/homescreen/trezor.toig', 'rb')
|
2016-04-28 21:43:34 +00:00
|
|
|
|
2016-05-02 14:06:08 +00:00
|
|
|
def func(foreground):
|
|
|
|
f.seek(0)
|
2016-05-17 16:55:11 +00:00
|
|
|
ui.display.icon(0, 0, f.read(), foreground, ui.BLACK)
|
2016-04-28 21:43:34 +00:00
|
|
|
|
2016-05-17 16:37:26 +00:00
|
|
|
orientation = swipe_to_change_orientation()
|
2016-05-17 16:55:11 +00:00
|
|
|
animation = ui.animate_pulse(func, ui.WHITE, ui.GREY, speed=400000)
|
2016-05-17 13:15:17 +00:00
|
|
|
timeout = loop.Sleep(5000 * 1000)
|
2016-04-29 23:20:57 +00:00
|
|
|
|
2016-05-17 16:37:26 +00:00
|
|
|
yield loop.Wait([
|
|
|
|
orientation,
|
|
|
|
animation,
|
|
|
|
timeout
|
|
|
|
])
|
2016-04-29 23:20:57 +00:00
|
|
|
|
2016-05-02 14:06:08 +00:00
|
|
|
from apps import playground
|
|
|
|
return playground.layout_tap_to_confirm('1BitkeyP2nDd5oa64x7AjvBbbwST54W5Zmx2', 110.126967, 'BTC')
|