// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.5.4
// LVGL version: 9.1.0
// Project name: your_chat_bot_WeChat

#include "../ui.h"

// COMPONENT aimsgcontainer

lv_obj_t * ui_aimsgcontainer_create(lv_obj_t * comp_parent)
{

    lv_obj_t * cui_aimsgcontainer;
    cui_aimsgcontainer = lv_obj_create(comp_parent);
    lv_obj_remove_style_all(cui_aimsgcontainer);
    lv_obj_set_width(cui_aimsgcontainer, lv_pct(98));
    lv_obj_set_height(cui_aimsgcontainer, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_align(cui_aimsgcontainer, LV_ALIGN_TOP_MID);
    lv_obj_set_flex_flow(cui_aimsgcontainer, LV_FLEX_FLOW_ROW);
    lv_obj_set_flex_align(cui_aimsgcontainer, LV_FLEX_ALIGN_SPACE_AROUND, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
    lv_obj_remove_flag(cui_aimsgcontainer, LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLLABLE);      /// Flags
    ui_object_set_themeable_style_property(cui_aimsgcontainer, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
                                           _ui_theme_color_background);
    ui_object_set_themeable_style_property(cui_aimsgcontainer, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
                                           _ui_theme_alpha_background);
    lv_obj_set_style_pad_left(cui_aimsgcontainer, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(cui_aimsgcontainer, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(cui_aimsgcontainer, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(cui_aimsgcontainer, 8, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_t * cui_ai_head;
    cui_ai_head = lv_image_create(cui_aimsgcontainer);
    lv_image_set_src(cui_ai_head, &ui_img_image_heads_ai_24_png);
    lv_obj_set_width(cui_ai_head, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(cui_ai_head, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_align(cui_ai_head, LV_ALIGN_CENTER);
    lv_obj_add_flag(cui_ai_head, LV_OBJ_FLAG_CLICKABLE);     /// Flags
    lv_obj_remove_flag(cui_ai_head, LV_OBJ_FLAG_SCROLLABLE);      /// Flags
    lv_obj_set_style_radius(cui_ai_head, 32767, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(cui_ai_head, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(cui_ai_head, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_color(cui_ai_head, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_opa(cui_ai_head, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_border_width(cui_ai_head, 3, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_t * cui_ai_msg;
    cui_ai_msg = lv_label_create(cui_aimsgcontainer);
    lv_obj_set_width(cui_ai_msg, lv_pct(85));
    lv_obj_set_height(cui_ai_msg, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_align(cui_ai_msg, LV_ALIGN_CENTER);
    // Set font BEFORE text to ensure proper glyph caching
    lv_obj_set_style_text_font(cui_ai_msg, &ui_font_puhui_18_2, LV_PART_MAIN | LV_STATE_DEFAULT);
    ui_object_set_themeable_style_property(cui_ai_msg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
                                           _ui_theme_color_PrimaryText);
    ui_object_set_themeable_style_property(cui_ai_msg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
                                           _ui_theme_alpha_PrimaryText);
    lv_label_set_text(cui_ai_msg, "Hello! I've been here all along!");
    lv_obj_set_style_radius(cui_ai_msg, 12, LV_PART_MAIN | LV_STATE_DEFAULT);
    ui_object_set_themeable_style_property(cui_ai_msg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
                                           _ui_theme_color_background);
    ui_object_set_themeable_style_property(cui_ai_msg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
                                           _ui_theme_alpha_background);
    lv_obj_set_style_shadow_width(cui_ai_msg, 12, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_spread(cui_ai_msg, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(cui_ai_msg, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(cui_ai_msg, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(cui_ai_msg, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(cui_ai_msg, 8, LV_PART_MAIN | LV_STATE_DEFAULT);

    lv_obj_t ** children = lv_malloc(sizeof(lv_obj_t *) * _UI_COMP_AIMSGCONTAINER_NUM);
    children[UI_COMP_AIMSGCONTAINER_AIMSGCONTAINER] = cui_aimsgcontainer;
    children[UI_COMP_AIMSGCONTAINER_AI_HEAD] = cui_ai_head;
    children[UI_COMP_AIMSGCONTAINER_AI_MSG] = cui_ai_msg;
    lv_obj_add_event_cb(cui_aimsgcontainer, get_component_child_event_cb, LV_EVENT_GET_COMP_CHILD, children);
    lv_obj_add_event_cb(cui_aimsgcontainer, del_component_child_event_cb, LV_EVENT_DELETE, children);
    ui_comp_aimsgcontainer_create_hook(cui_aimsgcontainer);
    return cui_aimsgcontainer;
}

