Alex Kombo
Alex Kombo

Reputation: 3356

Animate ImageView when sliding to fill width

I am trying to achieve an animation like this one now playing page

where after sliding up, the album art stretches to fill the width. What is the most efficient way of achieving this?

Upvotes: 0

Views: 57

Answers (1)

NSimon
NSimon

Reputation: 5287

If you are in the same view, I would have a look at http://developer.android.com/reference/android/transition/TransitionManager.html which allows you to transition between two layouts in the same Activity or Fragment.

If you're adding a new fragment, you will want to override the transition, with something like :

getFragmentManager().beginTransaction()
            .setCustomAnimations(R.animator.fragment_slide_up, R.animator.fragment_slide_down)

Finally if you're switching activities, you will want to have a look at http://developer.android.com/training/material/animations.html (Part 3 about activity transitions and shared elements)

Upvotes: 1

Related Questions