android - Understanding activity return transitions -


i using custom shared element transition when launch activity b activity a. works perfectly.

i want use custom transition doesn't involve shared elements return transition activity b activity a. however, having trouble several parts:

  1. how tell framework return transition doesn't involve shared elements?
  2. what start , end values transition in return transition? enter transition, manipulated activity b's views drawn on top of activity a's. happens in return transition?

appreciate can get!

edit:

further investigation revealed return transition's createanimator isn't being called though i'm calling setsharedelementreturntransition. know set call doing because doesn't try reverse original enter animation (default behavior) , instead of overlaps 2 views.

edit #2:

after looking @ george mount's answer, added

@override public void capturestartvalues(transitionvalues transitionvalues) {     transitionvalues.view.setvisibility(view.visible); }  @override public void captureendvalues(transitionvalues transitionvalues) {     transitionvalues.view.setvisibility(view.invisible); } 

this causing return transition's createanimator @ least run albeit animation still weird. why visibility matter?

  1. you must set sharedelementcallback , in onmapsharedelements, clear shared element map. eliminate shared element transition.
  2. this depends on transition you're talking about. return transition's start end end values view.visible , view.invisible. there several transitions happening when returning:

return transition: non-shared elements removed scene in activity b changing visibility.

shared element return transition: shared element in activity b starts when finishaftertransition called , ends activity says shared element is. can adjusted sharedelementcallback's onsharedelementstart , onsharedelementend, called in reverse during return.

reenter transition: non-shared element views activity change visibility.

shared element reenter transition: nothing, shared element can special after lands in activity a.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -