Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change alarm to use long press to set #462

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions movement/watch_faces/complication/alarm_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,27 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void
_alarm_resume_setting(settings, state, event.subsecond);
}
break;
case EVENT_LIGHT_LONG_PRESS:
if (state->is_setting) {
_alarm_resume_setting(settings, state, event.subsecond);
} else {
case EVENT_ALARM_LONG_PRESS:
if (!state->is_setting) {
_alarm_initiate_setting(settings, state, event.subsecond);
} else {
// handle the long press settings behaviour
switch (state->setting_state) {
case alarm_setting_idx_alarm:
// alarm selection
state->alarm_idx = 0;
break;
case alarm_setting_idx_minute:
case alarm_setting_idx_hour:
// initiate fast cycling for hour or minute settings
movement_request_tick_frequency(8);
state->alarm_quick_ticks = true;
break;
default:
break;
}
}
_alarm_face_draw(settings, state, event.subsecond);
break;
case EVENT_ALARM_BUTTON_UP:
if (!state->is_setting) {
Expand Down Expand Up @@ -356,28 +371,14 @@ bool alarm_face_loop(movement_event_t event, movement_settings_t *settings, void
}
_alarm_face_draw(settings, state, event.subsecond);
break;
case EVENT_ALARM_LONG_PRESS:
case EVENT_LIGHT_LONG_PRESS:
if (!state->is_setting) {
// toggle the enabled flag for current alarm
state->alarm[state->alarm_idx].enabled ^= 1;
// start wait ticks counter
_wait_ticks = 0;
} else {
// handle the long press settings behaviour
switch (state->setting_state) {
case alarm_setting_idx_alarm:
// alarm selection
state->alarm_idx = 0;
break;
case alarm_setting_idx_minute:
case alarm_setting_idx_hour:
// initiate fast cycling for hour or minute settings
movement_request_tick_frequency(8);
state->alarm_quick_ticks = true;
break;
default:
break;
}
_alarm_resume_setting(settings, state, event.subsecond);
}
_alarm_face_draw(settings, state, event.subsecond);
break;
Expand Down