2021-07-11 10:55:06 -04:00
|
|
|
#include <cstdint>
|
2020-03-14 11:33:47 -04:00
|
|
|
#include "BatteryIcon.h"
|
2020-07-04 07:58:15 -04:00
|
|
|
#include "Symbols.h"
|
2020-11-15 10:49:36 -05:00
|
|
|
|
2020-03-14 11:33:47 -04:00
|
|
|
using namespace Pinetime::Applications::Screens;
|
|
|
|
|
2021-07-11 10:55:06 -04:00
|
|
|
const char* BatteryIcon::GetBatteryIcon(uint8_t batteryPercent) {
|
2021-06-09 07:47:22 -04:00
|
|
|
if (batteryPercent > 87)
|
2021-04-18 13:28:14 -04:00
|
|
|
return Symbols::batteryFull;
|
2021-06-09 07:47:22 -04:00
|
|
|
if (batteryPercent > 62)
|
2021-04-18 13:28:14 -04:00
|
|
|
return Symbols::batteryThreeQuarter;
|
2021-06-09 07:47:22 -04:00
|
|
|
if (batteryPercent > 37)
|
2021-04-18 13:28:14 -04:00
|
|
|
return Symbols::batteryHalf;
|
2021-06-09 07:47:22 -04:00
|
|
|
if (batteryPercent > 12)
|
2021-04-18 13:28:14 -04:00
|
|
|
return Symbols::batteryOneQuarter;
|
2020-07-04 07:58:15 -04:00
|
|
|
return Symbols::batteryEmpty;
|
|
|
|
}
|
2020-03-14 11:33:47 -04:00
|
|
|
|
2020-07-04 07:58:15 -04:00
|
|
|
const char* BatteryIcon::GetUnknownIcon() {
|
|
|
|
return Symbols::batteryEmpty;
|
2020-03-14 11:33:47 -04:00
|
|
|
}
|
|
|
|
|
2021-04-18 13:28:14 -04:00
|
|
|
const char* BatteryIcon::GetPlugIcon(bool isCharging) {
|
|
|
|
if (isCharging)
|
2020-07-04 07:58:15 -04:00
|
|
|
return Symbols::plug;
|
2021-04-18 13:28:14 -04:00
|
|
|
else
|
|
|
|
return "";
|
2020-03-14 11:33:47 -04:00
|
|
|
}
|