mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
29 lines
720 B
Python
29 lines
720 B
Python
import time
|
|
import random
|
|
import lvgl as lv
|
|
|
|
from mpos import Activity
|
|
|
|
from confetti import Confetti
|
|
|
|
class ConfettiApp(Activity):
|
|
|
|
ASSET_PATH = "M:apps/com.micropythonos.confetti/res/drawable-mdpi/"
|
|
ICON_PATH = "M:apps/com.micropythonos.confetti/res/mipmap-mdpi/"
|
|
confetti_duration = 60 * 1000
|
|
|
|
confetti = None
|
|
|
|
def onCreate(self):
|
|
main_screen = lv.obj()
|
|
self.confetti = Confetti(main_screen, self.ICON_PATH, self.ASSET_PATH, self.confetti_duration)
|
|
print("created ", self.confetti)
|
|
self.setContentView(main_screen)
|
|
|
|
def onResume(self, screen):
|
|
print("onResume")
|
|
self.confetti.start()
|
|
|
|
def onPause(self, screen):
|
|
self.confetti.stop()
|