2

I'm trying to set an exit transition different than the enter transition between scenes. The goal is that scene enter sliding from right and exits sliding to left.

I'm able to do the enter transition sliding from right but when it exits, it does the reverse, meaning that, on exit, it exits sliding back to right.

How to set the exit transition?

Here's the current code:

public void loadScene(int resourceId) {

    Scene transition_scene = Scene.getSceneForLayout(getRootView(), resourceId, this);

    Transition enterTransition = TransitionInflater.from(this).inflateTransition(R.transition.slide_right);

    TransitionManager.go(transition_scene, enterTransition);

}
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Eduardo Pinheiro
  • 3,409
  • 3
  • 30
  • 39
  • First you have to write your outgoing transition. Then you call `overridePendingTransition(R.transition.slide_left)` after calling `finish()`. https://stackoverflow.com/a/8741875/5576680 – MyNewName Nov 10 '17 at 13:51
  • Found a better one: https://stackoverflow.com/a/5151774/5576680 – MyNewName Nov 10 '17 at 13:54
  • 1
    Thanks, but I'm looking for transition between scenes and not activities. overridePendingTransition will override the activity transition and not necessary the scene transition (between view groups). – Eduardo Pinheiro Nov 10 '17 at 14:15
  • did you find a solution for this? – div May 22 '20 at 00:07
  • I solved it somehow but was a workaround solution. I wasn't proud enough to post it here. I don't remember anymore, sorry for that. – Eduardo Pinheiro May 22 '20 at 11:16

0 Answers0