mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 23:21:53 +02:00
feat: open battery app when charging
This commit is contained in:
parent
3a7dfdba8e
commit
8b85d2856e
|
@ -362,7 +362,16 @@ void DisplayApp::Refresh() {
|
||||||
break;
|
break;
|
||||||
case Messages::OnChargingEvent:
|
case Messages::OnChargingEvent:
|
||||||
RestoreBrightness();
|
RestoreBrightness();
|
||||||
motorController.RunForDuration(15);
|
if (batteryController.IsCharging() && currentApp == Apps::Clock) {
|
||||||
|
// Open the battery app if on the clock screen
|
||||||
|
LoadNewScreen(Apps::BatteryInfo, DisplayApp::FullRefreshDirections::None);
|
||||||
|
} else if (!batteryController.IsCharging() && currentApp == Apps::BatteryInfo) {
|
||||||
|
// Close the battery app after being unplugged
|
||||||
|
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
|
||||||
|
} else {
|
||||||
|
// Vibrate normally otherwise as to not close any open app
|
||||||
|
motorController.RunForDuration(15);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue