Skip to content

Instantly share code, notes, and snippets.

@KarthikKumarBA
Created November 24, 2016 10:26
Show Gist options
  • Save KarthikKumarBA/d362fd406bcace7bf57acbbe0e7e7c36 to your computer and use it in GitHub Desktop.
Save KarthikKumarBA/d362fd406bcace7bf57acbbe0e7e7c36 to your computer and use it in GitHub Desktop.
Activity Transition Overlap
private void setupWindowAnimations() {
// Re-enter transition is executed when returning back to this activity
Slide slideTransition = new Slide();
slideTransition.setSlideEdge(Gravity.LEFT);
slideTransition.setDuration(1000);
getWindow().setReenterTransition(slideTransition); // When MainActivity Re-enter the Screen
getWindow().setExitTransition(slideTransition); // When MainActivity Exits the Screen
// For overlap of Re Entering Activity - MainActivity.java and Exiting TransitionActivity.java
getWindow().setAllowReturnTransitionOverlap(false);
}
<!-- Transition Overlap - Either Specify here or Specify in the Activity. -->
<!--<item name="android:windowAllowEnterTransitionOverlap">true</item>-->
<!--<item name="android:windowAllowReturnTransitionOverlap">true</item>-->
// For overlap between Exiting MainActivity.java and Entering TransitionActivity.java
getWindow().setAllowEnterTransitionOverlap(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment