acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_tileview_1.py (948B)

      1 #
      2 # Create a 2x2 tile view and allow scrolling only in an "L" shape.
      3 # Demonstrate scroll chaining with a long list that
      4 # scrolls the tile view when it can't be scrolled further.
      5 #
      6 tv = lv.tileview(lv.scr_act())
      7 
      8 # Tile1: just a label
      9 tile1 = tv.add_tile(0, 0, lv.DIR.BOTTOM)
     10 label = lv.label(tile1)
     11 label.set_text("Scroll down")
     12 label.center()
     13 
     14 # Tile2: a button
     15 tile2 = tv.add_tile(0, 1, lv.DIR.TOP | lv.DIR.RIGHT)
     16 
     17 btn = lv.btn(tile2)
     18 
     19 label = lv.label(btn)
     20 label.set_text("Scroll up or right")
     21 
     22 btn.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT)
     23 btn.center()
     24 
     25 # Tile3: a list
     26 tile3 = tv.add_tile(1, 1, lv.DIR.LEFT)
     27 list = lv.list(tile3)
     28 list.set_size(lv.pct(100), lv.pct(100))
     29 
     30 list.add_btn(None, "One")
     31 list.add_btn(None, "Two")
     32 list.add_btn(None, "Three")
     33 list.add_btn(None, "Four")
     34 list.add_btn(None, "Five")
     35 list.add_btn(None, "Six")
     36 list.add_btn(None, "Seven")
     37 list.add_btn(None, "Eight")
     38 list.add_btn(None, "Nine")
     39 list.add_btn(None, "Ten")