Image for post
Image for post

Transitions in the Android Support Library

Now available back to API 14

Chet Haase
Sep 1, 2016 · 5 min read

Using the API

Image for post
Image for post
Transitions demo running on Jellybean

SimpleTransition

TransitionManager.beginDelayedTransition(mSceneRoot);
params = (LayoutParams) mFirstButton.getLayoutParams();
// remove old rules, add new ones
params.addRule(...);
// ...
mFirstButton.setLayoutParams(params);
mStaggeredTransition = new TransitionSet();
Transition first = new ChangeBounds();
Transition second = new ChangeBounds();
Transition third = new ChangeBounds();
Transition fourth = new ChangeBounds();

first.addTarget(mFirstButton);
second.setStartDelay(50).addTarget(mSecondButton);
third.setStartDelay(100).addTarget(mThirdButton);
fourth.setStartDelay(150).addTarget(mFourthButton);

mStaggeredTransition.addTransition(first).addTransition(second).addTransition(third).
addTransition(fourth);
TransitionManager.beginDelayedTransition(mSceneRoot,
mStaggeredTransition);

Go! Play! Transition Things! Get Moving!

For More Information

Google Developers

Engineering and technology articles for developers, written…

Chet Haase

Written by

Android and comedy. Not necessarily in that order.

Google Developers

Engineering and technology articles for developers, written and curated by Googlers. The views expressed are those of the authors and don't necessarily reflect those of Google.

Chet Haase

Written by

Android and comedy. Not necessarily in that order.

Google Developers

Engineering and technology articles for developers, written and curated by Googlers. The views expressed are those of the authors and don't necessarily reflect those of Google.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store