ac7b2da611
Don't use relative imports like `../foo.h` as those depend on the relative position of both files. Rather than that use imports relative to the `src` directory, which explicitly is part of the include directories.
29 lines
712 B
C++
29 lines
712 B
C++
#include <cstdint>
|
|
#include "displayapp/screens/BatteryIcon.h"
|
|
#include "displayapp/screens/Symbols.h"
|
|
|
|
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 "";
|
|
}
|