How to prevent reverse shared element transition
I found a solution.
I have played around a bit and if you override onBackPressed()
and call finish()
instead of super.onBackPressed()
, It works.
just stumbled upon this problem and there's a cleaner solution..
Just override finishAfterTransition(). You should have a boolean in your base class maybe, so it will look like this:
final override fun finishAfterTransition() {
if (myShouldAllowReverseTransitionsBoolean) {
super.finishAfterTransition()
} else {
super.finish()
}
}