mvg UI update again

This commit is contained in:
2026-08-02 14:50:06 +02:00
parent c2947fa748
commit eeb580b1d0
+10 -4
View File
@@ -17,8 +17,10 @@ unsigned long lastFetchMs = 0;
const unsigned long REFRESH_INTERVAL_MS = 60UL * 1000UL;
lv_color_t typeColor(const String &type) {
if (type == "UBAHN") return Theme::accentUBahn();
if (type == "SBAHN") return Theme::accentSBahn();
String t = type;
t.toUpperCase();
if (t.indexOf("U") >= 0 && t.indexOf("BAHN") >= 0) return Theme::accentUBahn();
if (t.indexOf("S") >= 0 && t.indexOf("BAHN") >= 0) return Theme::accentSBahn();
return Theme::textDim();
}
@@ -51,7 +53,7 @@ void buildList() {
String dest = sanitizeGermanText(dep.destination.substring(0, 20));
lv_obj_t *d = lv_label_create(row);
lv_label_set_text(d, dest.c_str());
lv_obj_set_style_text_color(d, Theme::text(), 0);
lv_obj_set_style_text_color(d, lv_color_hex(0xFFFFFF), 0);
lv_obj_align(d, LV_ALIGN_TOP_LEFT, 0, 18);
String right;
@@ -81,12 +83,16 @@ void doFetch() {
void mvgScreen_setNavigator(ScreenId (*nav)(ScreenId)) { g_navigate = nav; }
void mvgScreen_create(Screen &s) {
list = lv_list_create(s.root);
list = lv_obj_create(s.root);
lv_obj_set_pos(list, 0, 0);
lv_obj_set_size(list, 320, 480 - 80);
lv_obj_set_style_bg_color(list, Theme::bg(), 0);
lv_obj_set_style_bg_opa(list, LV_OPA_COVER, 0);
lv_obj_set_style_border_width(list, 0, 0);
lv_obj_set_style_pad_all(list, 0, 0);
lv_obj_set_style_text_color(list, Theme::text(), 0);
lv_obj_set_flex_flow(list, LV_FLEX_FLOW_COLUMN);
lv_obj_add_flag(list, LV_OBJ_FLAG_SCROLLABLE);
back_button_create(s.root, on_back, nullptr);
}