I’ll share the overlay u see on screenshot nr1. The loading screen code is at the top.
void ui_overlay_init(uint8_t * ssid){
ui_Overlay = lv_obj_create(ui_Network_Selection);
lv_obj_set_size(ui_Overlay, LV_HOR_RES, LV_VER_RES);
lv_obj_align(ui_Overlay, LV_ALIGN_CENTER, 0, 0);
lv_obj_clear_flag(ui_Overlay, LV_OBJ_FLAG_SCROLLABLE);
ui_overlay_update_position();
ui_overlay_content((const char *) ssid);
}
and this is the content inside the overlay
void ui_overlay_content(const char * ssid) {
ui_Network_Selection_ssid_label = lv_label_create(ui_Overlay);
lv_obj_set_width(ui_Network_Selection_ssid_label, LV_SIZE_CONTENT);
lv_obj_set_height(ui_Network_Selection_ssid_label, LV_SIZE_CONTENT);
lv_obj_align(ui_Network_Selection_ssid_label, LV_ALIGN_TOP_MID, 0, 75);
lv_label_set_text(ui_Network_Selection_ssid_label, ssid);
lv_obj_set_style_text_opa(ui_Network_Selection_ssid_label, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_Network_Selection_ssid_label, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_Network_Selection_Connect = lv_btn_create(ui_Overlay);
lv_obj_set_width(ui_Network_Selection_Connect, 140);
lv_obj_set_height(ui_Network_Selection_Connect, 39);
lv_obj_align(ui_Network_Selection_Connect, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_flag(ui_Network_Selection_Connect, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
lv_obj_clear_flag(ui_Network_Selection_Connect, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_text_color(ui_Network_Selection_Connect, lv_color_hex(0xFFF9F9), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_Network_Selection_Connect, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_Network_Selection_ConnectLabel = lv_label_create(ui_Network_Selection_Connect);
lv_obj_set_width(ui_Network_Selection_ConnectLabel, LV_SIZE_CONTENT);
lv_obj_set_height(ui_Network_Selection_ConnectLabel, LV_SIZE_CONTENT);
lv_obj_align(ui_Network_Selection_ConnectLabel, LV_ALIGN_CENTER, 0, 0);
lv_label_set_text(ui_Network_Selection_ConnectLabel, "Connect");
lv_obj_set_style_text_color(ui_Network_Selection_ConnectLabel, lv_color_hex(0xFCFCFC), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_Network_Selection_ConnectLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_Network_Selection_ConnectLabel, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_Network_Selection_PasswordInput = lv_textarea_create(ui_Overlay);
lv_obj_set_width(ui_Network_Selection_PasswordInput, 150);
lv_obj_set_height(ui_Network_Selection_PasswordInput, 40);
lv_obj_align(ui_Network_Selection_PasswordInput, LV_ALIGN_CENTER, 0, -50);
lv_textarea_set_placeholder_text(ui_Network_Selection_PasswordInput, "password");
lv_textarea_set_password_mode(ui_Network_Selection_PasswordInput, true);
lv_obj_set_style_text_color(ui_Network_Selection_PasswordInput, lv_color_hex(0x646363),
LV_PART_TEXTAREA_PLACEHOLDER | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_Network_Selection_PasswordInput, 255, LV_PART_TEXTAREA_PLACEHOLDER | LV_STATE_DEFAULT);
ui_Network_Selection_Keyboard = lv_keyboard_create(ui_Overlay);
lv_obj_set_width(ui_Network_Selection_Keyboard, LV_HOR_RES);
lv_obj_set_height(ui_Network_Selection_Keyboard, 170);
lv_obj_set_align(ui_Network_Selection_Keyboard, LV_ALIGN_BOTTOM_MID);
lv_obj_add_flag(ui_Network_Selection_Keyboard, LV_OBJ_FLAG_HIDDEN);
ui_Network_Selection_Back = lv_btn_create(ui_Overlay);
lv_obj_set_width(ui_Network_Selection_Back, 100);
lv_obj_set_height(ui_Network_Selection_Back, 39);
lv_obj_set_align(ui_Network_Selection_Back, LV_ALIGN_TOP_LEFT);
lv_obj_add_flag(ui_Network_Selection_Back, LV_OBJ_FLAG_SCROLL_ON_FOCUS);
lv_obj_clear_flag(ui_Network_Selection_Back, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_text_color(ui_Network_Selection_Back, lv_color_hex(0xFFF9F9), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_Network_Selection_Back, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_Network_Selection_BackLabel = lv_label_create(ui_Network_Selection_Back);
lv_obj_set_width(ui_Network_Selection_BackLabel, LV_SIZE_CONTENT);
lv_obj_set_height(ui_Network_Selection_BackLabel, LV_SIZE_CONTENT);
lv_obj_set_align(ui_Network_Selection_BackLabel, LV_ALIGN_CENTER);
lv_label_set_text(ui_Network_Selection_BackLabel, "Back");
lv_obj_set_style_text_color(ui_Network_Selection_BackLabel, lv_color_hex(0xFCFCFC), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(ui_Network_Selection_BackLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui_Network_Selection_BackLabel, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_keyboard_set_textarea(ui_Network_Selection_Keyboard, ui_Network_Selection_PasswordInput);
uint8_t * password = lv_textarea_get_text(ui_Network_Selection_PasswordInput);
//event binders
lv_obj_add_event_cb(ui_Network_Selection_Back, ui_event_back, LV_EVENT_CLICKED, NULL);
lv_obj_add_event_cb(ui_Network_Selection_PasswordInput, ui_event_password_focus, LV_EVENT_FOCUSED, NULL);
lv_obj_add_event_cb(ui_Network_Selection_PasswordInput, ui_event_password_focus, LV_EVENT_DEFOCUSED, NULL);
lv_obj_add_event_cb(ui_Network_Selection_Connect, ui_event_wifi_connect, LV_EVENT_CLICKED, (void *)password);
}
this is the code for screenshot number 1, take note that this overlay is shown on top of another screen. This shoudn’t create this issue though.
This is the main function where the loading screen is called on the start of program.
void app_main(void)
{
Touch_IO_RST();
lvgl_hardWare_init();
ESP_LOGW(TAG, "init lvgl hd ok");
xTaskCreate(lv_tick_task, "lv_tick_task", 1024*10, NULL, 1, NULL);
ui_show_loading_screen("Searching For Network");
xTaskCreate(wifi_init_task, "lv_wifi_task", 4096, NULL, 5, NULL);
}