iot common: change scan button style 38/241438/2
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 20 Aug 2020 07:15:38 +0000 (16:15 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 20 Aug 2020 07:16:47 +0000 (16:16 +0900)
Change-Id: Ic5a41a886c7c1f5cdf0bbc8c5e2fe410363ae11a

ui-gadget/viewer_manager.c
ui-gadget/viewer_manager.h
ui-gadget/wifi_viewer_list.c

index 95302a3..1258a22 100644 (file)
@@ -1552,46 +1552,50 @@ Evas_Object *viewer_manager_naviframe_power_item_get(void)
        return elm_object_item_part_content_get(navi_it, "title_right_btn");
 }
 
-// For IoT Common profile.
-Evas_Object *viewer_maanger_create_scan_list_btn(Evas_Object *parent)
-{
-       Evas_Object *btn = elm_button_add(parent);
-       if (!btn)
-               return NULL;
-
-       elm_object_style_set(btn, "border");
-       elm_object_domain_translatable_text_set(btn, PACKAGE,
-                       "IDS_WIFI_BUTTON_SCAN");
-       evas_object_smart_callback_add(btn, "clicked", __refresh_scan_callback, NULL);
-
-       return btn;
-}
-
 int viewer_manager_create_scan_btn(void)
 {
        __COMMON_FUNC_ENTER__;
        if (ug_app_state->ug_type == UG_VIEW_SETUP_WIZARD
                        || ug_app_state->ug_type == UG_VIEW_OOBE
-                       || ug_app_state->ug_type == UG_VIEW_IOT_COMMON
                        || manager_object->scan_button) {
                __COMMON_FUNC_EXIT__;
                return 0;
        }
-       Evas_Object *btn = elm_button_add(manager_object->nav);
-               /* Use "bottom" style button */
+
+       Evas_Object *box = NULL;
+       Evas_Object *btn = NULL;
+       const char *btn_style = ug_app_state->ug_type == UG_VIEW_IOT_COMMON ? "border" : "bottom";
+
+       box = elm_box_add(manager_object->nav);
+       if (!box) {
+               ERROR_LOG(UG_NAME_NORMAL, "Error creating box");
+               return -1;
+       }
+
+       btn = elm_button_add(box);
        if (!btn) {
                ERROR_LOG(UG_NAME_NORMAL, "Error creating toolbar");
                return -1;
        }
-       elm_object_style_set(btn, "bottom");
+
+       elm_object_style_set(btn, btn_style);
+       evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       if (ug_app_state->ug_type == UG_VIEW_IOT_COMMON)
+               evas_object_size_hint_padding_set(btn, 40, 40, 0, 40);
+
        elm_object_domain_translatable_text_set(btn, PACKAGE,
                        "IDS_WIFI_BUTTON_SCAN");
        evas_object_smart_callback_add(btn, "clicked", __refresh_scan_callback, NULL);
 
-       /* Set button into "toolbar" swallow part */
-       elm_object_item_part_content_set(manager_object->navi_it, "toolbar", btn);
+       /* Set box into "toolbar" swallow part */
+       elm_object_item_part_content_set(manager_object->navi_it, "toolbar", box);
        manager_object->scan_button = btn;
        evas_object_show(manager_object->scan_button);
+
+       elm_box_pack_end(box, btn);
+
        __COMMON_FUNC_EXIT__;
        return 0;
 }
index c008935..c120eda 100644 (file)
@@ -90,7 +90,6 @@ Evas_Object *viewer_manager_create_bg(Evas_Object *parent, char *style);
 #endif
 void viewer_manager_update_hidden_btn(void);
 int viewer_manager_create_scan_btn(void);
-Evas_Object *viewer_maanger_create_scan_list_btn(Evas_Object *parent); // For IoT Common
 
 void viewer_manager_eap_view_deref(void);
 
index 591d11c..03b4fa5 100644 (file)
@@ -256,26 +256,6 @@ static Evas_Object *_gl_hidden_network_content_get(void *data, Evas_Object *obj,
        return icon;
 }
 
-static Evas_Object *_gl_scan_button_content_get(void *data, Evas_Object *obj,
-               const char *part)
-{
-       if (!obj)
-               return NULL;
-
-       Evas_Object *layout = NULL;
-       Evas_Object *btn = NULL;
-
-       layout = elm_layout_add(obj);
-       if (!layout)
-               return NULL;
-
-       elm_layout_file_set(layout, CUSTOM_GENLIST_PATH, "gl_custom_list_button_item");
-       btn = viewer_maanger_create_scan_list_btn(layout);
-       elm_object_part_content_set(layout, "elm.swallow.content", btn);
-
-       return layout;
-}
-
 Elm_Object_Item* viewer_list_get_first_item(void)
 {
        return first_item;
@@ -1063,12 +1043,6 @@ Evas_Object* viewer_list_create(Evas_Object *win)
                last_item_itc->func.text_get = _gl_hidden_network_text_get;
                last_item_itc->func.content_get = _gl_hidden_network_content_get;
                last_item_itc->func.del = NULL;
-       } else if (ug_type == UG_VIEW_IOT_COMMON) {
-               last_item_itc = elm_genlist_item_class_new();
-               last_item_itc->item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
-               last_item_itc->func.text_get = NULL;
-               last_item_itc->func.content_get = _gl_scan_button_content_get;
-               last_item_itc->func.del = NULL;
        }
 
        first_item = last_item = NULL;