Shrink To Middle Activity Transition In Android
Posted by blogmeister on
June 12, 2011
I forgot which forum I found this XML code for creating an animation of Activity transition shrinking from all sides to the middle. You know, like the effect in iPhone. The problem was, the result did not work.
For the Activity that is assigned this transition, you would want the new Activity to still appear and have the old one shrink to middle. It took me quite a bit to figure this out.
For this effect to properly work, you need to add the attribute android:zAdjustment=”top” to ensure that the old Activity will be displayed to front, shrinking to the middle while the new Activity stays idle in the background.
Here is the XML code.
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<scale xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fromXScale="1.0" android:toXScale="0.0" android:fromYScale="1.0" android:toYScale="0.0" android:pivotY="50%" android:pivotX="50%" android:fillAfter="false" android:zAdjustment="top" android:duration="500" /> |
tags: activity, middle, shrink, shrink to middle, transition
No Comments
Android: Left To Right, Right To Left Activity Transition In XML
Posted by blogmeister on
June 10, 2011
|
1 2 3 4 5 6 |
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <translate android:fromXDelta="0%" android:toXDelta="100%" android:fromYDelta="0%" android:toYDelta="0%" android:duration="700"/> </set> |
|
1 2 3 4 5 6 7 8 |
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_decelerate_interpolator"> <translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="700" /> </set> |
Grow From Middle XML Activity Transition In Android
Posted by blogmeister on
June 7, 2011
Here is what I have come up with an XML file for an animation transition of an activity that expands from the center most to all sides.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?xml version="1.0" encoding="utf-8"?> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:fromXScale="0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" android:pivotY="50%" android:pivotX="50%" android:fillAfter="false" android:startOffset="200" android:duration="50" /> |
You may want to change the android:duration attribute value during your testing so you can see the animation clearly.
Donations appreciated. Every little $ helps. Or click Google +1.









