I've tried almost exactly the same scenario.  It seems like the
fromXScale="1.0" does not match the actual apparent size of the view.
1.0 was quite a bit bigger than the original view size.  I also tried
all the combinations like you did.  It was not an emulator speed
issue, nor an inconsistency between emulator and hardware device.  It
was not a fillBefore or fillAfter issue, as far as I can tell, either.

For now, my workaround is to adjust the scale parameters downward by
an ugly arbitrary amount.  For example, fromXScale="0.83" seems to
smoothly match the un-animated size on my emulator and on my Galaxy S,
regardless of screen density.   I made my throb animation go from 0.83
to 1.05, instead of 1.0 to 1.2.  But I'm afraid this will just not
work on some other device and I'll be back where I started.

I thought maybe the problem was a miscalculation of view size
involving padding, but no such luck.  A layout with no padding,
margins, or scaling whatsoever shows the same bad scaling error.  I
may try to post a YouTube video of the emulator on a simple test-case,
but the quoted XML should be sufficient for anyone to see the issue.

On Dec 28 2010, 6:21 pm, iced <[email protected]> wrote:
> Hello,
> I'm new here and I don't know if this is the right place for my
> problem. Please excuse me if it's wrong.
> I want to create a scale animation where a view grows a bit from it's
> original size and then shrinks to it's old size.
> My XML file:
> <?xml version="1.0" encoding="utf-8"?>
> <set xmlns:android="http://schemas.android.com/apk/res/android";>
>         <scale
>                 android:repeatCount="infinite"
>                 android:fromXScale="1.0"
>                 android:toXScale="1.2"
>                 android:fromYScale="1.0"
>                 android:toYScale="1.2"
>                 android:pivotX="50%"
>                 android:pivotY="50%"
>                 android:duration="2000"
>                 android:startOffset="0" />
>         <scale
>                 android:repeatCount="infinite"
>                 android:fromXScale="1.2"
>                 android:toXScale="1.0"
>                 android:fromYScale="1.2"
>                 android:toYScale="1.0"
>                 android:pivotX="50%"
>                 android:pivotY="50%"
>                 android:duration="2000"
>                 android:startOffset="2000" />
> </set>
> When I start this animation the view object grows directly by the
> factor 1.2. Then the animation starts and the view grows and shrinks
> like I want it. After that there is another jump to the original size
> of the view. So there are two jumps, which I don't want and I don't
> know how to solve this problem.
> Please could you help me.
> Thank you

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to