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.tags: activity, animation, expand, grow from middle, transition, xml
No Comments
Side To Left Animation XML In Android
Posted by blogmeister on
April 4, 2011
Here is an XML file for a slide to left animation transition in Android.
|
1 2 3 4 |
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator"> <translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="500" /> </set> |
tags: android. xml, animation, left, slide
1 Comment
Android: How To Hold Activity During Animation
Posted by blogmeister on
March 30, 2011
So you have finally succeeded in creating an animation transition in Android from one Activity to the next. But then, you noticed that when that happens, there is a short blackout of a black background then displaying the animation of the next Activity you want to display.
Problem then is, how do you hold the first Activity intact so the second Activity will animate and overlap the first Activity? I have sifted through numerous forums and I have found no solution to that programmatically. If you have a solution, do feel free to post a comment here.
The workaround hack I found is to create a dummy animation XML file with a delay attribute in it so that the first Activity will stay still while the second Activity does its animated transition.
|
1 2 3 4 |
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:fromXDelta="0" android:toXDelta="0" android:duration="2000" /> |
The android:duration attribute is the delay that I was talking about earlier. This value is in milliseconds so the value 2000 means 2 seconds and using this will make the first Activity stay still for 2 seconds. You can change it to any value you want.
Donations appreciated. Every little $ helps. Or click Google +1.









