Tuesday 15 September 2015

Implementing slide transition after a option item selected android -


I create an action bar. In which there is an item, which sets the setting (image). After clicking on the image the other activity is started getting started. But I want to show the initial activity sliding transition effect. Sloppy activity left the slide and hide from left to right by hiding and starting activity.

Here is the code

To select the code

  Public Boolean OnoptsOmat selected (menu items) {Switch (ITAT. ITMID)} { Case Raid Setting: goToSetting (); } Return Super.Options item selected (item); }   

getoSetting function:

  public zero goToSetting () {// button intent intent = something in response to the new intent (this, DisplayMessageSetting.class) ; StartActivity; }   

Calling an activity called "DisplayMessageSetting"

Please help

Edit the onCreate method in your displaymessage setting activity:

  @Override Creates on Public Zero (Bundle SavedInstanceState) {super.onCreate (Saved InstantState); // Specify animation override pending transition (R.anim.slide_left_in, 0); // ...}   

Create a slide_left_in.xml file in your res / anim> folder (make folder, if it Does not have) and paste the following:

   & Lt; / Set & gt;   

In this way you have set the animation with a translation animation. You have too many options to zoom the animation, you can learn more about it.

No comments:

Post a Comment