Add update notification/reminder for v2
This commit is contained in:
1 parent
f1ba4f45ff
commit
2115d69ce2
5 files changed
+41
-9
No files matched your search
@@ -2,6 +2,13 @@
|
|||||||
---
|
---
|
||||||
**Trigalarm** is a habit-correcting alarm for heavy sleepers that forces you to solve for theta in right triangles. It's the perfect amount of thought to activate your brain in the morning!
|
**Trigalarm** is a habit-correcting alarm for heavy sleepers that forces you to solve for theta in right triangles. It's the perfect amount of thought to activate your brain in the morning!
|
||||||
|
|
||||||
|
## MAJOR UPDATE INCOMING - BREAKING CHANGES - PLEASE READ!!
|
||||||
|
On Dec 1, 2026, Trigalarm on the Pebble store will be updated to v2.0.0. Your settings will **NOT** carry over, as this update makes major adjustments to the way Trigalarm works.
|
||||||
|
|
||||||
|
The update is already finished and the PBW is available as a release package (see the linked git repo at the bottom of the store page). You will also be reminded of this in-app when disarming your alarm for the day. You will be prompted with an option to disable this reminder, if desired.
|
||||||
|
|
||||||
|
If you decide to stick to the legacy version of the app, please sideload the v1.1.0 PBW, also available as a release on the git repo linked at the bottom of the store page.
|
||||||
|
|
||||||
## The Pitch
|
## The Pitch
|
||||||
### Simple
|
### Simple
|
||||||
The alarm setter is only one page. You can only set one alarm. There is no snooze, there is no weekly schedule, and there is no way to disable the alarm (you'll always have one set - every day - like it or not).
|
The alarm setter is only one page. You can only set one alarm. There is no snooze, there is no weekly schedule, and there is no way to disable the alarm (you'll always have one set - every day - like it or not).
|
||||||
@@ -26,8 +33,3 @@ Perhaps the most unique, Trigalarm features optional [Pavlok](https://pavlok.com
|
|||||||
- The vibration pattern is randomized. It derives the length of the three pulses from the angles in the generated triangle. Neat!
|
- The vibration pattern is randomized. It derives the length of the three pulses from the angles in the generated triangle. Neat!
|
||||||
- Some of the alarm scheduling code was taken from [Gentle Wake](https://github.com/SeaPea/GentleWake). It seems trusted by the community, so... I stole it! The beauty of open source, no AI needed!
|
- Some of the alarm scheduling code was taken from [Gentle Wake](https://github.com/SeaPea/GentleWake). It seems trusted by the community, so... I stole it! The beauty of open source, no AI needed!
|
||||||
- A custom font was made to satisfy the need for something that looks like LECO but is monospaced. The version I made contains only numbers, period, and colon, but if you want to build off of it, [it's public](https://git.wetfence.xyz/RandyTheSilly/pebble-misc/src/branch/main/fonts) and easy to modify!
|
- A custom font was made to satisfy the need for something that looks like LECO but is monospaced. The version I made contains only numbers, period, and colon, but if you want to build off of it, [it's public](https://git.wetfence.xyz/RandyTheSilly/pebble-misc/src/branch/main/fonts) and easy to modify!
|
||||||
|
|
||||||
## Future Goals (1.1 and beyond)
|
|
||||||
- Full touch navigation
|
|
||||||
- Draw measurements based on triangle side locations, rather than in fixed positions
|
|
||||||
- Custom, self-hosted Pavlok API support (going to try some Bluetooth reverse engineering)
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "trigalarm",
|
"name": "trigalarm",
|
||||||
"author": "RandyTheSilly",
|
"author": "RandyTheSilly",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"alarm",
|
"alarm",
|
||||||
"math",
|
"math",
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"@rebble/clay": "^1.0.10"
|
"@rebble/clay": "^1.0.10"
|
||||||
},
|
},
|
||||||
"pebble": {
|
"pebble": {
|
||||||
"displayName": "Trigalarm",
|
"displayName": "Trigalarm (Legacy; Read Desc)",
|
||||||
"uuid": "293cd38c-4e8c-46ae-a3dc-c789d7ce93ab",
|
"uuid": "293cd38c-4e8c-46ae-a3dc-c789d7ce93ab",
|
||||||
"sdkVersion": "3",
|
"sdkVersion": "3",
|
||||||
"enableMultiJS": true,
|
"enableMultiJS": true,
|
||||||
|
|||||||
+29
-1
@@ -96,12 +96,25 @@ static char *s_options_under[2];
|
|||||||
|
|
||||||
static void push_setter_window();
|
static void push_setter_window();
|
||||||
|
|
||||||
|
static void push_status_window(StatusWindowPurpose purpose);
|
||||||
|
|
||||||
static void click_handler_disable_tutorial(void *recognizer, void *ctx) {
|
static void click_handler_disable_tutorial(void *recognizer, void *ctx) {
|
||||||
settings.TutorialEnabled = false;
|
settings.TutorialEnabled = false;
|
||||||
persist_write_data(STORAGE_KEY_SETTINGS, &settings, sizeof(settings));
|
persist_write_data(STORAGE_KEY_SETTINGS, &settings, sizeof(settings));
|
||||||
window_stack_pop_all(true);
|
window_stack_pop_all(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void click_handler_disable_update_notification(void *recognizer, void *ctx) {
|
||||||
|
persist_write_bool(STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED, true);
|
||||||
|
window_stack_pop(true);
|
||||||
|
push_status_window(STATUS_CONFIRMATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void click_handler_skip_update_notification(void *recognizer, void *ctx) {
|
||||||
|
window_stack_pop(true);
|
||||||
|
push_status_window(STATUS_CONFIRMATION);
|
||||||
|
}
|
||||||
|
|
||||||
static void click_handler_push_setter(void *recognizer, void *ctx) {
|
static void click_handler_push_setter(void *recognizer, void *ctx) {
|
||||||
s_highlight_pos = 0;
|
s_highlight_pos = 0;
|
||||||
s_skip_current_day = true; // setting the next alarm should assume the user meant tomorrow
|
s_skip_current_day = true; // setting the next alarm should assume the user meant tomorrow
|
||||||
@@ -139,6 +152,11 @@ static void status_math_failure_click_config_provider(void *ctx) {
|
|||||||
window_single_click_subscribe(BUTTON_ID_SELECT, click_handler_retry);
|
window_single_click_subscribe(BUTTON_ID_SELECT, click_handler_retry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void status_update_notification_click_config_provider(void *ctx) {
|
||||||
|
window_single_click_subscribe(BUTTON_ID_SELECT, click_handler_skip_update_notification);
|
||||||
|
window_single_click_subscribe(BUTTON_ID_BACK, click_handler_disable_update_notification);
|
||||||
|
}
|
||||||
|
|
||||||
static void status_window_load(StatusWindowPurpose purpose) {
|
static void status_window_load(StatusWindowPurpose purpose) {
|
||||||
Layer *window_layer = window_get_root_layer(s_status_window);
|
Layer *window_layer = window_get_root_layer(s_status_window);
|
||||||
s_status_txt_layer = text_layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT));
|
s_status_txt_layer = text_layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT));
|
||||||
@@ -164,12 +182,17 @@ static void status_window_load(StatusWindowPurpose purpose) {
|
|||||||
case STATUS_MATH_FAILURE:
|
case STATUS_MATH_FAILURE:
|
||||||
text_layer_set_text(s_status_txt_layer, "Incorrect equation.\nTry again!");
|
text_layer_set_text(s_status_txt_layer, "Incorrect equation.\nTry again!");
|
||||||
window_set_click_config_provider(s_status_window, status_math_failure_click_config_provider);
|
window_set_click_config_provider(s_status_window, status_math_failure_click_config_provider);
|
||||||
|
break;
|
||||||
|
case STATUS_UPDATE_NOTIFICATION:
|
||||||
|
text_layer_set_text(s_status_txt_layer, "IMPORTANT - READ!!\nTrigalarm will be updated to v2 (w/breaking changes) on Dec 1 2026. See store description for info.\n\nPress SELECT to continue or BACK to disable this notification (and continue).");
|
||||||
|
window_set_click_config_provider(s_status_window, status_update_notification_click_config_provider);
|
||||||
}
|
}
|
||||||
text_layer_set_background_color(s_status_txt_layer, GColorClear);
|
text_layer_set_background_color(s_status_txt_layer, GColorClear);
|
||||||
layer_set_frame(text_layer_get_layer(s_status_txt_layer), GRect(0, (PBL_DISPLAY_HEIGHT / 2) - (text_layer_get_content_size(s_status_txt_layer).h / 2), PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT));
|
layer_set_frame(text_layer_get_layer(s_status_txt_layer), GRect(0, (PBL_DISPLAY_HEIGHT / 2) - (text_layer_get_content_size(s_status_txt_layer).h / 2), PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT));
|
||||||
text_layer_set_text_alignment(s_status_txt_layer, GTextAlignmentCenter);
|
text_layer_set_text_alignment(s_status_txt_layer, GTextAlignmentCenter);
|
||||||
|
|
||||||
layer_add_child(window_layer, text_layer_get_layer(s_status_txt_layer));
|
layer_add_child(window_layer, text_layer_get_layer(s_status_txt_layer));
|
||||||
|
text_layer_enable_screen_text_flow_and_paging(s_status_txt_layer, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void status_window_unload() {
|
static void status_window_unload() {
|
||||||
@@ -462,12 +485,17 @@ static void alarm_select_hold_handler(void *recognizer, void *ctx) {
|
|||||||
// set main alarm if the awareness alarm was solved within time limit
|
// set main alarm if the awareness alarm was solved within time limit
|
||||||
tick_timer_service_unsubscribe(); // alarm is fully disarmed - prevent stimulus in confirmation window
|
tick_timer_service_unsubscribe(); // alarm is fully disarmed - prevent stimulus in confirmation window
|
||||||
if (schedule_alarm(WAKE_MAIN_ALARM)) {
|
if (schedule_alarm(WAKE_MAIN_ALARM)) {
|
||||||
|
if (!persist_read_bool(STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED)) {
|
||||||
|
push_status_window(STATUS_UPDATE_NOTIFICATION);
|
||||||
|
} else {
|
||||||
push_status_window(STATUS_CONFIRMATION);
|
push_status_window(STATUS_CONFIRMATION);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// otherwise, set awareness alarm and exit
|
// otherwise, set awareness alarm and exit
|
||||||
|
WakeupReason alarm_reason = s_alarm_reason;
|
||||||
if (schedule_alarm(WAKE_AWARENESS_ALARM)) {
|
if (schedule_alarm(WAKE_AWARENESS_ALARM)) {
|
||||||
if (settings.TutorialEnabled && (s_alarm_reason == WAKE_MAIN_ALARM || s_alarm_reason == WAKE_RECOVERY_MAIN_ALARM)) {
|
if (settings.TutorialEnabled && (alarm_reason == WAKE_MAIN_ALARM || alarm_reason == WAKE_RECOVERY_MAIN_ALARM)) {
|
||||||
push_status_window(STATUS_MAIN_TUTORIAL);
|
push_status_window(STATUS_MAIN_TUTORIAL);
|
||||||
} else {
|
} else {
|
||||||
window_stack_pop_all(true);
|
window_stack_pop_all(true);
|
||||||
|
|||||||
+2
-1
@@ -5,5 +5,6 @@ typedef enum
|
|||||||
STATUS_MAIN_TUTORIAL = 0,
|
STATUS_MAIN_TUTORIAL = 0,
|
||||||
STATUS_CONFIRMATION = 1,
|
STATUS_CONFIRMATION = 1,
|
||||||
STATUS_SET_FAILURE = 2,
|
STATUS_SET_FAILURE = 2,
|
||||||
STATUS_MATH_FAILURE = 3
|
STATUS_MATH_FAILURE = 3,
|
||||||
|
STATUS_UPDATE_NOTIFICATION = 4
|
||||||
} StatusWindowPurpose;
|
} StatusWindowPurpose;
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#define STORAGE_KEY_ALARM_HOUR 0
|
#define STORAGE_KEY_ALARM_HOUR 0
|
||||||
#define STORAGE_KEY_ALARM_MINUTE 1
|
#define STORAGE_KEY_ALARM_MINUTE 1
|
||||||
#define STORAGE_KEY_PAVLOK_INTENSITY 2
|
#define STORAGE_KEY_PAVLOK_INTENSITY 2
|
||||||
|
#define STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED 3
|
||||||
|
|
||||||
typedef struct AppSettings {
|
typedef struct AppSettings {
|
||||||
bool TutorialEnabled;
|
bool TutorialEnabled;
|
||||||
|
|||||||
Reference in new issue
Block a user