A little thing about (activity transition) animations

I recently tried to get some activity transistion animations going. You know,  sliding in the newly launched activity, that kind of thing.

What I wanted was to have my old activity just sit there whilst my new activity (a scroll) opened up horizontally from the centre of the screen. So I wrote my scaling animation xml and buggered around using overridePendingTransition. And completely failed to get anything to show.

Turns out, even if you’re just animating the x-scale property (android:fromXscale=”0″ and android:toXScale=”1″ with the scaling centered on the screen at android:XPivot=”50%”), you NEED  to supply the Y values in the xml, too! Just set them from “1” to “1” will do, but you do have to supply them.

After doing this, my animation works fine (even though it does look a little cheesy…I might have to work my 9patch a bit).

This entry was posted in android, art, programming and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s