Browse Source

refactor

pull/2568/head
Christos Themelis 5 months ago
parent
commit
a0bfad258b
  1. 12
      examples/simple_secure_chat_ui/main.cpp
  2. 357
      examples/simple_secure_chat_ui/uiManager.cpp
  3. 39
      include/uiManager.h
  4. 7
      src/UI/CMakeLists.txt
  5. 5
      src/UI/filelist.txt
  6. 59
      src/UI/ui.c
  7. 66
      src/UI/ui.h
  8. 341
      src/UI/ui_Screen1.c
  9. 5
      src/UI/ui_comp_hook.c
  10. 7
      src/UI/ui_events.cpp
  11. 17
      src/UI/ui_events.h
  12. 347
      src/UI/ui_helpers.c
  13. 148
      src/UI/ui_helpers.h
  14. 42
      src/UI_design/SquareLine_Project.sll
  15. 9258
      src/UI_design/SquareLine_Project.spj
  16. 4
      src/UI_design/SquareLine_Project_events.py
  17. 8
      src/UI_design/Themes.slt
  18. BIN
      src/UI_design/autosave/SquareLine_Project_autosave00.zip
  19. BIN
      src/UI_design/autosave/SquareLine_Project_autosave01.zip
  20. BIN
      src/UI_design/autosave/SquareLine_Project_autosave02.zip
  21. BIN
      src/UI_design/autosave/SquareLine_Project_autosave03.zip
  22. BIN
      src/UI_design/autosave/SquareLine_Project_autosave04.zip
  23. BIN
      src/UI_design/autosave/SquareLine_Project_autosave05.zip
  24. BIN
      src/UI_design/autosave/SquareLine_Project_autosave06.zip
  25. BIN
      src/UI_design/autosave/SquareLine_Project_autosave07.zip
  26. BIN
      src/UI_design/autosave/SquareLine_Project_autosave08.zip
  27. BIN
      src/UI_design/autosave/SquareLine_Project_autosave09.zip
  28. BIN
      src/UI_design/backup/SquareLine_Project_backup01.zip
  29. 7
      src/UI_design/export/CMakeLists.txt
  30. 5
      src/UI_design/export/filelist.txt
  31. 58
      src/UI_design/export/ui.c
  32. 56
      src/UI_design/export/ui.h
  33. 87
      src/UI_design/export/ui_Screen1.c
  34. 5
      src/UI_design/export/ui_comp_hook.c
  35. 11
      src/UI_design/export/ui_events.cpp
  36. 19
      src/UI_design/export/ui_events.h
  37. 347
      src/UI_design/export/ui_helpers.c
  38. 148
      src/UI_design/export/ui_helpers.h

12
examples/simple_secure_chat_ui/main.cpp

@ -48,7 +48,6 @@
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include "UI/ui.h"
#include "../src/fonts/fonts.h"
#include "../lvgl/lvgl.h"
@ -93,10 +92,6 @@ void format_time(uint32_t ts, char *buf, size_t len)
strftime(buf, len, "%H:%M:%S", tm_info);
}
void onDayLightPressed(bool pressed) {
//mySettings->writeBool(PREF_DAYLIGHT, pressed);
}
void parse_group_message(const char *input,
char *sender_out, size_t sender_len,
char *msg_out, size_t msg_len)
@ -171,8 +166,6 @@ void my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
void initializeUI() {
Serial.println("initialize UI...");
ui_init();
setNightMode(false);
//ui_init_screen_events();
/*
@ -188,6 +181,7 @@ void initializeUI() {
#endif
*/
uiManager = new UIManager();
uiManager->setNightMode(false);
}
@ -392,7 +386,7 @@ protected:
bool is_self = (strcmp(from.name, _prefs.node_name) == 0);
uiManager->addPrivateChatBubble(ui_ContactMessages, time_buf, text, is_self);
uiManager->addPrivateChatBubble(time_buf, text, is_self);
}
void onCommandDataRecv(const ContactInfo& from, mesh::Packet* pkt, uint32_t sender_timestamp, const char *text) override {
@ -427,7 +421,7 @@ protected:
bool is_self = (strcmp(sender, _prefs.node_name) == 0);
uiManager->addChatBubble(ui_ChannelMessages, time_buf, sender, msg, is_self);
uiManager->addChatBubble(time_buf, sender, msg, is_self);
}
uint8_t onContactRequest(const ContactInfo& contact, uint32_t sender_timestamp, const uint8_t* data, uint8_t len, uint8_t* reply) override {

357
examples/simple_secure_chat_ui/uiManager.cpp

@ -1,11 +1,11 @@
#include <Arduino.h>
#include "esp_log.h"
#include "UI/ui.h"
#include "uiDefines.h"
#include "uiVars.h"
#include "uiManager.h"
#include "../src/fonts/fonts.h"
#include <helpers/ContactInfo.h>
#include <helpers/AdvertDataHelpers.h>
@ -24,9 +24,16 @@ const char *UIManager::months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
UIManager::UIManager() {
//myDebug->println(DEBUG_LEVEL_DEBUG, "[UIManager]");
tmp_buf = (char*)malloc(128);
lv_disp_t * dispp = lv_disp_get_default();
lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
false, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme);
ui_Screen1_screen_init();
ui____initial_actions0 = lv_obj_create(NULL);
lv_disp_load_scr(ui_Screen1);
}
void UIManager::format_datetime(char *buf, size_t size, const struct tm *timeinfo) {
@ -117,11 +124,7 @@ void UIManager::updateInfo(const char *str, uint32_t color) {
// lv_obj_set_style_text_color(ui_ValueLastUpdate, lv_color_hex(color), LV_PART_MAIN | LV_STATE_DEFAULT);
}
void UIManager::addChatBubble(lv_obj_t *list,
const char *time_str,
const char *sender,
const char *msg,
bool is_self)
void UIManager::addChatBubble(const char *time_str, const char *sender, const char *msg,bool is_self)
{
// Remove oldest
if (chat_count >= MAX_CHAT_MESSAGES) {
@ -131,7 +134,7 @@ void UIManager::addChatBubble(lv_obj_t *list,
}
// Row container (align bubble left/right)
lv_obj_t *row = lv_obj_create(list);
lv_obj_t *row = lv_obj_create(ui_ChannelMessages);
lv_obj_set_width(row, lv_pct(100));
lv_obj_set_height(row, LV_SIZE_CONTENT);
lv_obj_set_style_bg_opa(row, 0, 0);
@ -206,12 +209,12 @@ void UIManager::addChatBubble(lv_obj_t *list,
lv_obj_scroll_to_view(row, LV_ANIM_ON);
}
void UIManager::addPrivateChatBubble(lv_obj_t *list, const char *time_str, const char *msg, bool is_self) {
void UIManager::addPrivateChatBubble(const char *time_str, const char *msg, bool is_self) {
lv_obj_set_style_pad_bottom(list, 20, 0);
lv_obj_set_style_pad_bottom(ui_ContactMessages, 20, 0);
// 1. Row container
lv_obj_t *row = lv_obj_create(list);
lv_obj_t *row = lv_obj_create(ui_ContactMessages);
lv_obj_set_width(row, lv_pct(100));
lv_obj_set_height(row, LV_SIZE_CONTENT);
lv_obj_set_style_bg_opa(row, 0, 0);
@ -453,3 +456,335 @@ void UIManager::addContactToUI(ContactInfo c)
lv_obj_clear_flag(seen_label, LV_OBJ_FLAG_CLICKABLE);
}
void UIManager::onShowKeyboard() {
lv_obj_clear_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
//lv_obj_set_style_bg_opa(ui_DimOverlay, 160, 0);
lv_obj_add_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_set_y(ui_ChannelInput, channelInputBaseKeybOnY);
lv_obj_set_y(ui_SendBtn, channelInputBaseKeybOnY);
}
void UIManager::onHideKeyboard() {
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
//lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_set_y(ui_ChannelInput, channelInputBaseY);
lv_obj_set_y(ui_SendBtn, channelInputBaseY);
}
static void s_onChannelInputFocus(lv_event_t *e)
{
UIManager *self = (UIManager*) lv_event_get_user_data(e);
if(self) self->onChannelInputFocus(e);
}
void UIManager::onChannelInputFocus(lv_event_t* e)
{
lv_obj_t* ta = lv_event_get_target(e);
if(!ui_Keyboard || !ta) return;
lv_keyboard_set_textarea(ui_Keyboard, ta);
onShowKeyboard();
}
static void s_onSendClick(lv_event_t *e)
{
UIManager *self = (UIManager*) lv_event_get_user_data(e);
if(self) self->onSendClick(e);
}
void UIManager::onSendClick(lv_event_t* e)
{
char fullMessage[260];
onHideKeyboard();
const char* msg = lv_textarea_get_text(ui_ChannelInput);
if(msg == NULL || strlen(msg) == 0) return;
lv_textarea_set_text(ui_ChannelInput, "");
sprintf(fullMessage, "public %s", msg);
//handleCommand(fullMessage);
}
static void s_onKeyboardEvent(lv_event_t *e)
{
UIManager *self = (UIManager*) lv_event_get_user_data(e);
if(self) self->onKeyboardEvent(e);
}
void UIManager::onKeyboardEvent(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e);
if(code == LV_EVENT_READY || code == LV_EVENT_CANCEL)
{
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
// Restore UI
lv_obj_set_y(ui_ChannelInput, channelInputBaseY);
lv_obj_set_y(ui_SendBtn, channelInputBaseY);
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
}
}
static void s_onDimOverlayClick(lv_event_t *e)
{
UIManager *self = (UIManager*) lv_event_get_user_data(e);
if(self) self->onDimOverlayClick(e);
}
void UIManager::onDimOverlayClick(lv_event_t* e)
{
onHideKeyboard();
}
static void onScrollBeginEvent(lv_event_t *e)
{
UIManager *self = (UIManager*) lv_event_get_user_data(e);
if(self) self->scroll_begin_event(e);
}
void UIManager::scroll_begin_event(lv_event_t *e)
{
if (lv_event_get_code(e) == LV_EVENT_SCROLL_BEGIN) {
lv_anim_t* a = (lv_anim_t*)lv_event_get_param(e);
if (a) a->time = 0;
}
}
void UIManager::ui_Screen1_screen_init(void)
{
ui_Screen1 = lv_obj_create(NULL);
lv_obj_clear_flag(ui_Screen1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_Screen1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_Screen1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_TabView1 = lv_tabview_create(ui_Screen1, LV_DIR_TOP, 50);
lv_obj_add_event_cb(lv_tabview_get_content(ui_TabView1), onScrollBeginEvent, LV_EVENT_SCROLL_BEGIN, this);
lv_obj_clear_flag(lv_tabview_get_content(ui_TabView1), LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_width(ui_TabView1, 800);
lv_obj_set_height(ui_TabView1, 480);
lv_obj_set_align(ui_TabView1, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_TabView1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_TabView1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_TabView1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0x424242),
LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0xFFFFFF),
LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(lv_tabview_get_tab_btns(ui_TabView1), &lv_font_arial_18,
LV_PART_ITEMS | LV_STATE_DEFAULT);
#if defined(LANG_EN)
ui_TabPageHome = lv_tabview_add_tab(ui_TabView1, "Home");
#elif defined(LANG_GR)
ui_TabPageHome = lv_tabview_add_tab(ui_TabView1, "Αρχική");
#endif
ui_ValueDate = lv_label_create(ui_TabPageHome);
lv_obj_set_width(ui_ValueDate, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_ValueDate, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_ValueDate, 0);
lv_obj_set_y(ui_ValueDate, -165);
lv_obj_set_align(ui_ValueDate, LV_ALIGN_CENTER);
lv_label_set_text(ui_ValueDate, "--- --/--/----");
lv_obj_set_style_text_color(ui_ValueDate, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_ValueDate, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_ValueDate, &lv_font_arial_40, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_ValueTime = lv_label_create(ui_TabPageHome);
lv_obj_set_width(ui_ValueTime, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_ValueTime, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_ValueTime, 0);
lv_obj_set_y(ui_ValueTime, -100);
lv_obj_set_align(ui_ValueTime, LV_ALIGN_CENTER);
lv_label_set_text(ui_ValueTime, "--:--");
lv_obj_set_style_text_color(ui_ValueTime, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_ValueTime, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_ValueTime, &lv_font_arial_48, LV_PART_MAIN | LV_STATE_DEFAULT);
#if defined(LANG_EN)
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Contacts");
#elif defined(LANG_GR)
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Επαφές");
#endif
// Prevent scrolling
lv_obj_set_scrollbar_mode(ui_TabPageContacts, LV_SCROLLBAR_MODE_OFF);
lv_obj_clear_flag(ui_TabPageContacts, LV_OBJ_FLAG_SCROLLABLE);
ui_Contacts = lv_list_create(ui_TabPageContacts);
//lv_list_set_options(ui_Contacts, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_Contacts, 250);
lv_obj_set_height(ui_Contacts, 400);
lv_obj_set_x(ui_Contacts, -274);
lv_obj_set_y(ui_Contacts, 0);
lv_obj_set_align(ui_Contacts, LV_ALIGN_CENTER);
lv_obj_set_style_bg_opa(ui_Contacts, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_Contacts, 0, 0);
lv_obj_set_style_outline_width(ui_Contacts, 0, 0);
lv_obj_set_style_shadow_width(ui_Contacts, 0, 0);
//lv_obj_set_scrollbar_mode(ui_Contacts, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_Contacts, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_Contacts, 0, LV_PART_ITEMS);
ui_ContactMessages = lv_list_create(ui_TabPageContacts);
//lv_list_set_options(ui_ContactMessages, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_ContactMessages, 500);
lv_obj_set_height(ui_ContactMessages, 400);
lv_obj_set_x(ui_ContactMessages, 124);
lv_obj_set_y(ui_ContactMessages, 0);
lv_obj_set_align(ui_ContactMessages, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ContactMessages, lv_color_hex(0), 0);
lv_obj_set_style_bg_opa(ui_ContactMessages, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_ContactMessages, 0, 0);
lv_obj_set_style_outline_width(ui_ContactMessages, 0, 0);
lv_obj_set_style_shadow_width(ui_ContactMessages, 0, 0);
//lv_obj_set_scrollbar_mode(ui_ContactMessages, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_ContactMessages, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_ContactMessages, 0, LV_PART_ITEMS);
lv_obj_t *divider = lv_obj_create(ui_TabPageContacts);
lv_obj_set_size(divider, 2, 400);
lv_obj_set_pos(divider, 222, 0); // align between lists
lv_obj_set_style_bg_color(divider, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(divider, 0, 0);
lv_obj_set_style_radius(divider, 0, 0);
#if defined(LANG_EN)
ui_TabPageChannels = lv_tabview_add_tab(ui_TabView1, "Channels");
#elif defined(LANG_GR)
ui_TabPageChannels = lv_tabview_add_tab(ui_TabView1, "Κανάλια");
#endif
lv_obj_set_scrollbar_mode(ui_TabPageChannels, LV_SCROLLBAR_MODE_OFF);
lv_obj_clear_flag(ui_TabPageChannels, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_bg_color(ui_TabPageChannels, lv_color_hex(0x000000), 0);
ui_Channels = lv_dropdown_create(ui_TabPageChannels);
lv_dropdown_set_options(ui_Channels, "Public");
lv_obj_set_width(ui_Channels, 291);
lv_obj_set_height(ui_Channels, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_Channels, -243);
lv_obj_set_y(ui_Channels, -182);
lv_obj_set_align(ui_Channels, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_Channels, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
ui_ChannelMessages = lv_list_create(ui_TabPageChannels);
//lv_list_set_options(ui_ChannelMessages, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_ChannelMessages, 780);
lv_obj_set_height(ui_ChannelMessages, 260);
lv_obj_set_x(ui_ChannelMessages, 0);
lv_obj_set_y(ui_ChannelMessages, -40);
lv_obj_set_align(ui_ChannelMessages, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ChannelMessages, lv_color_hex(0), 0);
lv_obj_set_style_bg_opa(ui_ChannelMessages, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_ChannelMessages, 0, 0);
lv_obj_set_style_outline_width(ui_ChannelMessages, 0, 0);
lv_obj_set_style_shadow_width(ui_ChannelMessages, 0, 0);
//lv_obj_set_scrollbar_mode(ui_ChannelMessages, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_ChannelMessages, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_ChannelMessages, 0, LV_PART_ITEMS);
ui_ChannelDivider = lv_obj_create(ui_TabPageChannels);
lv_obj_set_size(ui_ChannelDivider, 780, 1);
lv_obj_set_pos(ui_ChannelDivider, 0, 150);
lv_obj_set_align(ui_ChannelDivider, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ChannelDivider, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(ui_ChannelDivider, 0, 0);
#if defined(LANG_EN)
ui_TabPageSettings = lv_tabview_add_tab(ui_TabView1, "Settings");
#elif defined(LANG_GR)
ui_TabPageSettings = lv_tabview_add_tab(ui_TabView1, "Ρυθμίσεις");
#endif
ui_DimOverlay = lv_obj_create(ui_Screen1);
lv_obj_remove_style_all(ui_DimOverlay); // no border/padding
lv_obj_set_size(ui_DimOverlay, LV_PCT(100), LV_PCT(100));
lv_obj_set_align(ui_DimOverlay, LV_ALIGN_CENTER);
lv_obj_add_event_cb(ui_DimOverlay, s_onDimOverlayClick, LV_EVENT_CLICKED, this);
// black semi transparent background
lv_obj_set_style_bg_color(ui_DimOverlay, lv_color_hex(0x000000), 0);
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0); // initially "off"
//Edit text
ui_ChannelInput = lv_textarea_create(ui_TabPageChannels);
lv_obj_set_size(ui_ChannelInput, 670, 40);
lv_obj_set_pos(ui_ChannelInput, -50, channelInputBaseY);
lv_obj_set_align(ui_ChannelInput, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_ChannelInput, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_flag(ui_ChannelInput, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
#if defined(LANG_EN)
lv_textarea_set_placeholder_text(ui_ChannelInput, "Write message...");
#elif defined(LANG_GR)
lv_textarea_set_placeholder_text(ui_ChannelInput, "Γράψε μήνυμα...");
#endif
lv_textarea_set_one_line(ui_ChannelInput, true);
lv_obj_set_style_text_font(ui_ChannelInput, &lv_font_arial_20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_ChannelInput, lv_color_hex(0x111111), 0);
lv_obj_set_style_text_color(ui_ChannelInput, lv_color_white(), 0);
lv_obj_set_style_border_color(ui_ChannelInput, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(ui_ChannelInput, 1, 0);
lv_obj_set_style_radius(ui_ChannelInput, 6, 0);
lv_obj_add_event_cb(ui_ChannelInput, s_onChannelInputFocus, LV_EVENT_CLICKED, this);
// Send button
ui_SendBtn = lv_btn_create(ui_TabPageChannels);
lv_obj_set_size(ui_SendBtn, 90, 42);
lv_obj_set_pos(ui_SendBtn, 350, channelInputBaseY);
lv_obj_set_align(ui_SendBtn, LV_ALIGN_CENTER);
lv_obj_set_style_text_font(ui_SendBtn, &lv_font_arial_20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_SendBtn, lv_color_hex(0x3A7AFE), 0);
lv_obj_add_event_cb(ui_SendBtn, s_onSendClick, LV_EVENT_CLICKED, this);
iu_SendLabel = lv_label_create(ui_SendBtn);
#if defined(LANG_EN)
lv_label_set_text(sendLabel, "Send");
#elif defined(LANG_GR)
lv_label_set_text(iu_SendLabel, "Αποστολή");
#endif
lv_obj_center(iu_SendLabel);
// Keyboard
ui_Keyboard = lv_keyboard_create(lv_layer_top());
lv_obj_set_size(ui_Keyboard, 800, 200);
lv_obj_set_align(ui_Keyboard, LV_ALIGN_BOTTOM_MID);
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_event_cb(ui_Keyboard, s_onKeyboardEvent, LV_EVENT_ALL, this);
// Do not block touch/scroll
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLL_CHAIN_HOR);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLL_CHAIN_VER);
// always in front
lv_obj_move_foreground(ui_DimOverlay);
}
void UIManager::setNightMode(bool night) {
if (!ui_DimOverlay) return;
if (night) {
lv_obj_set_style_bg_opa(ui_DimOverlay, 192, 0); // 75% dark
} else {
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0); // none
}
}

39
include/uiManager.h

@ -26,18 +26,53 @@ class UIManager {
lv_obj_t *chat_items[MAX_CHAT_MESSAGES];
int chat_count = 0;
int channelInputBaseY = 185;
int channelInputBaseKeybOnY = -15;
void onShowKeyboard();
void onHideKeyboard();
void ui_Screen1_screen_init(void);
lv_obj_t* ui_Screen1;
lv_obj_t* ui_TabView1;
lv_obj_t* ui_TabPageContacts;
lv_obj_t* ui_Contacts;
lv_obj_t* ui_ContactMessages;
lv_obj_t* ui_TabPageChannels;
lv_obj_t* ui_Channels;
lv_obj_t* ui_ChannelMessages;
lv_obj_t* ui_AutoLight;
lv_obj_t* ui____initial_actions0;
lv_obj_t* ui_DimOverlay;
lv_obj_t* ui_TabPageHome;
lv_obj_t* ui_ValueDate;
lv_obj_t* ui_ValueTime;
lv_obj_t* ui_TabPageSettings;
lv_obj_t* ui_DayLight;
lv_obj_t* ui_ChannelInput;
lv_obj_t* ui_SendBtn;
lv_obj_t* ui_Keyboard;
lv_obj_t* iu_SendLabel;
lv_obj_t* ui_ChannelDivider;
public:
UIManager();
void onChannelInputFocus(lv_event_t* e);
void onDimOverlayClick(lv_event_t* e);
void onSendClick(lv_event_t* e);
void onKeyboardEvent(lv_event_t* e);
void scroll_begin_event(lv_event_t* e);
void updateDateTime(const struct tm timeinfo);
void updateInfo(const char *str, uint32_t color);
void clearDateTime();
void updateValues();
void addPrivateChatBubble(lv_obj_t *list, const char *time_str, const char *msg, bool is_self);
void addChatBubble(lv_obj_t *list, const char *time_str, const char *sender, const char *msg, bool is_self);
void addPrivateChatBubble(const char *time_str, const char *msg, bool is_self);
void addChatBubble(const char *time_str, const char *sender, const char *msg,bool is_self);
void addContactToUI(ContactInfo c);
void handleContactClick(lv_event_t *e);
void setNightMode(bool night);
};
#endif

7
src/UI/CMakeLists.txt

@ -1,7 +0,0 @@
SET(SOURCES ui_Screen1.c
ui.c
ui_comp_hook.c
ui_helpers.c
ui_events.cpp)
add_library(ui ${SOURCES})

5
src/UI/filelist.txt

@ -1,5 +0,0 @@
ui_Screen1.c
ui.c
ui_comp_hook.c
ui_helpers.c
ui_events.cpp

59
src/UI/ui.c

@ -1,59 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"
#include "ui_helpers.h"
///////////////////// VARIABLES ////////////////////
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
lv_obj_t* ui_Screen1;
lv_obj_t* ui_TabView1;
lv_obj_t* ui_TabPageContacts;
lv_obj_t* ui_Contacts;
lv_obj_t* ui_ContactMessages;
lv_obj_t* ui_TabPageChannels;
lv_obj_t* ui_Channels;
lv_obj_t* ui_ChannelMessages;
void ui_event_AutoLight(lv_event_t * e);
lv_obj_t* ui_AutoLight;
lv_obj_t* ui____initial_actions0;
lv_obj_t* ui_DimOverlay;
lv_obj_t* ui_TabPageHome;
lv_obj_t* ui_ValueDate;
lv_obj_t* ui_ValueTime;
lv_obj_t* ui_TabPageSettings;
lv_obj_t* ui_DayLight;
lv_obj_t* ui____initial_actions0;
lv_obj_t* ui_ChannelInput;
lv_obj_t* ui_SendBtn;
lv_obj_t* ui_Keyboard;
lv_obj_t* iu_SendLabel;
lv_obj_t* ui_ChannelDivider;
///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
#endif
#if LV_COLOR_16_SWAP !=0
#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings"
#endif
///////////////////// SCREENS ////////////////////
void ui_init(void)
{
lv_disp_t * dispp = lv_disp_get_default();
lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
false, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme);
ui_Screen1_screen_init();
ui____initial_actions0 = lv_obj_create(NULL);
lv_disp_load_scr(ui_Screen1);
}

66
src/UI/ui.h

@ -1,66 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _SQUARELINE_PROJECT_UI_H
#define _SQUARELINE_PROJECT_UI_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined __has_include
#if __has_include("lvgl.h")
#include "lvgl.h"
#elif __has_include("lvgl/lvgl.h")
#include "lvgl/lvgl.h"
#else
#include "lvgl.h"
#endif
#else
#include "lvgl.h"
#endif
#include "ui_helpers.h"
#include "ui_events.h"
#include "../fonts/fonts.h"
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
void setNightMode(bool night);
extern lv_obj_t* ui_Screen1;
extern lv_obj_t* ui_TabView1;
extern lv_obj_t* ui_TabPageContacts;
extern lv_obj_t* ui_Contacts;
extern lv_obj_t* ui_ContactMessages;
extern lv_obj_t* ui_TabPageChannels;
extern lv_obj_t* ui_Channels;
extern lv_obj_t* ui_ChannelMessages;
extern lv_obj_t* ui_TabPageSettings;
void ui_event_AutoLight(lv_event_t * e);
extern lv_obj_t* ui_AutoLight;
extern lv_obj_t* ui____initial_actions0;
extern lv_obj_t* ui_DimOverlay;
extern lv_obj_t* ui_TabPageHome;
extern lv_obj_t* ui_ValueDate;
extern lv_obj_t* ui_ValueTime;
extern lv_obj_t* ui_TabPageSettings;
extern lv_obj_t* ui_DayLight;
extern lv_obj_t* ui_ChannelMessages;
extern lv_obj_t* ui_ChannelInput;
extern lv_obj_t* ui_SendBtn;
extern lv_obj_t* ui_Keyboard;
extern lv_obj_t* iu_SendLabel;
extern lv_obj_t* ui_ChannelDivider;
extern void onDayLightPressed(bool pressed);
void ui_init(void);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

341
src/UI/ui_Screen1.c

@ -1,341 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"
static int channelInputBaseY = 185;
static int channelInputBaseKeybOnY = 0;
void onShowKeyboard() {
lv_obj_clear_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
//lv_obj_set_style_bg_opa(ui_DimOverlay, 160, 0);
lv_obj_add_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_set_y(ui_ChannelInput, channelInputBaseKeybOnY);
lv_obj_set_y(ui_SendBtn, channelInputBaseKeybOnY);
}
void onHideKeyboard() {
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
//lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_set_y(ui_ChannelInput, channelInputBaseY);
lv_obj_set_y(ui_SendBtn, channelInputBaseY);
}
void onChannelInputFocus(lv_event_t* e)
{
lv_obj_t* ta = lv_event_get_target(e);
if(!ui_Keyboard || !ta) return;
lv_keyboard_set_textarea(ui_Keyboard, ta);
onShowKeyboard();
}
void onDimOverlayClick(lv_event_t* e)
{
onHideKeyboard();
}
void onSendClick(lv_event_t* e)
{
char fullMessage[260];
onHideKeyboard();
const char* msg = lv_textarea_get_text(ui_ChannelInput);
if(msg == NULL || strlen(msg) == 0) return;
lv_textarea_set_text(ui_ChannelInput, "");
sprintf(fullMessage, "public %s", msg);
//handleCommand(fullMessage);
}
void onKeyboardEvent(lv_event_t* e)
{
lv_event_code_t code = lv_event_get_code(e);
if(code == LV_EVENT_READY || code == LV_EVENT_CANCEL)
{
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
// Restore UI
lv_obj_set_y(ui_ChannelInput, channelInputBaseY);
lv_obj_set_y(ui_SendBtn, channelInputBaseY);
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
}
}
static void scroll_begin_event(lv_event_t* e)
{
/*Disable the scroll animations. Triggered when a tab button is clicked */
if (lv_event_get_code(e) == LV_EVENT_SCROLL_BEGIN) {
lv_anim_t* a = (lv_anim_t*)lv_event_get_param(e);
if (a) a->time = 0;
}
}
void event_handler(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * target = lv_event_get_target(e);
if(code == LV_EVENT_VALUE_CHANGED) {
if (target == ui_DayLight) {
onDayLightPressed(lv_obj_get_state(target) & LV_STATE_CHECKED);
}
}
}
void ui_Screen1_screen_init(void)
{
ui_Screen1 = lv_obj_create(NULL);
lv_obj_clear_flag(ui_Screen1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_Screen1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_Screen1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_TabView1 = lv_tabview_create(ui_Screen1, LV_DIR_TOP, 50);
lv_obj_add_event_cb(lv_tabview_get_content(ui_TabView1), scroll_begin_event,LV_EVENT_SCROLL_BEGIN, NULL);
lv_obj_clear_flag(lv_tabview_get_content(ui_TabView1), LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_width(ui_TabView1, 800);
lv_obj_set_height(ui_TabView1, 480);
lv_obj_set_align(ui_TabView1, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_TabView1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_TabView1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_TabView1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0x424242),
LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0xFFFFFF),
LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(lv_tabview_get_tab_btns(ui_TabView1), &lv_font_arial_18,
LV_PART_ITEMS | LV_STATE_DEFAULT);
#if defined(LANG_EN)
ui_TabPageHome = lv_tabview_add_tab(ui_TabView1, "Home");
#elif defined(LANG_GR)
ui_TabPageHome = lv_tabview_add_tab(ui_TabView1, "Αρχική");
#endif
ui_ValueDate = lv_label_create(ui_TabPageHome);
lv_obj_set_width(ui_ValueDate, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_ValueDate, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_ValueDate, 0);
lv_obj_set_y(ui_ValueDate, -165);
lv_obj_set_align(ui_ValueDate, LV_ALIGN_CENTER);
lv_label_set_text(ui_ValueDate, "--- --/--/----");
lv_obj_set_style_text_color(ui_ValueDate, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_ValueDate, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_ValueDate, &lv_font_arial_40, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_ValueTime = lv_label_create(ui_TabPageHome);
lv_obj_set_width(ui_ValueTime, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_ValueTime, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_ValueTime, 0);
lv_obj_set_y(ui_ValueTime, -100);
lv_obj_set_align(ui_ValueTime, LV_ALIGN_CENTER);
lv_label_set_text(ui_ValueTime, "--:--");
lv_obj_set_style_text_color(ui_ValueTime, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_ValueTime, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_ValueTime, &lv_font_arial_48, LV_PART_MAIN | LV_STATE_DEFAULT);
#if defined(LANG_EN)
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Contacts");
#elif defined(LANG_GR)
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Επαφές");
#endif
// Prevent scrolling
lv_obj_set_scrollbar_mode(ui_TabPageContacts, LV_SCROLLBAR_MODE_OFF);
lv_obj_clear_flag(ui_TabPageContacts, LV_OBJ_FLAG_SCROLLABLE);
ui_Contacts = lv_list_create(ui_TabPageContacts);
//lv_list_set_options(ui_Contacts, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_Contacts, 250);
lv_obj_set_height(ui_Contacts, 400);
lv_obj_set_x(ui_Contacts, -274);
lv_obj_set_y(ui_Contacts, 0);
lv_obj_set_align(ui_Contacts, LV_ALIGN_CENTER);
lv_obj_set_style_bg_opa(ui_Contacts, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_Contacts, 0, 0);
lv_obj_set_style_outline_width(ui_Contacts, 0, 0);
lv_obj_set_style_shadow_width(ui_Contacts, 0, 0);
//lv_obj_set_scrollbar_mode(ui_Contacts, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_Contacts, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_Contacts, 0, LV_PART_ITEMS);
ui_ContactMessages = lv_list_create(ui_TabPageContacts);
//lv_list_set_options(ui_ContactMessages, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_ContactMessages, 500);
lv_obj_set_height(ui_ContactMessages, 400);
lv_obj_set_x(ui_ContactMessages, 124);
lv_obj_set_y(ui_ContactMessages, 0);
lv_obj_set_align(ui_ContactMessages, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ContactMessages, lv_color_hex(0), 0);
lv_obj_set_style_bg_opa(ui_ContactMessages, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_ContactMessages, 0, 0);
lv_obj_set_style_outline_width(ui_ContactMessages, 0, 0);
lv_obj_set_style_shadow_width(ui_ContactMessages, 0, 0);
//lv_obj_set_scrollbar_mode(ui_ContactMessages, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_ContactMessages, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_ContactMessages, 0, LV_PART_ITEMS);
lv_obj_t *divider = lv_obj_create(ui_TabPageContacts);
lv_obj_set_size(divider, 2, 400);
lv_obj_set_pos(divider, 222, 0); // align between lists
lv_obj_set_style_bg_color(divider, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(divider, 0, 0);
lv_obj_set_style_radius(divider, 0, 0);
#if defined(LANG_EN)
ui_TabPageChannels = lv_tabview_add_tab(ui_TabView1, "Channels");
#elif defined(LANG_GR)
ui_TabPageChannels = lv_tabview_add_tab(ui_TabView1, "Κανάλια");
#endif
lv_obj_set_scrollbar_mode(ui_TabPageChannels, LV_SCROLLBAR_MODE_OFF);
lv_obj_clear_flag(ui_TabPageChannels, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_bg_color(ui_TabPageChannels, lv_color_hex(0x000000), 0);
ui_Channels = lv_dropdown_create(ui_TabPageChannels);
lv_dropdown_set_options(ui_Channels, "Public");
lv_obj_set_width(ui_Channels, 291);
lv_obj_set_height(ui_Channels, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_Channels, -243);
lv_obj_set_y(ui_Channels, -182);
lv_obj_set_align(ui_Channels, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_Channels, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
ui_ChannelMessages = lv_list_create(ui_TabPageChannels);
//lv_list_set_options(ui_ChannelMessages, "Contact", LV_list_MODE_NORMAL);
lv_obj_set_width(ui_ChannelMessages, 780);
lv_obj_set_height(ui_ChannelMessages, 260);
lv_obj_set_x(ui_ChannelMessages, 0);
lv_obj_set_y(ui_ChannelMessages, -40);
lv_obj_set_align(ui_ChannelMessages, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ChannelMessages, lv_color_hex(0), 0);
lv_obj_set_style_bg_opa(ui_ChannelMessages, LV_OPA_TRANSP, 0);
lv_obj_set_style_border_width(ui_ChannelMessages, 0, 0);
lv_obj_set_style_outline_width(ui_ChannelMessages, 0, 0);
lv_obj_set_style_shadow_width(ui_ChannelMessages, 0, 0);
//lv_obj_set_scrollbar_mode(ui_ChannelMessages, LV_SCROLLBAR_MODE_OFF);
lv_obj_set_style_bg_opa(ui_ChannelMessages, LV_OPA_TRANSP, LV_PART_ITEMS);
lv_obj_set_style_border_width(ui_ChannelMessages, 0, LV_PART_ITEMS);
ui_ChannelDivider = lv_obj_create(ui_TabPageChannels);
lv_obj_set_size(ui_ChannelDivider, 780, 1);
lv_obj_set_pos(ui_ChannelDivider, 0, 150);
lv_obj_set_align(ui_ChannelDivider, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(ui_ChannelDivider, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(ui_ChannelDivider, 0, 0);
#if defined(LANG_EN)
ui_TabPageSettings = lv_tabview_add_tab(ui_TabView1, "Settings");
#elif defined(LANG_GR)
ui_TabPageSettings = lv_tabview_add_tab(ui_TabView1, "Ρυθμίσεις");
#endif
ui_DayLight = lv_checkbox_create(ui_TabPageSettings);
#if defined(LANG_EN)
lv_checkbox_set_text(ui_DayLight, "Day light (summer time)");
#elif defined(LANG_GR)
lv_checkbox_set_text(ui_DayLight, "Θερινή ώρα");
#endif
lv_obj_set_style_text_font(ui_DayLight, &lv_font_arial_20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_width(ui_DayLight, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_DayLight, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_DayLight, -257);
lv_obj_set_y(ui_DayLight, -168);
lv_obj_set_align(ui_DayLight, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_DayLight, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
lv_obj_set_style_text_color(ui_DayLight, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_DayLight, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_event_cb(ui_DayLight, event_handler, LV_EVENT_ALL, NULL);
lv_obj_add_state(ui_DayLight, LV_STATE_DEFAULT);
ui_DimOverlay = lv_obj_create(ui_Screen1);
lv_obj_remove_style_all(ui_DimOverlay); // no border/padding
lv_obj_set_size(ui_DimOverlay, LV_PCT(100), LV_PCT(100));
lv_obj_set_align(ui_DimOverlay, LV_ALIGN_CENTER);
lv_obj_add_event_cb(ui_DimOverlay, onDimOverlayClick, LV_EVENT_CLICKED, NULL);
// black semi transparent background
lv_obj_set_style_bg_color(ui_DimOverlay, lv_color_hex(0x000000), 0);
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0); // initially "off"
//Edit text
ui_ChannelInput = lv_textarea_create(ui_TabPageChannels);
lv_obj_set_size(ui_ChannelInput, 670, 40);
lv_obj_set_pos(ui_ChannelInput, -50, channelInputBaseY);
lv_obj_set_align(ui_ChannelInput, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_ChannelInput, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_flag(ui_ChannelInput, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
#if defined(LANG_EN)
lv_textarea_set_placeholder_text(ui_ChannelInput, "Write message...");
#elif defined(LANG_GR)
lv_textarea_set_placeholder_text(ui_ChannelInput, "Γράψε μήνυμα...");
#endif
lv_textarea_set_one_line(ui_ChannelInput, true);
lv_obj_set_style_text_font(ui_ChannelInput, &lv_font_arial_20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_ChannelInput, lv_color_hex(0x111111), 0);
lv_obj_set_style_text_color(ui_ChannelInput, lv_color_white(), 0);
lv_obj_set_style_border_color(ui_ChannelInput, lv_color_hex(0x444444), 0);
lv_obj_set_style_border_width(ui_ChannelInput, 1, 0);
lv_obj_set_style_radius(ui_ChannelInput, 6, 0);
lv_obj_add_event_cb(ui_ChannelInput, onChannelInputFocus, LV_EVENT_CLICKED, NULL);
// Send button
ui_SendBtn = lv_btn_create(ui_TabPageChannels);
lv_obj_set_size(ui_SendBtn, 90, 42);
lv_obj_set_pos(ui_SendBtn, 350, channelInputBaseY);
lv_obj_set_align(ui_SendBtn, LV_ALIGN_CENTER);
lv_obj_set_style_text_font(ui_SendBtn, &lv_font_arial_20, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_SendBtn, lv_color_hex(0x3A7AFE), 0);
lv_obj_add_event_cb(ui_SendBtn, onSendClick, LV_EVENT_CLICKED, NULL);
iu_SendLabel = lv_label_create(ui_SendBtn);
#if defined(LANG_EN)
lv_label_set_text(sendLabel, "Send");
#elif defined(LANG_GR)
lv_label_set_text(iu_SendLabel, "Αποστολή");
#endif
lv_obj_center(iu_SendLabel);
// Keyboard
ui_Keyboard = lv_keyboard_create(lv_layer_top());
lv_obj_set_size(ui_Keyboard, 800, 200);
lv_obj_set_align(ui_Keyboard, LV_ALIGN_BOTTOM_MID);
lv_obj_add_flag(ui_Keyboard, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_event_cb(ui_Keyboard, onKeyboardEvent, LV_EVENT_ALL, NULL);
// Do not block touch/scroll
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_CLICKABLE);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLL_CHAIN_HOR);
lv_obj_clear_flag(ui_DimOverlay, LV_OBJ_FLAG_SCROLL_CHAIN_VER);
// always in front
lv_obj_move_foreground(ui_DimOverlay);
}
void setNightMode(bool night) {
if (!ui_DimOverlay) return;
if (night) {
lv_obj_set_style_bg_opa(ui_DimOverlay, 192, 0); // 75% dark
} else {
lv_obj_set_style_bg_opa(ui_DimOverlay, 0, 0); // none
}
}

5
src/UI/ui_comp_hook.c

@ -1,5 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project

7
src/UI/ui_events.cpp

@ -1,7 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"

17
src/UI/ui_events.h

@ -1,17 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _UI_EVENTS_H
#define _UI_EVENTS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

347
src/UI/ui_helpers.c

@ -1,347 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui_helpers.h"
void _ui_bar_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON);
if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF);
}
void _ui_basic_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val);
if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val);
if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val);
if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val);
}
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val);
}
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val)
{
if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val);
}
void _ui_label_set_property(lv_obj_t * target, int id, const char * val)
{
if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val);
}
void _ui_roller_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON);
if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF);
}
void _ui_slider_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON);
if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF);
}
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void))
{
if(*target == NULL)
target_init();
lv_scr_load_anim(*target, fademode, spd, delay, false);
}
void _ui_screen_delete(lv_obj_t ** target)
{
if(*target == NULL) {
lv_obj_del(*target);
target = NULL;
}
}
void _ui_arc_increment(lv_obj_t * target, int val)
{
int old = lv_arc_get_value(target);
lv_arc_set_value(target, old + val);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_bar_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_bar_get_value(target);
lv_bar_set_value(target, old + val, anm);
}
void _ui_slider_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_slider_get_value(target);
lv_slider_set_value(target, old + val, anm);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea)
{
lv_keyboard_set_textarea(keyboard, textarea);
}
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value)
{
if(value == _UI_MODIFY_FLAG_TOGGLE) {
if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag);
else lv_obj_add_flag(target, flag);
}
else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag);
else lv_obj_clear_flag(target, flag);
}
void _ui_state_modify(lv_obj_t * target, int32_t state, int value)
{
if(value == _UI_MODIFY_STATE_TOGGLE) {
if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state);
else lv_obj_add_state(target, state);
}
else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state);
else lv_obj_clear_state(target, state);
}
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
{
if(val == UI_MOVE_CURSOR_UP) lv_textarea_cursor_up(target);
if(val == UI_MOVE_CURSOR_RIGHT) lv_textarea_cursor_right(target);
if(val == UI_MOVE_CURSOR_DOWN) lv_textarea_cursor_down(target);
if(val == UI_MOVE_CURSOR_LEFT) lv_textarea_cursor_left(target);
lv_obj_add_state(target, LV_STATE_FOCUSED);
}
void scr_unloaded_delete_cb(lv_event_t * e)
{
lv_obj_t ** var = lv_event_get_user_data(e);
lv_obj_del(*var);
(*var) = NULL;
}
void _ui_opacity_set(lv_obj_t * target, int val)
{
lv_obj_set_style_opa(target, val, 0);
}
void _ui_anim_callback_free_user_data(lv_anim_t * a)
{
lv_mem_free(a->user_data);
a->user_data = NULL;
}
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_x(usr->target, v);
}
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_y(usr->target, v);
}
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_width(usr->target, v);
}
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_height(usr->target, v);
}
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_style_opa(usr->target, v, 0);
}
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_zoom(usr->target, v);
}
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_angle(usr->target, v);
}
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
usr->val = v;
if(v < 0) v = 0;
if(v >= usr->imgset_size) v = usr->imgset_size - 1;
lv_img_set_src(usr->target, usr->imgset[v]);
}
int32_t _ui_anim_callback_get_x(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_x_aligned(usr->target);
}
int32_t _ui_anim_callback_get_y(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_y_aligned(usr->target);
}
int32_t _ui_anim_callback_get_width(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_width(usr->target);
}
int32_t _ui_anim_callback_get_height(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_height(usr->target);
}
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_style_opa(usr->target, 0);
}
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_zoom(usr->target);
}
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_angle(usr->target);
}
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return usr->val;
}
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off)
{
if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on);
else lv_label_set_text(trg, txt_off);
}
void _ui_spinbox_step(lv_obj_t * target, int val)
{
if(val > 0) lv_spinbox_increment(target);
else lv_spinbox_decrement(target);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_switch_theme(int val)
{
#ifdef UI_THEME_ACTIVE
ui_theme_set(val);
#endif
}

148
src/UI/ui_helpers.h

@ -1,148 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _SQUARELINE_PROJECT_UI_HELPERS_H
#define _SQUARELINE_PROJECT_UI_HELPERS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "ui.h"
#define _UI_TEMPORARY_STRING_BUFFER_SIZE 32
#define _UI_BAR_PROPERTY_VALUE 0
#define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1
void _ui_bar_set_property(lv_obj_t * target, int id, int val);
#define _UI_BASIC_PROPERTY_POSITION_X 0
#define _UI_BASIC_PROPERTY_POSITION_Y 1
#define _UI_BASIC_PROPERTY_WIDTH 2
#define _UI_BASIC_PROPERTY_HEIGHT 3
void _ui_basic_set_property(lv_obj_t * target, int id, int val);
#define _UI_DROPDOWN_PROPERTY_SELECTED 0
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val);
#define _UI_IMAGE_PROPERTY_IMAGE 0
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val);
#define _UI_LABEL_PROPERTY_TEXT 0
void _ui_label_set_property(lv_obj_t * target, int id, const char * val);
#define _UI_ROLLER_PROPERTY_SELECTED 0
#define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1
void _ui_roller_set_property(lv_obj_t * target, int id, int val);
#define _UI_SLIDER_PROPERTY_VALUE 0
#define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1
void _ui_slider_set_property(lv_obj_t * target, int id, int val);
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void));
void _ui_screen_delete(lv_obj_t ** target);
void _ui_arc_increment(lv_obj_t * target, int val);
void _ui_bar_increment(lv_obj_t * target, int val, int anm);
void _ui_slider_increment(lv_obj_t * target, int val, int anm);
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea);
#define _UI_MODIFY_FLAG_ADD 0
#define _UI_MODIFY_FLAG_REMOVE 1
#define _UI_MODIFY_FLAG_TOGGLE 2
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value);
#define _UI_MODIFY_STATE_ADD 0
#define _UI_MODIFY_STATE_REMOVE 1
#define _UI_MODIFY_STATE_TOGGLE 2
void _ui_state_modify(lv_obj_t * target, int32_t state, int value);
#define UI_MOVE_CURSOR_UP 0
#define UI_MOVE_CURSOR_RIGHT 1
#define UI_MOVE_CURSOR_DOWN 2
#define UI_MOVE_CURSOR_LEFT 3
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
;
void scr_unloaded_delete_cb(lv_event_t * e);
void _ui_opacity_set(lv_obj_t * target, int val);
/** Describes an animation*/
typedef struct _ui_anim_user_data_t {
lv_obj_t * target;
lv_img_dsc_t ** imgset;
int32_t imgset_size;
int32_t val;
} ui_anim_user_data_t;
void _ui_anim_callback_free_user_data(lv_anim_t * a);
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v);
int32_t _ui_anim_callback_get_x(lv_anim_t * a);
int32_t _ui_anim_callback_get_y(lv_anim_t * a);
int32_t _ui_anim_callback_get_width(lv_anim_t * a);
int32_t _ui_anim_callback_get_height(lv_anim_t * a);
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a);
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off);
void _ui_spinbox_step(lv_obj_t * target, int val)
;
void _ui_switch_theme(int val)
;
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

42
src/UI_design/SquareLine_Project.sll

File diff suppressed because one or more lines are too long

9258
src/UI_design/SquareLine_Project.spj

File diff suppressed because it is too large

4
src/UI_design/SquareLine_Project_events.py

@ -1,4 +0,0 @@
def onDayLightPressed(event_struct):
return

8
src/UI_design/Themes.slt

@ -1,8 +0,0 @@
{
"deftheme": {
"name": "Default",
"properties": []
},
"themes": [],
"selected_theme": "Default"
}

BIN
src/UI_design/autosave/SquareLine_Project_autosave00.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave01.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave02.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave03.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave04.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave05.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave06.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave07.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave08.zip

Binary file not shown.

BIN
src/UI_design/autosave/SquareLine_Project_autosave09.zip

Binary file not shown.

BIN
src/UI_design/backup/SquareLine_Project_backup01.zip

Binary file not shown.

7
src/UI_design/export/CMakeLists.txt

@ -1,7 +0,0 @@
SET(SOURCES ui_Screen1.c
ui.c
ui_comp_hook.c
ui_helpers.c
ui_events.cpp)
add_library(ui ${SOURCES})

5
src/UI_design/export/filelist.txt

@ -1,5 +0,0 @@
ui_Screen1.c
ui.c
ui_comp_hook.c
ui_helpers.c
ui_events.cpp

58
src/UI_design/export/ui.c

@ -1,58 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"
#include "ui_helpers.h"
///////////////////// VARIABLES ////////////////////
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
lv_obj_t * ui_Screen1;
lv_obj_t * ui_TabView1;
lv_obj_t * ui_TabPageContacts;
lv_obj_t * ui_Contacts;
lv_obj_t * ui_ContactMessages;
lv_obj_t * ui_TabPageChannels;
lv_obj_t * ui_Channels;
lv_obj_t * ui_ChannelMessages;
lv_obj_t * ui_TabPageSettings;
void ui_event_AutoLight(lv_event_t * e);
lv_obj_t * ui_AutoLight;
lv_obj_t * ui____initial_actions0;
///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
#endif
#if LV_COLOR_16_SWAP !=0
#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings"
#endif
///////////////////// ANIMATIONS ////////////////////
///////////////////// FUNCTIONS ////////////////////
void ui_event_AutoLight(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
lv_obj_t * target = lv_event_get_target(e);
if(event_code == LV_EVENT_CLICKED) {
onDayLightPressed(e);
}
}
///////////////////// SCREENS ////////////////////
void ui_init(void)
{
lv_disp_t * dispp = lv_disp_get_default();
lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
false, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme);
ui_Screen1_screen_init();
ui____initial_actions0 = lv_obj_create(NULL);
lv_disp_load_scr(ui_Screen1);
}

56
src/UI_design/export/ui.h

@ -1,56 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _SQUARELINE_PROJECT_UI_H
#define _SQUARELINE_PROJECT_UI_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined __has_include
#if __has_include("lvgl.h")
#include "lvgl.h"
#elif __has_include("lvgl/lvgl.h")
#include "lvgl/lvgl.h"
#else
#include "lvgl.h"
#endif
#else
#include "lvgl.h"
#endif
#include "ui_helpers.h"
#include "ui_events.h"
// SCREEN: ui_Screen1
void ui_Screen1_screen_init(void);
extern lv_obj_t * ui_Screen1;
extern lv_obj_t * ui_TabView1;
extern lv_obj_t * ui_TabPageContacts;
extern lv_obj_t * ui_Contacts;
extern lv_obj_t * ui_ContactMessages;
extern lv_obj_t * ui_TabPageChannels;
extern lv_obj_t * ui_Channels;
extern lv_obj_t * ui_ChannelMessages;
extern lv_obj_t * ui_TabPageSettings;
void ui_event_AutoLight(lv_event_t * e);
extern lv_obj_t * ui_AutoLight;
extern lv_obj_t * ui____initial_actions0;
void ui_init(void);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

87
src/UI_design/export/ui_Screen1.c

@ -1,87 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"
void ui_Screen1_screen_init(void)
{
ui_Screen1 = lv_obj_create(NULL);
lv_obj_clear_flag(ui_Screen1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_Screen1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_Screen1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_TabView1 = lv_tabview_create(ui_Screen1, LV_DIR_TOP, 50);
lv_obj_set_width(ui_TabView1, 800);
lv_obj_set_height(ui_TabView1, 480);
lv_obj_set_align(ui_TabView1, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_TabView1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_bg_color(ui_TabView1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_TabView1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0x424242),
LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(lv_tabview_get_tab_btns(ui_TabView1), lv_color_hex(0xFFFFFF),
LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(lv_tabview_get_tab_btns(ui_TabView1), 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(lv_tabview_get_tab_btns(ui_TabView1), &lv_font_montserrat_18,
LV_PART_ITEMS | LV_STATE_DEFAULT);
ui_TabPageContacts = lv_tabview_add_tab(ui_TabView1, "Contacts");
ui_Contacts = lv_roller_create(ui_TabPageContacts);
lv_roller_set_options(ui_Contacts, "Contact", LV_ROLLER_MODE_NORMAL);
lv_obj_set_width(ui_Contacts, 246);
lv_obj_set_height(ui_Contacts, 400);
lv_obj_set_x(ui_Contacts, -262);
lv_obj_set_y(ui_Contacts, 0);
lv_obj_set_align(ui_Contacts, LV_ALIGN_CENTER);
ui_ContactMessages = lv_roller_create(ui_TabPageContacts);
lv_roller_set_options(ui_ContactMessages, "Contact", LV_ROLLER_MODE_NORMAL);
lv_obj_set_width(ui_ContactMessages, 500);
lv_obj_set_height(ui_ContactMessages, 400);
lv_obj_set_x(ui_ContactMessages, 124);
lv_obj_set_y(ui_ContactMessages, 0);
lv_obj_set_align(ui_ContactMessages, LV_ALIGN_CENTER);
ui_TabPageChannels = lv_tabview_add_tab(ui_TabView1, "Channels");
ui_Channels = lv_dropdown_create(ui_TabPageChannels);
lv_dropdown_set_options(ui_Channels, "Public");
lv_obj_set_width(ui_Channels, 291);
lv_obj_set_height(ui_Channels, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_Channels, -243);
lv_obj_set_y(ui_Channels, -182);
lv_obj_set_align(ui_Channels, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_Channels, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
ui_ChannelMessages = lv_roller_create(ui_TabPageChannels);
lv_roller_set_options(ui_ChannelMessages, "Contact", LV_ROLLER_MODE_NORMAL);
lv_obj_set_width(ui_ChannelMessages, 780);
lv_obj_set_height(ui_ChannelMessages, 342);
lv_obj_set_x(ui_ChannelMessages, 0);
lv_obj_set_y(ui_ChannelMessages, 30);
lv_obj_set_align(ui_ChannelMessages, LV_ALIGN_CENTER);
ui_TabPageSettings = lv_tabview_add_tab(ui_TabView1, "Settings");
ui_AutoLight = lv_checkbox_create(ui_TabPageSettings);
lv_checkbox_set_text(ui_AutoLight, "Auto dim brightness");
lv_obj_set_width(ui_AutoLight, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_AutoLight, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_AutoLight, -257);
lv_obj_set_y(ui_AutoLight, -168);
lv_obj_set_align(ui_AutoLight, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_AutoLight, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
lv_obj_set_style_text_color(ui_AutoLight, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_AutoLight, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_event_cb(ui_AutoLight, ui_event_AutoLight, LV_EVENT_ALL, NULL);
}

5
src/UI_design/export/ui_comp_hook.c

@ -1,5 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project

11
src/UI_design/export/ui_events.cpp

@ -1,11 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui.h"
void onDayLightPressed(lv_event_t * e)
{
// Your code here
}

19
src/UI_design/export/ui_events.h

@ -1,19 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _UI_EVENTS_H
#define _UI_EVENTS_H
#ifdef __cplusplus
extern "C" {
#endif
void onDayLightPressed(lv_event_t * e);
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif

347
src/UI_design/export/ui_helpers.c

@ -1,347 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#include "ui_helpers.h"
void _ui_bar_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON);
if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF);
}
void _ui_basic_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val);
if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val);
if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val);
if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val);
}
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val);
}
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val)
{
if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val);
}
void _ui_label_set_property(lv_obj_t * target, int id, const char * val)
{
if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val);
}
void _ui_roller_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON);
if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF);
}
void _ui_slider_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON);
if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF);
}
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void))
{
if(*target == NULL)
target_init();
lv_scr_load_anim(*target, fademode, spd, delay, false);
}
void _ui_screen_delete(lv_obj_t ** target)
{
if(*target == NULL) {
lv_obj_del(*target);
target = NULL;
}
}
void _ui_arc_increment(lv_obj_t * target, int val)
{
int old = lv_arc_get_value(target);
lv_arc_set_value(target, old + val);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_bar_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_bar_get_value(target);
lv_bar_set_value(target, old + val, anm);
}
void _ui_slider_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_slider_get_value(target);
lv_slider_set_value(target, old + val, anm);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea)
{
lv_keyboard_set_textarea(keyboard, textarea);
}
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value)
{
if(value == _UI_MODIFY_FLAG_TOGGLE) {
if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag);
else lv_obj_add_flag(target, flag);
}
else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag);
else lv_obj_clear_flag(target, flag);
}
void _ui_state_modify(lv_obj_t * target, int32_t state, int value)
{
if(value == _UI_MODIFY_STATE_TOGGLE) {
if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state);
else lv_obj_add_state(target, state);
}
else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state);
else lv_obj_clear_state(target, state);
}
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
{
if(val == UI_MOVE_CURSOR_UP) lv_textarea_cursor_up(target);
if(val == UI_MOVE_CURSOR_RIGHT) lv_textarea_cursor_right(target);
if(val == UI_MOVE_CURSOR_DOWN) lv_textarea_cursor_down(target);
if(val == UI_MOVE_CURSOR_LEFT) lv_textarea_cursor_left(target);
lv_obj_add_state(target, LV_STATE_FOCUSED);
}
void scr_unloaded_delete_cb(lv_event_t * e)
{
lv_obj_t ** var = lv_event_get_user_data(e);
lv_obj_del(*var);
(*var) = NULL;
}
void _ui_opacity_set(lv_obj_t * target, int val)
{
lv_obj_set_style_opa(target, val, 0);
}
void _ui_anim_callback_free_user_data(lv_anim_t * a)
{
lv_mem_free(a->user_data);
a->user_data = NULL;
}
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_x(usr->target, v);
}
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_y(usr->target, v);
}
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_width(usr->target, v);
}
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_height(usr->target, v);
}
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_style_opa(usr->target, v, 0);
}
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_zoom(usr->target, v);
}
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_angle(usr->target, v);
}
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
usr->val = v;
if(v < 0) v = 0;
if(v >= usr->imgset_size) v = usr->imgset_size - 1;
lv_img_set_src(usr->target, usr->imgset[v]);
}
int32_t _ui_anim_callback_get_x(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_x_aligned(usr->target);
}
int32_t _ui_anim_callback_get_y(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_y_aligned(usr->target);
}
int32_t _ui_anim_callback_get_width(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_width(usr->target);
}
int32_t _ui_anim_callback_get_height(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_height(usr->target);
}
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_style_opa(usr->target, 0);
}
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_zoom(usr->target);
}
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_angle(usr->target);
}
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return usr->val;
}
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off)
{
if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on);
else lv_label_set_text(trg, txt_off);
}
void _ui_spinbox_step(lv_obj_t * target, int val)
{
if(val > 0) lv_spinbox_increment(target);
else lv_spinbox_decrement(target);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_switch_theme(int val)
{
#ifdef UI_THEME_ACTIVE
ui_theme_set(val);
#endif
}

148
src/UI_design/export/ui_helpers.h

@ -1,148 +0,0 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.1
// LVGL version: 8.3.11
// Project name: SquareLine_Project
#ifndef _SQUARELINE_PROJECT_UI_HELPERS_H
#define _SQUARELINE_PROJECT_UI_HELPERS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "ui.h"
#define _UI_TEMPORARY_STRING_BUFFER_SIZE 32
#define _UI_BAR_PROPERTY_VALUE 0
#define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1
void _ui_bar_set_property(lv_obj_t * target, int id, int val);
#define _UI_BASIC_PROPERTY_POSITION_X 0
#define _UI_BASIC_PROPERTY_POSITION_Y 1
#define _UI_BASIC_PROPERTY_WIDTH 2
#define _UI_BASIC_PROPERTY_HEIGHT 3
void _ui_basic_set_property(lv_obj_t * target, int id, int val);
#define _UI_DROPDOWN_PROPERTY_SELECTED 0
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val);
#define _UI_IMAGE_PROPERTY_IMAGE 0
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val);
#define _UI_LABEL_PROPERTY_TEXT 0
void _ui_label_set_property(lv_obj_t * target, int id, const char * val);
#define _UI_ROLLER_PROPERTY_SELECTED 0
#define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1
void _ui_roller_set_property(lv_obj_t * target, int id, int val);
#define _UI_SLIDER_PROPERTY_VALUE 0
#define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1
void _ui_slider_set_property(lv_obj_t * target, int id, int val);
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void));
void _ui_screen_delete(lv_obj_t ** target);
void _ui_arc_increment(lv_obj_t * target, int val);
void _ui_bar_increment(lv_obj_t * target, int val, int anm);
void _ui_slider_increment(lv_obj_t * target, int val, int anm);
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea);
#define _UI_MODIFY_FLAG_ADD 0
#define _UI_MODIFY_FLAG_REMOVE 1
#define _UI_MODIFY_FLAG_TOGGLE 2
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value);
#define _UI_MODIFY_STATE_ADD 0
#define _UI_MODIFY_STATE_REMOVE 1
#define _UI_MODIFY_STATE_TOGGLE 2
void _ui_state_modify(lv_obj_t * target, int32_t state, int value);
#define UI_MOVE_CURSOR_UP 0
#define UI_MOVE_CURSOR_RIGHT 1
#define UI_MOVE_CURSOR_DOWN 2
#define UI_MOVE_CURSOR_LEFT 3
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
;
void scr_unloaded_delete_cb(lv_event_t * e);
void _ui_opacity_set(lv_obj_t * target, int val);
/** Describes an animation*/
typedef struct _ui_anim_user_data_t {
lv_obj_t * target;
lv_img_dsc_t ** imgset;
int32_t imgset_size;
int32_t val;
} ui_anim_user_data_t;
void _ui_anim_callback_free_user_data(lv_anim_t * a);
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v);
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v);
int32_t _ui_anim_callback_get_x(lv_anim_t * a);
int32_t _ui_anim_callback_get_y(lv_anim_t * a);
int32_t _ui_anim_callback_get_width(lv_anim_t * a);
int32_t _ui_anim_callback_get_height(lv_anim_t * a);
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a);
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a);
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off);
void _ui_spinbox_step(lv_obj_t * target, int val)
;
void _ui_switch_theme(int val)
;
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif
Loading…
Cancel
Save