android - Scaling animation on an already scaled view -


i'm animating imageview using following scale animations:

<?xml version="1.0" encoding="utf-8"?>  <set    xmlns:android="http://schemas.android.com/apk/res/android"      android:shareinterpolator="false">     <scale         android:interpolator="@android:anim/accelerate_interpolator"         android:fromxscale="1.0"         android:toxscale="2.0"         android:fromyscale="1.0"         android:toyscale="2.0"         android:pivotx="50%"         android:pivoty="50%"         android:duration="1000" />      <scale         android:interpolator="@android:anim/accelerate_interpolator"         android:fromxscale="2.0"         android:toxscale="0.0"         android:fromyscale="2.0"         android:toyscale="0.0"         android:pivotx="50%"         android:pivoty="50%"         android:startoffset="1000"         android:duration="1000" />      <rotate xmlns:android="http://schemas.android.com/apk/res/android"         android:fromdegrees="0"         android:interpolator="@android:anim/linear_interpolator"         android:todegrees="360" android:pivotx="50%" android:pivoty="50%"         android:repeatcount="3"         android:duration="800" android:startoffset="0" /> </set> 

but problem imageview scaled layout, when first animation begins. leads noticeable jump in size, when first animation sets scale 1.0 .

is there way of telling animation should start actual size of view in layout? tried working percentages, produced same effect.

from understand query wanna make animation smoother, avoiding noticeable scale animation @ beginning. think minimizing 'from scale' in first scale avoid jump, maybe help:

<?xml version="1.0" encoding="utf-8"?> 

<scale     android:duration="1000"     android:fromxscale="0.5"     android:fromyscale="0.5"     android:interpolator="@android:anim/accelerate_interpolator"     android:pivotx="50%"     android:pivoty="50%"     android:toxscale="1.0"     android:toyscale="1.0" /> <scale     android:duration="1000"     android:fromxscale="1.0"     android:fromyscale="1.0"     android:interpolator="@android:anim/accelerate_interpolator"     android:pivotx="50%"     android:pivoty="50%"     android:startoffset="1000"     android:toxscale="1.0"     android:toyscale="1.0" />  <rotate     xmlns:android="http://schemas.android.com/apk/res/android"     android:duration="800"     android:fromdegrees="0"     android:interpolator="@android:anim/linear_interpolator"     android:pivotx="50%"     android:pivoty="50%"     android:repeatcount="3"     android:startoffset="0"     android:todegrees="360" /> 

sorry keep waiting; try this:

<?xml version="1.0" encoding="utf-8"?> 

<scale     android:duration="400"     android:fromxscale="1"     android:fromyscale="1"     android:pivotx="20%"     android:pivoty="20%"     android:repeatcount="1"     android:repeatmode="reverse"     android:toxscale="1.1"     android:toyscale="1.1" /> 


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -