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
997e4cee8c
commit
8f68c67718
|
@ -454,7 +454,24 @@ void DisplayApp::Refresh() {
|
||||||
motorController.RunForDuration(35);
|
motorController.RunForDuration(35);
|
||||||
break;
|
break;
|
||||||
case Messages::OnChargingEvent:
|
case Messages::OnChargingEvent:
|
||||||
motorController.RunForDuration(15);
|
switch (currentApp) {
|
||||||
|
case Apps::Clock:
|
||||||
|
if (batteryController.IsCharging() && settingsController.IsAutoOpenOn(Controllers::Settings::AutoOpen::Battery)) {
|
||||||
|
// Open the battery app if on the clock screen
|
||||||
|
LoadNewScreen(Apps::BatteryInfo, DisplayApp::FullRefreshDirections::None);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case Apps::BatteryInfo:
|
||||||
|
if (!batteryController.IsCharging()) {
|
||||||
|
// Close the battery app after being unplugged
|
||||||
|
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Vibrate normally otherwise as to not close any open app
|
||||||
|
motorController.RunForDuration(15);
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue