parent
fcedbb11f6
commit
1b51ee1af4
|
@ -30,7 +30,7 @@
|
||||||
"chalk"
|
"chalk"
|
||||||
],
|
],
|
||||||
"uuid": "793bab03-9464-48a2-b63f-3f779c473db8",
|
"uuid": "793bab03-9464-48a2-b63f-3f779c473db8",
|
||||||
"versionLabel": "4.3",
|
"versionLabel": "4.4",
|
||||||
"watchapp": {
|
"watchapp": {
|
||||||
"watchface": true
|
"watchface": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,17 +386,23 @@ static unsigned short get_display_hour(unsigned short hour) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setupAnimation() {
|
static void setupAnimation() {
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up anim");
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up anim");
|
||||||
|
}
|
||||||
anim = animation_create();
|
anim = animation_create();
|
||||||
animation_set_delay(anim, 0);
|
animation_set_delay(anim, 0);
|
||||||
animation_set_duration(anim, DIGIT_CHANGE_ANIM_DURATION);
|
animation_set_duration(anim, DIGIT_CHANGE_ANIM_DURATION);
|
||||||
animation_set_implementation(anim, &animImpl);
|
animation_set_implementation(anim, &animImpl);
|
||||||
animation_set_curve(anim, AnimationCurveEaseInOut);
|
animation_set_curve(anim, AnimationCurveEaseInOut);
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Done setting up anim %i", (int)anim);
|
APP_LOG(APP_LOG_LEVEL_INFO, "Done setting up anim %i", (int)anim);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void destroyAnimation() {
|
static void destroyAnimation() {
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Destroying anim %i", (int)anim);
|
APP_LOG(APP_LOG_LEVEL_INFO, "Destroying anim %i", (int)anim);
|
||||||
|
}
|
||||||
animation_destroy(anim);
|
animation_destroy(anim);
|
||||||
anim = NULL;
|
anim = NULL;
|
||||||
}
|
}
|
||||||
|
@ -410,10 +416,10 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
|
||||||
animation_destroy(anim);
|
animation_destroy(anim);
|
||||||
}
|
}
|
||||||
if (debug) {
|
if (debug) {
|
||||||
ho = get_display_hour(t->tm_hour);
|
ho = 5;
|
||||||
mi = t->tm_min;
|
mi = 15;
|
||||||
da = 10;
|
da = 12;
|
||||||
mo = 1;
|
mo = 3;
|
||||||
} else {
|
} else {
|
||||||
ho = get_display_hour(t->tm_hour);
|
ho = get_display_hour(t->tm_hour);
|
||||||
mi = t->tm_min;
|
mi = t->tm_min;
|
||||||
|
@ -508,7 +514,7 @@ void initSlot(int i, Layer *parent) {
|
||||||
|
|
||||||
s->slotIndex = i;
|
s->slotIndex = i;
|
||||||
s->normTime = ANIMATION_NORMALIZED_MAX;
|
s->normTime = ANIMATION_NORMALIZED_MAX;
|
||||||
s->prevDigit = 0;
|
s->prevDigit = startDigit[i];
|
||||||
s->curDigit = startDigit[i];
|
s->curDigit = startDigit[i];
|
||||||
if ((i<4 || i>=8) && i<14) {
|
if ((i<4 || i>=8) && i<14) {
|
||||||
s->divider = 1;
|
s->divider = 1;
|
||||||
|
@ -527,7 +533,9 @@ static void deinitSlot(int i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void animateDigits(struct Animation *anim, const AnimationProgress normTime) {
|
static void animateDigits(struct Animation *anim, const AnimationProgress normTime) {
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Tick! %i", (int)anim);
|
APP_LOG(APP_LOG_LEVEL_INFO, "Tick! %i", (int)anim);
|
||||||
|
}
|
||||||
int i;
|
int i;
|
||||||
for (i=0; i<NUMSLOTS; i++) {
|
for (i=0; i<NUMSLOTS; i++) {
|
||||||
if (slot[i].curDigit != slot[i].prevDigit) {
|
if (slot[i].curDigit != slot[i].prevDigit) {
|
||||||
|
@ -620,11 +628,17 @@ static void in_received_handler(DictionaryIterator *iter, void *context) {
|
||||||
}
|
}
|
||||||
persist_write_data(PREFERENCES_KEY, &curPrefs, sizeof(curPrefs));
|
persist_write_data(PREFERENCES_KEY, &curPrefs, sizeof(curPrefs));
|
||||||
vibes_short_pulse();
|
vibes_short_pulse();
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Tearing down");
|
APP_LOG(APP_LOG_LEVEL_INFO, "Tearing down");
|
||||||
|
}
|
||||||
teardownUI();
|
teardownUI();
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up");
|
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up");
|
||||||
|
}
|
||||||
setupUI();
|
setupUI();
|
||||||
|
if (debug) {
|
||||||
APP_LOG(APP_LOG_LEVEL_INFO, "Done");
|
APP_LOG(APP_LOG_LEVEL_INFO, "Done");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void in_dropped_handler(AppMessageResult reason, void *context) {
|
static void in_dropped_handler(AppMessageResult reason, void *context) {
|
||||||
|
|
Loading…
Reference in New Issue