]> git.earman.xyz Git - sensor-watch.git/commitdiff
activity faces: improve experience in low energy mode
authorJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 20:38:01 +0000 (16:38 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Sat, 17 May 2025 20:39:04 +0000 (16:39 -0400)
watch-faces/demo/accelerometer_status_face.c
watch-faces/sensor/activity_logging_face.c

index bdb6935b4860487a06e8cd21a2874e0a1d8604f8..a358a8b3f3a435c6a468c054c33355c599e2f255 100644 (file)
@@ -91,6 +91,9 @@ bool accelerometer_status_face_loop(movement_event_t event, void *context) {
                 state->threshold = state->new_threshold;
                 state->is_setting = false;
                 break;
+            case EVENT_TIMEOUT:
+                movement_move_to_face(0);
+                break;
             default:
                 movement_default_loop_handler(event);
                 break;
@@ -101,6 +104,14 @@ bool accelerometer_status_face_loop(movement_event_t event, void *context) {
             case EVENT_TICK:
                 _accelerometer_status_face_update_display(state);
                 break;
+            case EVENT_LOW_ENERGY_UPDATE:
+                // start tick animation if necessary
+                if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(1000);
+                // update the display
+                _accelerometer_status_face_update_display(state);
+                // on classic LCD, clear seconds since they interfere with the sleep animation.
+                if (watch_get_lcd_type() == WATCH_LCD_TYPE_CLASSIC) watch_display_text(WATCH_POSITION_SECONDS, "  ");
+                break;
             case EVENT_ALARM_LONG_PRESS:
                 state->new_threshold = state->threshold;
                 state->is_setting = true;
index 3e585d8313c0cc1d39d80e7df6a76f70ed6e5433..25e9fd2fa256e4ef29070595e49035e35e21cd7b 100644 (file)
@@ -98,6 +98,12 @@ bool activity_logging_face_loop(movement_event_t event, void *context) {
                 state->active_minutes_today = 0;
             }
             break;
+        case EVENT_LOW_ENERGY_UPDATE:
+            // start tick animation if necessary
+            if (!watch_sleep_animation_is_running()) watch_start_sleep_animation(1000);
+            // update the display as usual
+            _activity_logging_face_update_display(state);
+            break;
         default:
             movement_default_loop_handler(event);
             break;