2020-03-14 16:33:47 +01:00
|
|
|
#include "BatteryIcon.h"
|
2020-07-04 13:58:15 +02:00
|
|
|
#include "Symbols.h"
|
2020-11-15 16:49:36 +01:00
|
|
|
|
2020-03-14 16:33:47 +01:00
|
|
|
using namespace Pinetime::Applications::Screens;
|
|
|
|
|
2021-01-16 20:18:55 +01:00
|
|
|
const char* BatteryIcon::GetBatteryIcon(int batteryPercent) {
|
2021-04-18 19:28:14 +02:00
|
|
|
if (batteryPercent > 90)
|
|
|
|
return Symbols::batteryFull;
|
|
|
|
if (batteryPercent > 75)
|
|
|
|
return Symbols::batteryThreeQuarter;
|
|
|
|
if (batteryPercent > 50)
|
|
|
|
return Symbols::batteryHalf;
|
|
|
|
if (batteryPercent > 25)
|
|
|
|
return Symbols::batteryOneQuarter;
|
2020-07-04 13:58:15 +02:00
|
|
|
return Symbols::batteryEmpty;
|
|
|
|
}
|
2020-03-14 16:33:47 +01:00
|
|
|
|
2020-07-04 13:58:15 +02:00
|
|
|
const char* BatteryIcon::GetUnknownIcon() {
|
|
|
|
return Symbols::batteryEmpty;
|
2020-03-14 16:33:47 +01:00
|
|
|
}
|
|
|
|
|
2021-04-18 19:28:14 +02:00
|
|
|
const char* BatteryIcon::GetPlugIcon(bool isCharging) {
|
|
|
|
if (isCharging)
|
2020-07-04 13:58:15 +02:00
|
|
|
return Symbols::plug;
|
2021-04-18 19:28:14 +02:00
|
|
|
else
|
|
|
|
return "";
|
2020-03-14 16:33:47 +01:00
|
|
|
}
|