1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-01 11:01:00 +00:00
trezor-firmware/src/apps/homescreen/layout_homescreen.py

25 lines
635 B
Python
Raw Normal View History

from trezor import ui, loop, res
from trezor.utils import unimport
2016-04-30 13:57:08 +00:00
2016-04-28 21:43:34 +00:00
async def swipe_to_rotate():
from trezor.ui.swipe import Swipe
2016-05-17 16:37:26 +00:00
while True:
degrees = await Swipe(absolute=True)
2016-05-17 16:37:26 +00:00
ui.display.orientation(degrees)
async def animate_logo():
image = res.load('apps/homescreen/res/experiment7.toif')
def render(fg):
ui.display.image(0, 0, image)
ui.display.text(52, 220, 'Swipe to rotate', ui.NORMAL, fg, ui.BLACK)
await ui.animate_pulse(render, ui.GREY, ui.DARK_GREY, speed=400000)
@unimport
async def layout_homescreen():
await loop.Wait([swipe_to_rotate(), animate_logo()])