Suppose we have two activities, A and B.
I want that when pressing an element (for example a button) of activity A it changes to activity B simulating the effect that is implemented in the ViewPager when changing from one fragment to another, such as one activity sliding to one side and the other appears next.
That effect is what I would like to simulate, but instead of sliding or using tabs, it happens when pressing any view and it is between two activities and not two fragments.
I have tried to do it with
overridePendingTransition(R.anim.slide_left_translate, R.anim.slide_left_translate);
Also with this:
Slide slide= new
slide.setDuration(1000);
getWindow().setEnterTransition(slide);
Slide slide= new
slide.setDuration(1000);
getWindow().setExitTransition(slide);
Writing those lines of code in activity A and activity B
But not if I'm using the code above wrong or it's done in another way or it just can't be done between two activities.
input
output
animations
left_in.xml
left_out.xml
I complement @Nicol_Israel_Olvera_Acosta's answer
Transitions between activities using
overridePendingTransition(anim_entrada,ani_salida)
In the
ActivityB
when it closes, perform the reverse transition