diff --git a/src/lib/elementary/efl_ui_active_view_container.c b/src/lib/elementary/efl_ui_active_view_container.c index 7a264691e8..d1f2fcc9b6 100644 --- a/src/lib/elementary/efl_ui_active_view_container.c +++ b/src/lib/elementary/efl_ui_active_view_container.c @@ -500,6 +500,7 @@ _unpack(Eo *obj, int index) { int early_curr_page = pd->curr.page; + Eina_Bool deletion_of_active = (index == pd->curr.page); pd->content_list = eina_list_remove(pd->content_list, subobj); _elm_widget_sub_object_redirect_to_top(obj, subobj); @@ -516,7 +517,10 @@ _unpack(Eo *obj, if (pd->gravity == EFL_UI_ACTIVE_VIEW_CONTAINER_GRAVITY_CONTENT && early_curr_page == index) { int new_curr_page = MIN(MAX(early_curr_page, 0), (int)eina_list_count(pd->content_list) - 1); - pd->curr.page = -1; + //when we delete the active index and we are not updating the index, + // then force a update, so the same sort of animation is triggered from the right direction + if (deletion_of_active && new_curr_page == pd->curr.page) + pd->curr.page = index -1; if (eina_list_count(pd->content_list) > 0 && efl_alive_get(obj)) efl_ui_active_view_active_index_set(obj, new_curr_page); } diff --git a/src/lib/elementary/efl_ui_active_view_view_manager_stack.c b/src/lib/elementary/efl_ui_active_view_view_manager_stack.c index ad2038a0be..769540d590 100644 --- a/src/lib/elementary/efl_ui_active_view_view_manager_stack.c +++ b/src/lib/elementary/efl_ui_active_view_view_manager_stack.c @@ -179,13 +179,22 @@ _setup_anim(Efl_Animation_Player *player, Efl_Gfx_Entity *entity) efl_player_start(player); } +static Eina_Bool +is_valid(Eo *obj, int index) +{ + if (index < 0) return EINA_FALSE; + if (index >= efl_content_count(obj)) return EINA_FALSE; + + return EINA_TRUE; +} + EOLIAN static void _efl_ui_active_view_view_manager_stack_efl_ui_active_view_view_manager_switch_to(Eo *obj, Efl_Ui_Active_View_View_Manager_Stack_Data *pd, int from, int to) { if (efl_pack_content_get(pd->container, to) == pd->content) return; - if (from != -1) + if (is_valid(pd->container, to) && is_valid(pd->container, from)) { if (pd->animation) {