2020-01-18 12:17:52 -05:00
|
|
|
#include <cstdio>
|
|
|
|
#include <libs/date/includes/date/date.h>
|
|
|
|
#include <Components/DateTime/DateTimeController.h>
|
|
|
|
#include <Version.h>
|
2020-02-08 12:01:02 -05:00
|
|
|
#include <libs/lvgl/src/lv_core/lv_obj.h>
|
2020-02-10 15:05:33 -05:00
|
|
|
#include <libs/lvgl/src/lv_font/lv_font.h>
|
2020-02-08 12:01:02 -05:00
|
|
|
#include <libs/lvgl/lvgl.h>
|
2020-01-18 12:17:52 -05:00
|
|
|
#include "Message.h"
|
|
|
|
|
|
|
|
using namespace Pinetime::Applications::Screens;
|
|
|
|
|
2020-02-10 15:05:33 -05:00
|
|
|
extern lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed;
|
|
|
|
|
2020-02-08 12:01:02 -05:00
|
|
|
lv_obj_t * label;
|
2020-02-10 15:05:33 -05:00
|
|
|
int x = 0;
|
2020-01-18 12:17:52 -05:00
|
|
|
void Message::Refresh(bool fullRefresh) {
|
|
|
|
if(fullRefresh) {
|
2020-02-10 15:05:33 -05:00
|
|
|
label = lv_label_create(lv_scr_act(), NULL); /*Add a label to the button*/
|
|
|
|
labelStyle = const_cast<lv_style_t *>(lv_label_get_style(label, LV_LABEL_STYLE_MAIN));
|
|
|
|
labelStyle->text.font = &jetbrains_mono_extrabold_compressedextrabold_compressed;
|
|
|
|
lv_label_set_style(label, LV_LABEL_STYLE_MAIN, labelStyle);
|
|
|
|
lv_label_set_text(label, "01:23"); /*Set the labels text*/
|
|
|
|
} else {
|
|
|
|
lv_obj_set_pos(label, 0, x++);
|
|
|
|
if(x > 200) x = 0;
|
2020-01-18 12:17:52 -05:00
|
|
|
}
|
2020-02-08 12:01:02 -05:00
|
|
|
|
2020-01-18 12:17:52 -05:00
|
|
|
}
|