iot common: adjust content size 59/234159/3
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 22 May 2020 07:49:04 +0000 (16:49 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Mon, 25 May 2020 03:56:19 +0000 (12:56 +0900)
Change-Id: Ie598a3e56d314177a0c54190e9817cdb3d772409

sources/libraries/Common/common_pswd_popup.c
sources/libraries/Common/common_utils.c
sources/libraries/Common/include/common.h
sources/libraries/Common/include/common_utils.h
sources/ui-gadget/viewers-layout/view_detail.c
sources/ui-gadget/viewers-layout/viewer_manager.c
sources/ui-gadget/viewers-layout/wifi_viewer_list.c
sources/ui-gadget/wifi-efl-UG.c
sources/wifi-syspopup/viewer-popups/view-main.c
sources/wifi-syspopup/wifi-syspopup.c

index 4f32689..3d63da4 100755 (executable)
@@ -39,6 +39,7 @@ static gboolean wps_options_click = FALSE;
 static gboolean keypad_state = FALSE;
 
 extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+extern content_size_info_t g_content_size_info;
 
 static void __popup_entry_changed_cb(void* data, Evas_Object* obj, void* event_info)
 {
@@ -412,7 +413,9 @@ static Evas_Object *_passwd_popup_wps_item_content_get(void *data,
                elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, "wifi_icon_wps.png");
                evas_object_color_set(icon, 2, 61, 132, 153);
 
-               evas_object_size_hint_min_set(icon, DEFAULT_BUTTON_CIRCLE_SIZE, DEFAULT_BUTTON_CIRCLE_SIZE);
+               evas_object_size_hint_min_set(icon,
+                               g_content_size_info.icon_w,
+                               g_content_size_info.icon_h);
        }
        return icon;
 }
index 3712456..22e30c2 100755 (executable)
 #define FEATURE_TAG "platform"
 #define MODEL_CONFIG_TAG "model-config"
 
+/* Icon Size*/
+#define BUTTON_CIRCLE_SIZE 40
+#define COMMON_BUTTON_CIRCLE_SIZE 30
+#define OOBE_BUTTON_CIRCLE_SIZE_H 33
+#define OOBE_BUTTON_CIRCLE_SIZE_W 45
+
+/* Font Size */
+#define SMALL_FONT_SIZE 28
+#define MID_FONT_SIZE 30
+#define BIG_FONT_SIZE 32
+#define COMMON_SMALL_FONT_SIZE 18
+#define COMMON_BIG_FONT_SIZE 22
+#define OOBE_SMALL_FONT_SIZE 16
+#define OOBE_MID_FONT_SIZE 18
+#define OOBE_BIG_FONT_SIZE 20
+
+/* Progress bar */
+#define PROGRESS_SMALL "process_small"
+#define PROGRESS_MID "process_medium"
+
 typedef enum {
        TIZEN_MODEL_UNKNOWN = 0,
        TIZEN_MODEL_EMULATOR = 0x1,
@@ -67,10 +87,6 @@ struct gdbus_connection_data {
        guint subscribe_id_supplicant;
 };
 
-#if 0
-// not used at this moment 06/15/2018 
-static struct gdbus_connection_data gdbus_conn = { NULL, 0 };
-#endif
 static GSList *managed_idler_list = NULL;
 static int (*rotate_cb)(enum appcore_rm, void*, Eina_Bool, Eina_Bool) = NULL;
 static void *rotate_cb_data = NULL;
@@ -80,6 +96,7 @@ static Eina_Bool is_portrait_mode = EINA_TRUE;
 static Ecore_Timer *scan_update_timer = NULL;
 
 genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+content_size_info_t g_content_size_info;
 
 static char *__common_utils_2line_text_get(void *data, Evas_Object *obj, const char *part)
 {
@@ -906,6 +923,32 @@ void common_util_update_genlist_style(void)
        _init_genlist_full_style();
 }
 
+void common_util_update_content_size(void)
+{
+       if (g_ug_type == UG_VIEW_OOBE) {
+               g_content_size_info.small_font = OOBE_SMALL_FONT_SIZE;
+               g_content_size_info.mid_font = OOBE_MID_FONT_SIZE;
+               g_content_size_info.big_font = OOBE_BIG_FONT_SIZE;
+               g_content_size_info.icon_w = OOBE_BUTTON_CIRCLE_SIZE_H;
+               g_content_size_info.icon_h = OOBE_BUTTON_CIRCLE_SIZE_W;
+               g_content_size_info.progress = PROGRESS_MID;
+       } else if (g_ug_type == UG_VIEW_IOT_COMMON) {
+               g_content_size_info.small_font = COMMON_SMALL_FONT_SIZE;
+               g_content_size_info.mid_font = COMMON_SMALL_FONT_SIZE;
+               g_content_size_info.big_font = COMMON_BIG_FONT_SIZE;
+               g_content_size_info.icon_w = COMMON_BUTTON_CIRCLE_SIZE;
+               g_content_size_info.icon_h = COMMON_BUTTON_CIRCLE_SIZE;
+               g_content_size_info.progress = PROGRESS_SMALL;
+       } else {
+               g_content_size_info.small_font = SMALL_FONT_SIZE;
+               g_content_size_info.mid_font = MID_FONT_SIZE;
+               g_content_size_info.big_font = BIG_FONT_SIZE;
+               g_content_size_info.icon_w = BUTTON_CIRCLE_SIZE;
+               g_content_size_info.icon_h = BUTTON_CIRCLE_SIZE;
+               g_content_size_info.progress = PROGRESS_MID;
+       }
+}
+
 void common_util_set_ug_type(UG_TYPE type)
 {
        g_ug_type = type;
index 5fc2d49..6c9721f 100755 (executable)
@@ -103,6 +103,15 @@ typedef struct {
        const char *sub_content_part;
 } genlist_info_t;
 
+typedef struct {
+       int small_font;
+       int mid_font;
+       int big_font;
+       int icon_w;
+       int icon_h;
+       const char *progress;
+} content_size_info_t;
+
 //#if !defined TIZEN_WIFI_QS
 //extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
 //genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX] = {0, };
@@ -120,27 +129,13 @@ typedef struct {
 #define GENLIST_PART_ELM_TEXT_SUB "elm.text.sub"
 #define GENLIST_PART_ELM_TEXT_SUB_END "elm.text.sub.end"
 #define GENLIST_PART_ELM_TEXT_END "elm.text.end"
-#define GENLIST_PART_ELM_TEXT_MULTILINE "elm.text.MULTILINE"
+#define GENLIST_PART_ELM_TEXT_MULTILINE "elm.text.multiline"
 #define GENLIST_PART_ELM_ICON "elm.icon"
 #define GENLIST_PART_ELM_END "elm.end"
 #define GENLIST_PART_ELM_SWALLOW_CONTENT "elm.swallow.content"
 #define GENLIST_PART_ELM_SWALLOW_ICON "elm.swallow.icon"
 #define GENLIST_PART_ELM_SWALLOW_END "elm.swallow.end"
 
-/* Icon Size*/
-#define DEFAULT_BG_SIZE 60
-#define DEFAULT_BUTTON_CIRCLE_SIZE 40
-#define DEFAULT_OOBE_BUTTON_CIRCLE_HEIGHT 33
-#define DEFAULT_OOBE_BUTTON_CIRCLE_WIDTH 45
-
-/* Font Size */
-#define SMALL_FONT_SIZE 28
-#define MID_FONT_SIZE 30
-#define BIG_FONT_SIZE 32
-#define OOBE_SMALL_FONT_SIZE 16
-#define OOBE_MID_FONT_SIZE 18
-#define OOBE_BIG_FONT_SIZE 20
-
 typedef enum {
        UG_VIEW_DEFAULT = 0,
        UG_VIEW_SETUP_WIZARD,
index 7072c8c..8038c94 100755 (executable)
@@ -132,6 +132,7 @@ Eina_Bool _is_emulator(void);
 
 bool is_common_profile(void);
 void common_util_update_genlist_style(void);
+void common_util_update_content_size(void);
 
 void common_util_set_ug_type(UG_TYPE type);
 UG_TYPE common_util_get_ug_type(void);
index 9138cb7..145ce93 100755 (executable)
@@ -61,6 +61,7 @@ static void _ctxpopup_rotate_cb(void *data, Evas_Object *obj, void *event_info);
 static void _ctxpopup_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
 extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+extern content_size_info_t g_content_size_info;
 
 static void __back_btn_cb(void *data, Evas_Object *obj, void *event_info)
 {
@@ -306,7 +307,9 @@ static Evas_Object *_view_detail_grouptitle_content_get(void *data, Evas_Object
                elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, temp_str);
                g_free(temp_str);
 
-               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE), ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE));
+               evas_object_size_hint_min_set(icon,
+                               ELM_SCALE_SIZE(g_content_size_info.icon_w),
+                               ELM_SCALE_SIZE(g_content_size_info.icon_h));
 
        }
        return icon;
@@ -537,7 +540,6 @@ static gboolean __view_detail_load_ip_info_list_cb(void *data)
        Elm_Object_Item *navi_it = NULL;
        Evas_Object *list = NULL;
        Evas_Object *layout;
-       wifi_manager_connection_state_e state;
 
        _detail_data = (view_detail_data *)data;
 
@@ -555,9 +557,12 @@ static gboolean __view_detail_load_ip_info_list_cb(void *data)
                        PACKAGE, list, __view_detail_imf_ctxt_evnt_cb, navi_it);
 
        /* Append forget button */
-       wifi_manager_ap_get_connection_state(_detail_data->ap, &state);
-       if (state == WIFI_MANAGER_CONNECTION_STATE_CONNECTED)
-               __view_detail_add_forget_button(list, _detail_data);
+       if (ug_app_state->ug_type == UG_VIEW_IOT_COMMON) {
+               wifi_manager_connection_state_e state;
+               wifi_manager_ap_get_connection_state(_detail_data->ap, &state);
+               if (state == WIFI_MANAGER_CONNECTION_STATE_CONNECTED)
+                       __view_detail_add_forget_button(list, _detail_data);
+       }
 
        if (_detail_data && _detail_data->btn)
                elm_object_disabled_set(_detail_data->btn, EINA_FALSE);
index bb527c9..739720f 100755 (executable)
@@ -98,6 +98,7 @@ static void _hidden_button_callback(void* data, Evas_Object* obj, void* event_in
 static void viewer_manager_hidden_confirm_cleanup(void);
 
 extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+extern content_size_info_t g_content_size_info;
 
 #ifdef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
 static void _launch_wifi_direct_app(void)
@@ -682,14 +683,13 @@ static char *_gl_wifi_onoff_text_get(void *data, Evas_Object *obj, const char *p
        if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) {
                if (ug_type == UG_VIEW_OOBE) {
                        det = g_strdup_printf("<font_size=%d>%s</font_size>",
-                                       OOBE_MID_FONT_SIZE,
+                                       g_content_size_info.mid_font,
                                        manager_object->header_mode == HEADER_MODE_SEARCHING ?
                                                sc(PACKAGE, I18N_TYPE_Scanning) :
                                                manager_object->item_wifi_onoff_text);
                } else {
                        det = g_strdup(manager_object->item_wifi_onoff_text);
                }
-
        }
 
        return det;
@@ -709,6 +709,35 @@ static char *_gl_helper_text_get(void *data, Evas_Object *obj, const char *part)
        return det;
 }
 
+static char *_gl_helper_content_get(void *data, Evas_Object *obj, const char *part)
+{
+       retvm_if(NULL == manager_object, NULL);
+
+       Evas_Object *box, *top_padding, *label;
+       char* det = g_strdup_printf("<align=center><font_size=%d>%s</font_size></align>",
+                       g_content_size_info.big_font,
+                       manager_object->item_onoff_description_text);
+
+       assertm_if(NULL == det, "NULL!!");
+
+       box = elm_box_add(obj);
+       elm_box_horizontal_set(box, EINA_FALSE);
+
+       top_padding = evas_object_rectangle_add(evas_object_evas_get(obj));
+       evas_object_size_hint_min_set(top_padding, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(50));
+       evas_object_size_hint_max_set(top_padding, ELM_SCALE_SIZE(40), ELM_SCALE_SIZE(50));
+       evas_object_color_set(top_padding, 0, 0, 0, 0);
+       evas_object_show(top_padding);
+       elm_box_pack_end(box, top_padding);
+
+       label = elm_label_add(box);
+       elm_object_text_set(label, det);
+       evas_object_show(label);
+       elm_box_pack_end(box, label);
+
+       return box;
+}
+
 static Evas_Object *_gl_wifi_onoff_content_get(void *data,
                Evas_Object *obj, const char *part)
 {
@@ -797,11 +826,19 @@ static void __viewer_manager_onoff_description_item_create(void)
 {
        __COMMON_FUNC_ENTER__;
 
-       manager_object->item_onoff_description_text = g_strdup(sc(PACKAGE, I18N_TYPE_Turn_on_wifi_to_view_available_networks));
+       manager_object->item_onoff_description_text = g_strdup(sc(PACKAGE,
+                               I18N_TYPE_Turn_on_wifi_to_view_available_networks));
+
+       if (wifi_get_ug_type() != UG_VIEW_IOT_COMMON) {
+               onoff_description_itc.item_style = g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].style_name;
+               onoff_description_itc.func.text_get = _gl_helper_text_get;
+               onoff_description_itc.func.content_get = NULL;
+       } else {
+               onoff_description_itc.item_style = g_genlist_info[WIFI_GENLIST_FULL_STYLE].style_name;
+               onoff_description_itc.func.text_get = NULL;
+               onoff_description_itc.func.content_get = _gl_helper_content_get;
+       }
 
-       onoff_description_itc.item_style = g_genlist_info[WIFI_GENLIST_MULTILINE_STYLE].style_name;
-       onoff_description_itc.func.text_get = _gl_helper_text_get;
-       onoff_description_itc.func.content_get = NULL;
        onoff_description_itc.func.state_get = NULL;
        onoff_description_itc.func.del = NULL;
 
index 6e1aca8..e2032f5 100755 (executable)
@@ -29,8 +29,6 @@
 #include "appcoreWrapper.h"
 #include "i18nmanager.h"
 
-#define LIST_ITEM_CONNECTED_AP_FONT_SIZE               28
-
 static Evas_Object* viewer_list = NULL;
 static Elm_Object_Item* first_item = NULL;
 static Elm_Object_Item* last_item = NULL;
@@ -51,6 +49,7 @@ struct connecting_cancel_popup_data {
 static struct connecting_cancel_popup_data *g_disconnect_popup = NULL;
 
 extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
+extern content_size_info_t g_content_size_info;
 
 static void _gl_listview_more_btn_cb(void *data, Evas_Object *obj, void *event_info)
 {
@@ -95,7 +94,6 @@ static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *par
 
        ug_genlist_data_t* gdata = (ug_genlist_data_t*) data;
        retvm_if(NULL == gdata || NULL == gdata->device_info, NULL);
-
        assertm_if(NULL == gdata->device_info->ssid, "NULL!!");
 
        if (!strcmp(g_genlist_info[WIFI_GENLIST_2LINE_STYLE].text_part, part)) {
@@ -106,15 +104,14 @@ static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *par
 
                if (ug_type != UG_VIEW_OOBE && VIEWER_ITEM_RADIO_MODE_CONNECTED == gdata->radio_mode) {
                        convertedColor = ConvertRGBAtoHex(61, 185, 204, 255);
-                       buf = g_strdup_printf("<color=#%s>%s</color>",
-                                       convertedColor, det);
-
+                       buf = g_strdup_printf("<color=#%s><font_size=%d>%s</font_size></color>",
+                                       convertedColor, g_content_size_info.big_font, det);
                        g_free(det);
                        g_free(convertedColor);
                        return buf;
-               } else if (wifi_get_ug_type() == UG_VIEW_OOBE) {
+               } else {
                        buf = g_strdup_printf("<font_size=%d>%s</font_size>",
-                                       OOBE_BIG_FONT_SIZE, det);
+                                       g_content_size_info.big_font, det);
                        g_free(det);
                        return buf;
                }
@@ -123,12 +120,8 @@ static char* _gl_listview_text_get(void *data, Evas_Object *obj, const char *par
                det = g_strdup(gdata->device_info->ap_status_txt);
                assertm_if(NULL == det, "NULL!!");
 
-               if (ug_type == UG_VIEW_OOBE)
-                       buf = g_strdup_printf("<font_size=%d>%s</font_size>",
-                                       OOBE_SMALL_FONT_SIZE, det);
-               else
-                       buf = g_strdup_printf("<font_size=%d>%s</font_size>",
-                                       SMALL_FONT_SIZE, det);
+               buf = g_strdup_printf("<font_size=%d>%s</font_size>",
+                               g_content_size_info.small_font, det);
                g_free(det);
                return buf;
        }
@@ -158,22 +151,18 @@ static Evas_Object *_gl_listview_content_get(void *data, Evas_Object *obj, const
                elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, temp_str);
                g_free(temp_str);
 
-               if (wifi_get_ug_type() == UG_VIEW_OOBE) {
+               if (wifi_get_ug_type() == UG_VIEW_OOBE)
                        evas_object_color_set(icon, 0, 10, 10, 204);
-                       evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(DEFAULT_OOBE_BUTTON_CIRCLE_WIDTH),
-                                       ELM_SCALE_SIZE(DEFAULT_OOBE_BUTTON_CIRCLE_HEIGHT));
-               } else {
+               else
                        evas_object_color_set(icon, 2, 61, 132, 204);
-                       evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE),
-                                       ELM_SCALE_SIZE(DEFAULT_BUTTON_CIRCLE_SIZE));
-               }
+
+               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(g_content_size_info.icon_w),
+                               ELM_SCALE_SIZE(g_content_size_info.icon_h));
        } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_content_part, part)) {
                if (VIEWER_ITEM_RADIO_MODE_CONNECTING == gdata->radio_mode ||
                                VIEWER_ITEM_RADIO_MODE_CONFIGURATION == gdata->radio_mode) {
-
                        icon = elm_progressbar_add(obj);
-
-                       elm_object_style_set(icon, "process_medium");
+                       elm_object_style_set(icon, g_content_size_info.progress);
                        evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
                        evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                        elm_progressbar_pulse(icon, TRUE);
@@ -243,7 +232,7 @@ static char *_gl_hidden_network_text_get(void *data, Evas_Object *obj,
 {
        if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part))
                return g_strdup_printf("<font_size=%d>%s</font_size>",
-                               BIG_FONT_SIZE, sc(PACKAGE, I18N_TYPE_Find_Hidden_Network));
+                               g_content_size_info.big_font, sc(PACKAGE, I18N_TYPE_Find_Hidden_Network));
 
        return NULL;
 }
@@ -257,8 +246,8 @@ static Evas_Object *_gl_hidden_network_content_get(void *data, Evas_Object *obj,
                icon = elm_image_add(obj);
                retvm_if(NULL == icon, NULL);
                elm_image_file_set(icon, CUSTOM_EDITFIELD_PATH, "find_hidden_network.png");
-               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(DEFAULT_OOBE_BUTTON_CIRCLE_WIDTH),
-                               ELM_SCALE_SIZE(DEFAULT_OOBE_BUTTON_CIRCLE_HEIGHT));
+               evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(g_content_size_info.icon_w),
+                               ELM_SCALE_SIZE(g_content_size_info.icon_h));
        }
 
        return icon;
@@ -334,6 +323,8 @@ static void _gl_realized_round(void *data, Evas_Object *obj, void *event_info)
 
        if (index == 1) // toggle button for wifi activation
                elm_object_item_signal_emit(item, "elm,state,group,single", "elm");
+       else if (count == 2 && index == 2) // deactivated, description
+               elm_object_item_signal_emit(item, "elm,state,bottomline,hide", "elm");
        else if (index == 3) // first AP
                elm_object_item_signal_emit(item, "elm,state,group,top", "elm");
        else if (index == count)
index 752f130..e780ab1 100755 (executable)
@@ -129,6 +129,7 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode,
 
        common_util_set_ug_type(ug_app_state->ug_type);
        common_util_update_genlist_style();
+       common_util_update_content_size();
 
        Evas_Object *parent_layout = ug_get_parent_layout(ug);
        if (parent_layout == NULL) {
index 947b035..aaba6db 100755 (executable)
@@ -39,6 +39,7 @@ struct connecting_cancel_popup_data {
 static struct connecting_cancel_popup_data *g_disconnect_popup = NULL;
 
 extern wifi_object* devpkr_app_state;
+extern content_size_info_t g_content_size_info;
 
 static Evas_Object* list = NULL;
 static Elm_Genlist_Item_Class itc;
@@ -652,7 +653,9 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa
                g_free(temp_str);
 
                evas_object_color_set(icon, 2, 61, 132, 204);
-               evas_object_size_hint_min_set(icon, DEFAULT_BUTTON_CIRCLE_SIZE, DEFAULT_BUTTON_CIRCLE_SIZE);
+               evas_object_size_hint_min_set(icon,
+                               g_content_size_info.icon_w,
+                               g_content_size_info.icon_h);
 
        } else if (!strcmp("elm.swallow.end", part)) {
                if (gdata->connection_mode == ITEM_CONNECTION_MODE_CONNECTING ||
index f7680c8..a60f230 100755 (executable)
@@ -633,6 +633,7 @@ static bool app_create(void *data)
        else
                common_util_set_ug_type(UG_VIEW_DEFAULT);
        common_util_update_genlist_style();
+       common_util_update_content_size();
        __COMMON_FUNC_EXIT__;
        return true;
 }