I have custom made a really basic clock-face... No other permissions needed.. Just date, time, AM/PM and batter percentage.. Code below
How DO I get it approved for AOD
import clock from "clock";
import document from "document";
import { preferences } from "user-settings";
import { battery } from "power";
import * as util from "../common/utils";
// Update the clock every minute
clock.granularity = "minutes";
var month = new Array();
month[0] = "Jan";
month[1] = "Feb";
month[2] = "Mar";
month[3] = "Apr";
month[4] = "May";
month[5] = "Jun";
month[6] = "Jul";
month[7] = "Aug";
month[8] = "Sep";
month[9] = "Oct";
month[10] = "Nov";
month[11] = "Dec";
// Get a handle on the <text> element
const subhrminlabel = document.getElementById("subhrminlabel");
const subampmlabel = document.getElementById("subampmlabel");
const subdatelabel = document.getElementById("subdatelabel");
const subbatterylabel = document.getElementById("subbatterylabel");
// On change event for when the battery percentage changes
battery.onchange = (charger, evt) => {
subbatterylabel.text = battery.chargeLevel + "%";
if(battery.chargeLevel >= 75){
subbatterylabel.style.fill = "lime";
}else if(battery.chargeLevel >= 35){
subbatterylabel.style.fill = "yellow";
}else{
subbatterylabel.style.fill = "red";
}
}
// Update the <text> element every tick with the current time
clock.ontick = (evt) => {
let today = evt.date;
let hours = today.getHours();
let monthnum = today.getMonth();
let monthname = month[monthnum];
let day = today.getDate();
if (hours >= 12) {
subampmlabel.text = `PM`;
} else {
subampmlabel.text = `AM`;
}
if (preferences.clockDisplay === "12h") {
// 12h format
hours = hours % 12 || 12;
} else {
// 24h format
hours = util.zeroPad(hours);
}
let mins = util.zeroPad(today.getMinutes());
subhrminlabel.text = `${hours}:${mins}`;
subdatelabel.text = `${day} - ${monthname}`;
}
Answered! Go to the Best Answer.
Best AnswerAt the moment, AOD is by invitation only. Hopefully that will change soon.
Best AnswerThat was index.js (The above code)
Here's styles.css
--------------------
.background {
viewport-fill: black;
}
#subhrminlabel {
font-size: 80;
font-family: System-Bold;
text-length: 32;
text-anchor: middle;
x: 50%;
y: 60%;
fill: #b8b8b8;
}
#subampmlabel {
font-size: 25;
font-family: System-Light;
text-length: 2;
text-anchor: middle;
x: 50%;
y: 60%+30;
fill: #A9A9A9;
}
#subdatelabel {
font-size: 25;
font-family: System-Light;
text-length: 10;
text-anchor: middle;
x: 50%;
y: 50%-40;
fill: #b0c1c8;
}
#subbatterylabel {
font-size: 15;
font-family: System-Regular;
text-length: 10;
text-anchor: middle;
x: 25;
y: 20;
fill: green;
}
Here's index.gui
-----------------------
<svg class="background">
<text id="subhrminlabel" />
<text id="subampmlabel" />
<text id="subdatelabel" />
<text id="subbatterylabel" />
</svg>
Best AnswerYou can make it AOD-compatible and test it yourself (using the simulator). You just can't run it on a real watch without approval. And showing off your AOD-ready product couldn't do you any harm...
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Unfortunately AOD is disabled in the simulator. So it’s catch 22.
Unless you simulate AOD.... use dark grey, don’t let the clock work, don’t use any sensors, I don’t know why because the only battery drain is from the display. (Unless you’re a bad developer)
They should be using regulations for using AOD. Now we know nothing, but seeing an ugly (you don’t want to have) AOD clock. I don’t want this kind of clock so I turned it off.
it would be better if it was not on invite-only. I always thought USA was for free competition.
Best Answer
@MarioDings wrote:Unfortunately AOD is disabled in the simulator...
Have you tried enabling AOD in the simulator via 'quick settings' (swipe down from top)?
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
Never seen this option before, thanks for the suggestion.
Did see that the sidebuttons work.
Best AnswerHello Peter,
do you know if this has changed?
Or how can I set the aodAllowed = true anyway and submit for approval?
Regards,
EB
Best Answer