Skip to content

Commit 0319a52

Browse files
ui: restore bar animations
1 parent fb7f332 commit 0319a52

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def try_capture(event, data):
132132
global current_cam_buffer, image_dsc, image, use_webcam, keepgoing
133133
if not keepgoing:
134134
print("try_capture called while keepgoing==False, aborting...")
135-
return
135+
return False # tell the task handler not to update (redraw)
136136
if use_webcam:
137137
current_cam_buffer = webcam.capture_frame(cam, "rgb565")
138138
elif cam.frame_available():
@@ -253,7 +253,7 @@ def init_cam():
253253
except Exception as e:
254254
print(f"camtest.py: webcam exception: {e}")
255255

256-
if cam:
256+
if cam and keepgoing:
257257
status_label_text = ""
258258
qr_button.remove_flag(lv.obj.FLAG.HIDDEN)
259259
snap_button.remove_flag(lv.obj.FLAG.HIDDEN)

internal_filesystem/lib/mpos/ui.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,18 @@ def open_bar():
5656
if not bar_open:
5757
print("not open so opening...")
5858
bar_open=True
59-
hide_bar_animation.current_value = hide_bar_animation_end_value # stop the hide animation
60-
show_bar_animation.current_value = hide_bar_animation_start_value
61-
#show_bar_animation.start() # coming from the camera, this doesn't work?!
62-
notification_bar.set_y(show_bar_animation_end_value) # workaround is fine
59+
hide_bar_animation.current_value = hide_bar_animation_end_value
60+
#show_bar_animation.current_value = hide_bar_animation_start_value
61+
show_bar_animation.start()
6362
else:
6463
print("bar already open")
6564

6665
def close_bar():
6766
global bar_open, show_bar_animation, hide_bar_animation
6867
if bar_open:
6968
bar_open=False
70-
show_bar_animation.current_value = show_bar_animation_end_value # stop the show animation
71-
hide_bar_animation.current_value = hide_bar_animation_start_value
69+
show_bar_animation.current_value = show_bar_animation_end_value
70+
#hide_bar_animation.current_value = hide_bar_animation_start_value
7271
hide_bar_animation.start()
7372

7473
def show_launcher():

0 commit comments

Comments
 (0)