bool listmgr_update_content_list(struct listmgr *lmgr, Eina_List *list);
bool listmgr_update_play_info(struct listmgr *lmgr, app_media_info *info);
-bool listmgr_update_focus_item(struct listmgr *lmgr, int index, bool update);
+bool listmgr_focus_content_list(struct listmgr *lmgr, int index, bool update);
+bool listmgr_focus_play_info(struct listmgr *lmgr);
#endif /* __AIR_MEDIAHUB_LISTMGR_H__ */
else
update = false;
- listmgr_update_focus_item(priv->listmgr, vdata->index, update);
+ listmgr_focus_content_list(priv->listmgr, vdata->index, update);
break;
default:
{
struct view_update_data *vdata;
struct _priv *priv;
- bool update;
if (!layout_data) {
_ERR("failed to get layout data");
return;
}
- if (priv->cur_index != vdata->index)
- update = true;
- else
- update = false;
-
- listmgr_update_focus_item(priv->listmgr, vdata->index, update);
+ listmgr_focus_play_info(priv->listmgr);
_update_recent_item(priv);
break;
default:
{
struct view_update_data *vdata;
struct _priv *priv;
- bool update;
if (!layout_data) {
_ERR("failed to get layout data");
_update_playing_item(priv, vdata->index);
break;
case UPDATE_FOCUS:
- if (!vdata) {
- _ERR("invalid argument");
- return;
- }
-
- if (priv->cur_index != vdata->index)
- update = true;
- else
- update = false;
-
- listmgr_update_focus_item(priv->listmgr, vdata->index, update);
+ listmgr_focus_play_info(priv->listmgr);
break;
default:
break;
return ly;
}
-bool listmgr_update_focus_item(struct listmgr *lmgr, int index, bool update)
+bool _focus_to_content(struct listmgr *lmgr, Evas_Object *base)
+{
+ Evas_Object *content;
+
+ content = elm_object_part_content_get(base, PART_ITEM_CONTENT);
+ if (!content) {
+ _ERR("failed to get content");
+ return false;
+ }
+
+ lmgr->scr_focus = EINA_FALSE;
+ elm_object_focus_set(content, EINA_TRUE);
+
+ return true;
+}
+
+bool listmgr_focus_play_info(struct listmgr *lmgr)
+{
+ if (!lmgr) {
+ _ERR("failed to get listmgr");
+ return false;
+ }
+
+ if (!_focus_to_content(lmgr, lmgr->play_info)) {
+ _ERR("failed to focus to content");
+ return false;
+ }
+
+ return true;
+}
+
+bool listmgr_focus_content_list(struct listmgr *lmgr, int index, bool update)
{
Eina_List *item, *l;
- Evas_Object *ly, *grid, *content;
+ Evas_Object *ly, *grid;
Elm_Object_Item *it;
int count;
+ int r;
if (!update) {
- content = elm_object_part_content_get(lmgr->focused,
- PART_ITEM_CONTENT);
-
- lmgr->scr_focus = EINA_FALSE;
- elm_object_focus_set(content, EINA_TRUE);
-
- return true;
+ r = _focus_to_content(lmgr, lmgr->focused);
+ if (!r)
+ _ERR("failed to focus to content");
+ return r;
}
item = elm_box_children_get(lmgr->box);