Hello dev world. I have a watch face running a couple of animations. I use the function to delay the animation time. The trouble is I want this animation to happen every time the watch face comes on. I get the feeling currently that the animation is always running no matter what ( if i have it on infinite) which in turn i would assume would have an affect on the battery.
I have tried different things in terms of enable etc but none of these seem to activate when the screen comes on and runs everything else.
Now, it works when i use the click as the begin point but so is there something simple I am missing or do i just have run with it and play around with the animation setting to limit the drain on the battery.
Thanks in advance.
Answered! Go to the Best Answer.
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
import { display } from "display";
display.addEventListener("change", function() {
if (display.on) {
wake();
} else {
sleep();
}
})
function wake() {
// do something when the screen wakes
// https://dev.fitbit.com/build/guides/user-interface/animations/#javascript-animations
myinstance.animate("enable"); // Specify the name of the event to trigger
}
function sleep() {
// do something when the screen sleeps
}
Best Answer
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
import { display } from "display";
display.addEventListener("change", function() {
if (display.on) {
wake();
} else {
sleep();
}
})
function wake() {
// do something when the screen wakes
// https://dev.fitbit.com/build/guides/user-interface/animations/#javascript-animations
myinstance.animate("enable"); // Specify the name of the event to trigger
}
function sleep() {
// do something when the screen sleeps
}
Best Answer