Skip to content

Commit 275667e

Browse files
committed
chargerot: attempt Bangle.uiRedraw() if possible (optimisation)
1 parent 1ff8162 commit 275667e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

apps/chargerot/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
0.01: New App!
22
0.02: Handle missing settings (e.g. first-install)
3+
0.03: Use Bangle.uiRedraw() if available as an optimisation

apps/chargerot/boot.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
Bangle.on('charging', (charging) => {
66
if (charging) {
77
g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
8-
Bangle.showClock();
98
} else {
109
g.setRotation(defaultRotation&3,defaultRotation>>2).clear();
10+
}
11+
12+
if (Bangle.uiRedraw) {
13+
Bangle.uiRedraw();
14+
Bangle.drawWidgets();
15+
} else {
1116
Bangle.showClock();
1217
}
1318
});

apps/chargerot/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "chargerot",
33
"name": "Charge LCD rotation",
4-
"version": "0.02",
4+
"version": "0.03",
55
"description": "When charging, this app can rotate your screen and revert it when unplugged. Made for all sort of cradles.",
66
"icon": "icon.png",
77
"tags": "battery",

0 commit comments

Comments
 (0)