0

i`m trying to make some animation for activity transtion. I used solution from: Transition Animation Between Activities with AnimationSet

Now i can set animations. But...

Running that animation

    <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <translate
        android:duration="1000"
        android:fromXDelta="0%"
        android:interpolator="@android:anim/linear_interpolator"
        android:toXDelta="50%" />
    <translate
        android:duration="1000"
        android:fromXDelta="50%"
        android:interpolator="@android:anim/linear_interpolator"
        android:startOffset="1000"
        android:toXDelta="100%" />

</set>

Results in appear activity in middle of screen, than slide out right.

To see animation from left to right (such that it starts at left edge of screen, and finishes when layout leaves screen) i need to use such that set:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

    <translate
        android:duration="1000"
        android:fromXDelta="-50%"
        android:interpolator="@android:anim/linear_interpolator"
        android:toXDelta="0%" />
    <translate
        android:duration="1000"
        android:fromXDelta="50%"
        android:interpolator="@android:anim/linear_interpolator"
        android:startOffset="1000"
        android:toXDelta="100%" />

</set>

Now the question. Why? I know i cant rely on this solution, because it's strange, maybe you know some way to solve this problem.

2
  • why are you using an animation set?? only a single translate animation from left to right will work for the slide out transition.
    – karn
    Oct 3, 2012 at 10:34
  • I`m trying to have some complex animation, just posted sample code, to show what i mean, without posting unnecessary code.
    – Drake29a
    Oct 3, 2012 at 12:07

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.