2020-03-14 15:33:47 +00:00
|
|
|
#include "BatteryIcon.h"
|
2020-07-04 11:58:15 +00:00
|
|
|
#include "Symbols.h"
|
2020-03-14 15:33:47 +00:00
|
|
|
using namespace Pinetime::Applications::Screens;
|
|
|
|
|
2020-07-04 11:58:15 +00:00
|
|
|
const char* BatteryIcon::GetBatteryIcon(float batteryPercent) {
|
|
|
|
if(batteryPercent > 90.0f) return Symbols::batteryFull;
|
|
|
|
if(batteryPercent > 75.0f) return Symbols::batteryThreeQuarter;
|
|
|
|
if(batteryPercent > 50.0f) return Symbols::batteryHalf;
|
|
|
|
if(batteryPercent > 25.0f) return Symbols::batteryOneQuarter;
|
|
|
|
return Symbols::batteryEmpty;
|
|
|
|
}
|
2020-03-14 15:33:47 +00:00
|
|
|
|
2020-07-04 11:58:15 +00:00
|
|
|
const char* BatteryIcon::GetUnknownIcon() {
|
|
|
|
return Symbols::batteryEmpty;
|
2020-03-14 15:33:47 +00:00
|
|
|
}
|
|
|
|
|
2020-07-04 11:58:15 +00:00
|
|
|
const char *BatteryIcon::GetPlugIcon(bool isCharging) {
|
|
|
|
if(isCharging)
|
|
|
|
return Symbols::plug;
|
|
|
|
else return "";
|
2020-03-14 15:33:47 +00:00
|
|
|
}
|