1
1
Fork 0

fixed excessive app_logs in animations

squarelines 4.4
Alina Marquardt 2016-01-11 22:18:39 +01:00
parent fcedbb11f6
commit 1b51ee1af4
2 changed files with 27 additions and 13 deletions

View File

@ -30,7 +30,7 @@
"chalk"
],
"uuid": "793bab03-9464-48a2-b63f-3f779c473db8",
"versionLabel": "4.3",
"versionLabel": "4.4",
"watchapp": {
"watchface": true
}

View File

@ -386,17 +386,23 @@ static unsigned short get_display_hour(unsigned short hour) {
}
static void setupAnimation() {
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up anim");
}
anim = animation_create();
animation_set_delay(anim, 0);
animation_set_duration(anim, DIGIT_CHANGE_ANIM_DURATION);
animation_set_implementation(anim, &animImpl);
animation_set_curve(anim, AnimationCurveEaseInOut);
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Done setting up anim %i", (int)anim);
}
}
static void destroyAnimation() {
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Destroying anim %i", (int)anim);
}
animation_destroy(anim);
anim = NULL;
}
@ -410,10 +416,10 @@ void handle_tick(struct tm *t, TimeUnits units_changed) {
animation_destroy(anim);
}
if (debug) {
ho = get_display_hour(t->tm_hour);
mi = t->tm_min;
da = 10;
mo = 1;
ho = 5;
mi = 15;
da = 12;
mo = 3;
} else {
ho = get_display_hour(t->tm_hour);
mi = t->tm_min;
@ -508,7 +514,7 @@ void initSlot(int i, Layer *parent) {
s->slotIndex = i;
s->normTime = ANIMATION_NORMALIZED_MAX;
s->prevDigit = 0;
s->prevDigit = startDigit[i];
s->curDigit = startDigit[i];
if ((i<4 || i>=8) && i<14) {
s->divider = 1;
@ -527,7 +533,9 @@ static void deinitSlot(int i) {
}
static void animateDigits(struct Animation *anim, const AnimationProgress normTime) {
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Tick! %i", (int)anim);
}
int i;
for (i=0; i<NUMSLOTS; i++) {
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));
vibes_short_pulse();
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Tearing down");
}
teardownUI();
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Setting up");
}
setupUI();
if (debug) {
APP_LOG(APP_LOG_LEVEL_INFO, "Done");
}
}
static void in_dropped_handler(AppMessageResult reason, void *context) {