diff --git a/internal_filesystem/apps/com.example.app1/META-INF/MANIFEST.MF b/internal_filesystem/apps/com.example.app1/META-INF/MANIFEST.MF deleted file mode 100644 index 5f249cfc..00000000 --- a/internal_filesystem/apps/com.example.app1/META-INF/MANIFEST.MF +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Name: App1 -Start-Script: assets/app1.py -Version: 0.0.1 diff --git a/internal_filesystem/apps/com.example.app1/assets/app1.py b/internal_filesystem/apps/com.example.app1/assets/app1.py deleted file mode 100644 index 02e11055..00000000 --- a/internal_filesystem/apps/com.example.app1/assets/app1.py +++ /dev/null @@ -1,50 +0,0 @@ -print("running app1") - -#subwindow = lv.screen_active() - -import time -print("Child coroutine: Creating UI") -# Label -print("Child coroutine: adding label") -label = lv.label(subwindow) -print("Child coroutine: added label") -label.set_text("App1: 0") -label.align(lv.ALIGN.TOP_MID, 0, 10) -# Button -button = lv.button(subwindow) -button.set_size(100, 60) -button.align(lv.ALIGN.CENTER, 0, 0) -button_label = lv.label(button) -button_label.set_text("Quit") -button_label.center() -# Slider -slider = lv.slider(subwindow) -slider.set_range(0, 100) -slider.set_value(50, lv.ANIM.OFF) -slider.align(lv.ALIGN.BOTTOM_MID, 0, -30) -print("quit flag") -# Quit flag -should_continue = True -# Button callback -def button_cb(e): - global should_continue - print("Quit button clicked, exiting child") - should_continue = False -button.add_event_cb(button_cb, lv.EVENT.CLICKED, None) -# Slider callback -print("slider callback") -def slider_cb(e): - value = slider.get_value() - #print("Child slider value:", value) -slider.add_event_cb(slider_cb, lv.EVENT.VALUE_CHANGED, None) -# Update loop -print("update loop") -count = 0 -while should_continue: - count += 1 - print("Child coroutine: Updating label to", count) - label.set_text(f"App1: {count}") - time.sleep_ms(500) # shorter makes it more responive to the quit button -print("Child coroutine: Exiting") - - diff --git a/internal_filesystem/apps/com.example.app2/META-INF/MANIFEST.MF b/internal_filesystem/apps/com.example.app2/META-INF/MANIFEST.MF deleted file mode 100644 index 783cae7b..00000000 --- a/internal_filesystem/apps/com.example.app2/META-INF/MANIFEST.MF +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Name: App2 -Start-Script: assets/app2.py -Version: 0.0.1 diff --git a/internal_filesystem/apps/com.example.app2/assets/app2.py b/internal_filesystem/apps/com.example.app2/assets/app2.py deleted file mode 100644 index 3193305d..00000000 --- a/internal_filesystem/apps/com.example.app2/assets/app2.py +++ /dev/null @@ -1,56 +0,0 @@ -print("app2 is running") - -import time -import _thread -print("App2 running") - -# Quit flag -should_continue = True - -def app2_thread(): - count=0 - while should_continue and appscreen == lv.screen_active(): - print(f"app2_thread: thread_id {_thread.get_ident()} - {count}") - count+=1 - time.sleep(1) - -_thread.start_new_thread(app2_thread, ()) - - -# Label -label = lv.label(subwindow) -label.set_text("App2: 0") -label.align(lv.ALIGN.TOP_MID, 0, 10) -# Button -button = lv.button(subwindow) -button.set_size(100, 60) -button.align(lv.ALIGN.CENTER, 0, 0) -button_label = lv.label(button) -button_label.set_text("Quit") -button_label.center() -# Slider -slider = lv.slider(subwindow) -slider.set_range(0, 100) -slider.set_value(50, lv.ANIM.OFF) -slider.align(lv.ALIGN.BOTTOM_MID, 0, -30) -# Button callback -def button_cb(e): - global should_continue - print("Quit button clicked, exiting child") - should_continue = False -button.add_event_cb(button_cb, lv.EVENT.CLICKED, None) -# Slider callback -def slider_cb(e): - value = slider.get_value() - #print("Child slider value:", value) -slider.add_event_cb(slider_cb, lv.EVENT.VALUE_CHANGED, None) -# Update loop -count = 0 -while should_continue: - count += 1 - #print("Child coroutine: Updating label to", count) - label.set_text(f"App2: {count}") - time.sleep_ms(1000) # shorter makes it more responive to the quit button -print("Child coroutine: Exiting") - - diff --git a/internal_filesystem/apps/com.example.helloworld/META-INF/MANIFEST.MF b/internal_filesystem/apps/com.example.helloworld/META-INF/MANIFEST.MF new file mode 100644 index 00000000..8976e5cc --- /dev/null +++ b/internal_filesystem/apps/com.example.helloworld/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Name: HelloWorld +Start-Script: assets/hello.py +Version: 0.0.1 diff --git a/internal_filesystem/apps/com.example.helloworld/assets/hello.py b/internal_filesystem/apps/com.example.helloworld/assets/hello.py new file mode 100644 index 00000000..f9179ec2 --- /dev/null +++ b/internal_filesystem/apps/com.example.helloworld/assets/hello.py @@ -0,0 +1,11 @@ +import time +myscreen = lv.screen_active() + +print("Hello World running!") + +label = lv.label(myscreen) +label.set_text("Hello World!") + +while lv.screen_active() == myscreen + time.sleep_ms(100) + diff --git a/internal_filesystem/apps/com.example.helloworld/res/mipmap-mdpi/icon_64x64.png b/internal_filesystem/apps/com.example.helloworld/res/mipmap-mdpi/icon_64x64.png new file mode 100644 index 00000000..cac4a6f2 Binary files /dev/null and b/internal_filesystem/apps/com.example.helloworld/res/mipmap-mdpi/icon_64x64.png differ