extern void index_bring_in(Evas_Object *index, int idx);
-extern Evas_Object *index_create(Evas_Object *layout, unsigned int count);
+extern Evas_Object *index_create(Evas_Object *layout, unsigned int count, unsigned int current_idx);
extern Evas_Object *index_update(Evas_Object *layout, Evas_Object *index, unsigned int count);
extern void index_destroy(Evas_Object *index);
evas_object_size_hint_max_set(all_apps, width, height);
evas_object_resize(all_apps, width, height);
- index = index_create(all_apps, 0);
+ index = index_create(all_apps, 0,0);
if (NULL == index) {
evas_object_del(all_apps);
_E("cannot create index.");
-HAPI Evas_Object *index_create(Evas_Object *tab, unsigned int count)
+HAPI Evas_Object *index_create(Evas_Object *tab, unsigned int count,unsigned int current_idx)
{
Evas_Object *index;
Evas_Object *scroller;
elm_index_level_go(index, 0);
if (count > 0) {
- index_bring_in(index, 0);
+ index_bring_in(index, current_idx);
}
elm_object_part_content_set(tab, PAGE_CONTROLLER_GROUP_NAME, index);
HAPI Evas_Object *index_update(Evas_Object *layout, Evas_Object *index, unsigned int count)
{
-
+ int idx;
+ Elm_Object_Item *idx_it;
+ idx_it = elm_index_selected_item_get(index, 0);
+ idx = (int) elm_object_item_data_get(idx_it);
+
+ if(count == idx)
+ {
+ idx--;
+ }
+ if(idx == -1)
+ {
+ idx = 0;
+ }
+ _D("Current index %d, Current count: %d", idx,count);
index_destroy(index);
- return index_create(layout, count);
+ return index_create(layout, count,idx);
}