Merge pull request #3967 from bobrippling/feat/chargerot-redraw

chargerot: attempt `Bangle.uiRedraw()` if possible (optimisation)
master
Rob Pilling 2025-08-21 18:25:10 +01:00 committed by GitHub
commit 1d828a3a91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View File

@ -1,2 +1,3 @@
0.01: New App!
0.02: Handle missing settings (e.g. first-install)
0.03: Use Bangle.uiRedraw() if available as an optimisation

View File

@ -5,9 +5,14 @@
Bangle.on('charging', (charging) => {
if (charging) {
g.setRotation(chargingRotation&3,chargingRotation>>2).clear();
Bangle.showClock();
} else {
g.setRotation(defaultRotation&3,defaultRotation>>2).clear();
}
if (Bangle.uiRedraw) {
Bangle.uiRedraw();
Bangle.drawWidgets();
} else {
Bangle.showClock();
}
});

View File

@ -1,7 +1,7 @@
{
"id": "chargerot",
"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.",
"icon": "icon.png",
"tags": "battery",