InfiniTime/src/displayapp/screens/BatteryIcon.cpp

29 lines
674 B
C++
Raw Normal View History

#include <cstdint>
#include "BatteryIcon.h"
#include "Symbols.h"
2020-11-15 15:49:36 +00:00
using namespace Pinetime::Applications::Screens;
const char* BatteryIcon::GetBatteryIcon(uint8_t batteryPercent) {
if (batteryPercent > 87)
return Symbols::batteryFull;
if (batteryPercent > 62)
return Symbols::batteryThreeQuarter;
if (batteryPercent > 37)
return Symbols::batteryHalf;
if (batteryPercent > 12)
return Symbols::batteryOneQuarter;
return Symbols::batteryEmpty;
}
const char* BatteryIcon::GetUnknownIcon() {
return Symbols::batteryEmpty;
}
const char* BatteryIcon::GetPlugIcon(bool isCharging) {
if (isCharging)
return Symbols::plug;
else
return "";
}