I am developing an android application. It uses Fragments. In first screen (Home.java), it has 5 buttons. Lets say button1
, button2
, button3
, button4
, button5
. When you click button1
, it should go to FragmentView1
screen, when you click on button2
it should go to FragmentView2
screen and so on. These screens are FragmentActivities
Now, I need to add an animation which is similar to ViewPager
, but, with a difference. ViewPager
allows you to slide, but as you can see, that will not work here, because different buttons open different screens. In ViewPager
it is not like that, you go to first screen, then slide and go to second, then to third etc. It is a sequence.
Here what I want is when you click on a button (only when click on a button), it should slide (just like ViewPager
animation) to the particular screen. Now if the user slides back, it will come back to the Home.java
screen (I don't know whether this part is possible, if not then let me know I can drop it). When he user click on the back button, it should slide back to the Home.java
.
Some screens like FragmentView1
uses ViewPager
by themselves to access their own sequence of pages so the above mechanism should not affect this.
How can I do something like this? I think you can see this in Yahoo mail app as well.