chargerot: attempt `Bangle.uiRedraw()` if possible (optimisation)
parent
49cf18bde5
commit
15c7467985
|
|
@ -1,2 +1,3 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
0.02: Handle missing settings (e.g. first-install)
|
0.02: Handle missing settings (e.g. first-install)
|
||||||
|
0.03: Use Bangle.uiRedraw() if available as an optimisation
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,14 @@
|
||||||
Bangle.on('charging', (charging) => {
|
Bangle.on('charging', (charging) => {
|
||||||
if (charging) {
|
if (charging) {
|
||||||
g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
|
g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
|
||||||
Bangle.showClock();
|
|
||||||
} else {
|
} else {
|
||||||
g.setRotation(defaultRotation&3,defaultRotation>>2).clear();
|
g.setRotation(defaultRotation&3,defaultRotation>>2).clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Bangle.uiRedraw) {
|
||||||
|
Bangle.uiRedraw();
|
||||||
|
Bangle.drawWidgets();
|
||||||
|
} else {
|
||||||
Bangle.showClock();
|
Bangle.showClock();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "chargerot",
|
"id": "chargerot",
|
||||||
"name": "Charge LCD rotation",
|
"name": "Charge LCD rotation",
|
||||||
"version": "0.02",
|
"version": "0.03",
|
||||||
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
|
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"tags": "battery",
|
"tags": "battery",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue