InfiniTime/src/DisplayApp/Screens/BatteryIcon.cpp
JF da39f402e5 Replace bitmap icons by font icons (provided by AwesomeFont and LVGL). These icons are smaller in memory and quicker to draw.
BLE and battery icon replaced in Clock screen.
Added heartbeat and step icons in Clock screen.
Replace all labels in Menu by icons.

Add doc to generate new font.
2020-07-04 13:58:15 +02:00

22 lines
639 B
C++

#include "BatteryIcon.h"
#include "Symbols.h"
using namespace Pinetime::Applications::Screens;
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;
}
const char* BatteryIcon::GetUnknownIcon() {
return Symbols::batteryEmpty;
}
const char *BatteryIcon::GetPlugIcon(bool isCharging) {
if(isCharging)
return Symbols::plug;
else return "";
}