0

I have two activities when I click the Button of the First activity it should move to right not completely out.At the same time the second activity should move from left to right this activity will occupy the 50% of the screen and rest of the Screen will be the first activity.The button will be in first activity .If I again click the button of the first activity the second activity will move from right to left it disappears and the screen is occupied by first activity. I done using override Pending Transition in android the problem is when I click the button the first activity is slide out and second activity occupies screen

1 Answers1

0

You can't show half of activity at a time there will be only one activity visible to user and for implementing the animation you mentioned above you can use two fragment in a activity.

Use two fragment and use animation while adding and removing them.

FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction(); 

MyFragment next = getMyFragment();

ft.add(R.id.MyLayout,next);
ft.setCustomAnimations(R.anim.slide_in_right,0);
ft.show(next);
ft.commit(); 
Kavis
  • 98
  • 4