-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anti aliasing / Analog-Fitness Watchface / Cleanups (#380)
- Loading branch information
Showing
53 changed files
with
2,534 additions
and
1,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <osw_hal.h> | ||
#include <osw_ui.h> | ||
#include <OswAppV2.h> | ||
|
||
// if you want a cool background image, enable the following define | ||
//#define GIF_BG | ||
|
||
#ifdef GIF_BG | ||
class OswAppGifPlayer; | ||
#endif | ||
class OswAppWatchfaceFitnessAnalog : public OswAppV2 | ||
{ | ||
public: | ||
constexpr static const char *APP_ID = "osw.wf.afit"; | ||
|
||
const char *getAppId() override; | ||
const char *getAppName() override; | ||
|
||
void onStart(); | ||
void onLoop() override; | ||
void onDraw() override; | ||
void onButton(Button id, bool up, ButtonStateNames state) override; | ||
void onStop() override; | ||
|
||
static uint32_t calculateDistance(uint32_t steps); | ||
|
||
void timeDisplay(OswHal *hal, uint32_t hour, uint32_t minute, uint32_t second); | ||
void timeDisplay(OswHal *hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon); | ||
void dateDisplay(OswHal *hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon); | ||
|
||
void test(); | ||
|
||
~OswAppWatchfaceFitnessAnalog() {} | ||
|
||
private: | ||
time_t lastTime = 0; | ||
unsigned screen = 0; | ||
|
||
void showFitnessTracking(OswHal *hal); | ||
void drawWatchFace(OswHal *hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon); | ||
void drawDateFace(OswHal *hal, uint32_t hour, uint32_t minute, uint32_t second, bool afterNoon); | ||
|
||
#ifdef GIF_BG | ||
OswAppGifPlayer* bgGif = nullptr; | ||
#endif | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.