Beispiel #1
0
    def on_render(self) -> None:
        PULSE_PERIOD = const(1200000)

        super().on_render()

        if not self.pageable.is_first():
            t = ui.pulse(PULSE_PERIOD)
            c = ui.blend(ui.GREY, ui.DARK_GREY, t)
            icon = res.load(ui.ICON_SWIPE_RIGHT)
            ui.display.icon(18, 68, icon, c, ui.BG)

        if not self.pageable.is_last():
            t = ui.pulse(PULSE_PERIOD, PULSE_PERIOD // 2)
            c = ui.blend(ui.GREY, ui.DARK_GREY, t)
            icon = res.load(ui.ICON_SWIPE_LEFT)
            ui.display.icon(205, 68, icon, c, ui.BG)
Beispiel #2
0
def render_swipe_icon() -> None:
    PULSE_PERIOD = const(1200000)

    icon = res.load(ui.ICON_SWIPE)
    t = ui.pulse(PULSE_PERIOD)
    c = ui.blend(ui.GREY, ui.DARK_GREY, t)
    ui.display.icon(70, 205, icon, c, ui.BG)
def render_swipe_icon() -> None:
    DRAW_DELAY = const(200000)

    icon = res.load(ui.ICON_SWIPE)
    t = ui.pulse(DRAW_DELAY)
    c = ui.blend(ui.GREY, ui.DARK_GREY, t)
    ui.display.icon(70, 205, icon, c, ui.BG)
Beispiel #4
0
async def animate_swipe():
    time_delay = const(40000)
    draw_delay = const(200000)

    sleep = loop.sleep(time_delay)
    for t in ui.pulse(draw_delay):
        fg = ui.blend(ui.GREY, ui.DARK_GREY, t)
        ui.display.icon(110, 210, res.load(ui.ICON_SWIPE), fg, ui.BG)
        await sleep
Beispiel #5
0
def render_swipe_icon() -> None:
    if utils.DISABLE_ANIMATION:
        c = ui.GREY
    else:
        PULSE_PERIOD = const(1200000)
        t = ui.pulse(PULSE_PERIOD)
        c = ui.blend(ui.GREY, ui.DARK_GREY, t)

    icon = res.load(ui.ICON_SWIPE)
    ui.display.icon(70, 205, icon, c, ui.BG)
Beispiel #6
0
async def animate_swipe():
    time_delay = const(40000)
    draw_delay = const(200000)

    ui.display.text_center(130, 220, 'Swipe', ui.BOLD, ui.GREY, ui.BG)

    sleep = loop.sleep(time_delay)
    icon = res.load(ui.ICON_SWIPE)
    for t in ui.pulse(draw_delay):
        fg = ui.blend(ui.GREY, ui.DARK_GREY, t)
        ui.display.icon(70, 205, icon, fg, ui.BG)
        yield sleep
Beispiel #7
0
    def render(self):

        header = '*' * len(self.pin) if self.pin else self.label

        # clear canvas under input line
        display.bar(0, 0, 205, 48, ui.BG)

        # input line with a header
        display.text_center(120, 30, header, ui.NORMAL,
                            ui.blend(ui.BG, ui.FG, 0.5), ui.BG)

        # pin matrix buttons
        for btn in self.pin_buttons:
            btn.render()