Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android 5 activity transition on lower api [duplicate]

Every time i search i came across this " android 5(L) activity transition only available on API >= 21 .

that's fine but i can see some app like QuickPic and google inbox that use similar transition and also working on lower api, so how this app can do such a thing?

what i have done?

1) a lot of search:)

2) playing with ActivityOptionsCompat that only apply to api >= 21, like this:

ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, transitionView, DATA.EXTRA_PASSED_JSON); Intent intent = new Intent(activity, PhotoViewerActivity.class); intent.putExtra(DATA.EXTRA_PASSED_JSON, json); ActivityCompat.startActivity(activity, intent, options.toBundle()); 

EDIT(question marked as duplicate): it's different from other question in this case, because i said there is other app that do this transition in lower api and i want to know how they do that.

like image 328
mehdok Avatar asked Dec 07 '14 15:12

mehdok


1 Answers

We added a lot of stuff in Lollipop to make Activity Transitions work well. It is possible to do Activity Transitions manually (in earlier versions), but you will encounter problems in some cases and the return transition is likely going to work only in the simplest case. Chet Haase has a devbyte on this here.

Animations between fragments were possible earlier, though the API isn't as easy to use as in Lollipop's Fragment Transitions.

We thought a lot about back porting transitions to earlier versions in the support library. It may still happen. If so, we should also be able to do something for Fragment Transitions.

like image 150
George Mount Avatar answered Oct 09 '22 14:10

George Mount