[OAPBSA-62][UI] Proper focus next object is set 05/61205/7
authorMichal Skorupinski <m.skorupinsk@samsung.com>
Fri, 4 Mar 2016 16:37:08 +0000 (17:37 +0100)
committerPiotr Pruski <p.pruski@samsung.com>
Fri, 11 Mar 2016 15:20:57 +0000 (16:20 +0100)
The focus next object is used when the focus is switched from/to the
tab buttons to the displayed layout objects.
Channel, network and sound layouts are modified.

Change-Id: I7369c35b2d5c2d29dd7cecd88f4c4d3241fbc1e7
Signed-off-by: Michal Skorupinski <m.skorupinsk@samsung.com>
include/common/listmgr.h
src/common/listmgr.c
src/data/system/data_location.c
src/layout/layout_channel.c
src/layout/layout_network.c
src/layout/layout_sound.c

index 9f27a5c..0ef9213 100644 (file)
@@ -49,7 +49,8 @@ bool listmgr_hide_grid(struct listmgr *listmgr, const char *list_id,
  * @param[in]  reverse_dir             Reverse direction
  */
 void listmgr_set_list_next_focus(struct listmgr *listmgr, const char *list_id,
-               Evas_Object *obj_to_focus, Elm_Focus_Direction dir);
+               Evas_Object *obj_to_focus, Elm_Focus_Direction dir,
+               Eina_Bool add_reverse_link, Elm_Focus_Direction reverse_dir);
 
 bool listmgr_update_grid(struct listmgr *listmgr, const char *list_id);
 
index f676bff..09b97af 100644 (file)
@@ -388,7 +388,8 @@ bool listmgr_update_grid(struct listmgr *listmgr, const char *list_id)
 }
 
 void listmgr_set_list_next_focus(struct listmgr *listmgr, const char *list_id,
-               Evas_Object *obj_to_focus, Elm_Focus_Direction dir)
+               Evas_Object *obj_to_focus, Elm_Focus_Direction dir,
+               Eina_Bool add_reverse_link, Elm_Focus_Direction reverse_dir)
 {
        struct list_info *linfo = NULL;
 
@@ -407,6 +408,10 @@ void listmgr_set_list_next_focus(struct listmgr *listmgr, const char *list_id,
                obj_to_focus = linfo->grid;
 
        elm_object_focus_next_object_set(linfo->grid, obj_to_focus, dir);
+
+       if (add_reverse_link) {
+               elm_object_focus_next_object_set(obj_to_focus, linfo->grid, reverse_dir);
+       }
 }
 
 bool listmgr_hide_grid(struct listmgr *listmgr, const char *list_id,
index c03a1f3..dab0aaf 100644 (file)
@@ -213,5 +213,6 @@ void data_location_fill_list_data(struct listmgr *list_mgr, Elm_Object_Item **ge
                _ERR("Fill location list failed.");
        }
        listmgr_set_list_next_focus(list_mgr, LOCATION_LIST_ID,
-                       NULL, ELM_FOCUS_UP);
+                       NULL, ELM_FOCUS_UP,
+                       EINA_FALSE, ELM_FOCUS_UP);
 }
index 2f61daf..f0a3c8f 100644 (file)
@@ -442,6 +442,8 @@ static bool _create(layoutmgr *lmgr, void *data)
        inputmgr_add_callback(priv->btn, 0, &_input_handler, priv);
        layoutmgr_set_layout_data(lmgr, LAYOUT_ID_CHANNEL, priv);
 
+       elm_object_focus_next_object_set(priv->btn, (Evas_Object*)data,  ELM_FOCUS_UP);
+
        return true;
 }
 
index 3b6f9b3..f138f89 100644 (file)
@@ -967,6 +967,14 @@ static bool _create(layoutmgr *lmgr, void *data)
        listmgr_add_inner_grid_cb(priv->listmgr, LIST_WIRELESS,
                        &_grid_input_handler, NULL);
 
+       if(data) {
+               listmgr_set_list_next_focus(priv->listmgr, LIST_WIRELESS,
+                               (Evas_Object *)data, ELM_FOCUS_UP, EINA_FALSE, ELM_FOCUS_DOWN);
+
+               elm_object_focus_next_object_set((Evas_Object *)data, priv->network_type_btn, ELM_FOCUS_DOWN);
+       }
+
+
        return true;
 
 err:
index 45704cd..275a2e0 100644 (file)
@@ -181,9 +181,9 @@ static bool _create(layoutmgr *lmgr, void *data)
 
        if(data) {
                listmgr_set_list_next_focus(priv->list_mgr, LIST_SOUND_MODES_ID,
-                               (Evas_Object *)data, ELM_FOCUS_UP);
+                               (Evas_Object *)data, ELM_FOCUS_UP, EINA_TRUE, ELM_FOCUS_DOWN);
                listmgr_set_list_next_focus(priv->list_mgr, LIST_SPEAKERS_ID,
-                               (Evas_Object *)data, ELM_FOCUS_UP);
+                               (Evas_Object *)data, ELM_FOCUS_UP, EINA_FALSE, ELM_FOCUS_UP);
        }
 
        if (!_fill_lists(priv)) {