UI issues are fixed
[apps/native/ug-mobile-ap.git] / src / mh_view_main.c
index 3563cbe..badd2b9 100644 (file)
@@ -312,12 +312,6 @@ static void __read_setting(mh_appdata_t *ad)
        if (ret != TETHERING_ERROR_NONE) {
                ERR("tethering_wifi_get_security_type is failed\n");
        }
-
-       DBG("VCONFKEY_MOBILE_HOTSPOT_MODE: %d\n", ad->main.hotspot_mode);
-       DBG("Device name: %s\n", ad->setup.device_name);
-       DBG("Connected device: %d\n", ad->clients.number);
-       DBG("Visibility: %d\n", ad->setup.visibility);
-       DBG("Security: %d\n", ad->setup.security_type);
        DBG("End of Load setting value \n");
 
        __MOBILE_AP_FUNC_EXIT__;
@@ -552,7 +546,7 @@ static void __select_setup_item(void *data, Evas_Object *obj, void *event_info)
        }
 
        if (connected_wifi_clients > 0) {
-               _prepare_popup(ad, MH_POP_ENTER_TO_WIFI_SETUP_CONF,
+               _prepare_popup(MH_POP_ENTER_TO_WIFI_SETUP_CONF,
                                _("IDS_MOBILEAP_POP_CONNECTED_DEVICE_WILL_BE_DISCONNECTED"));
                _create_popup(ad);
        } else {
@@ -1278,12 +1272,44 @@ static void __gl_realized(void *data, Evas_Object *obj, void *event_info)
 {
        mh_appdata_t *ad = (mh_appdata_t *)data;
        Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+       Evas_Object *ao;
+       Evas_Object *btn;
+       char str[MH_LABEL_LENGTH_MAX] = {0, };
+       int i = 0;
 
        if (item == ad->main.wifi_item || item == ad->main.bt_item || item == ad->main.device_item)
                elm_object_item_signal_emit(item, "elm,state,top", "");
        else if (item == ad->main.setup_item || item == ad->main.usage_item || item == ad->main.usb_item)
                elm_object_item_signal_emit(item, "elm,state,bottom", "");
 
+       for (i = 0; i < 4; i++) {
+               if (item == ad->main.sp_item[i])
+                       elm_object_item_access_unregister(item);
+       }
+
+       if (item == ad->main.wifi_item || item == ad->main.bt_item || item == ad->main.usb_item) {
+               ao = elm_object_item_access_object_get(item);
+               btn = elm_object_item_part_content_get(item, "on&off");
+               snprintf(str, sizeof(str), "%s, %s", "On/off button",
+                               (elm_check_state_get(btn) ? "On" : "Off"));
+               elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, str);
+       } else if (item == ad->main.setup_item) {
+               ao = elm_object_item_access_object_get(item);
+               elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, "Item");
+       } else if (item == ad->main.device_item) {
+               ao = elm_object_item_access_object_get(item);
+               snprintf(str, sizeof(str), "%s, %s", "Expandable list",
+                               "Double tap to open list");
+               elm_access_info_set(ao, ELM_ACCESS_CONTEXT_INFO, str);
+       }
+
+       if (ad->main.device_item == elm_genlist_item_parent_get(item)) {
+               if (ad->clients.number == elm_genlist_item_index_get(item) - 9)
+                       elm_object_item_signal_emit(item, "elm,state,bottom", "");
+               else
+                       elm_object_item_signal_emit(item, "elm,state,center", "");
+       }
+
        return;
 }
 
@@ -1292,6 +1318,7 @@ static void __create_inner_contents(mh_appdata_t *ad)
        __MOBILE_AP_FUNC_ENTER__;
 
        Elm_Object_Item *item = NULL;
+       int i = 0;
 
        __read_setting(ad);
        if (ad->main.hotspot_mode != VCONFKEY_MOBILE_HOTSPOT_MODE_NONE)
@@ -1307,6 +1334,7 @@ static void __create_inner_contents(mh_appdata_t *ad)
        item = elm_genlist_item_append(ad->main.genlist, ad->main.sp_itc, NULL,
                        NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+       ad->main.sp_item[i++] = item;
 
        item = elm_genlist_item_append(ad->main.genlist, ad->main.wifi_itc,
                        ad, NULL, ELM_GENLIST_ITEM_NONE,
@@ -1322,6 +1350,7 @@ static void __create_inner_contents(mh_appdata_t *ad)
        item = elm_genlist_item_append(ad->main.genlist, ad->main.sp_itc, NULL,
                        NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+       ad->main.sp_item[i++] = item;
 
        item = elm_genlist_item_append(ad->main.genlist, ad->main.bt_itc,
                        ad, NULL, ELM_GENLIST_ITEM_NONE,
@@ -1347,6 +1376,7 @@ static void __create_inner_contents(mh_appdata_t *ad)
        item = elm_genlist_item_append(ad->main.genlist, ad->main.sp_itc, ad,
                        NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+       ad->main.sp_item[i++] = item;
 
        item = elm_genlist_item_append(ad->main.genlist, ad->main.usage_itc,
                        ad, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
@@ -1359,6 +1389,7 @@ static void __create_inner_contents(mh_appdata_t *ad)
        item = elm_genlist_item_append(ad->main.genlist, ad->main.end_sp_itc, NULL,
                        NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+       ad->main.sp_item[i++] = item;
 
        __MOBILE_AP_FUNC_EXIT__;
        return;
@@ -1415,6 +1446,7 @@ void ap_draw_contents(mh_appdata_t *ad)
        elm_object_style_set(ad->main.back_btn, "naviframe/back_btn/default");
        evas_object_smart_callback_add(ad->main.back_btn, "clicked",
                        __back_btn_cb, ad);
+       elm_object_focus_allow_set(ad->main.back_btn, EINA_FALSE);
 
        elm_naviframe_item_push(ad->naviframe,
                        _("IDS_MOBILEAP_BODY_TETHERING"),