Home > Article > Web Front-end > Android ViewAnimation (tween animation) document tutorial_html/css_WEB-ITnose
XML Notes:
In the res/anim/ directory, XML files can only have one of 24f1099f9619508d54708efab3f9bd10, e6daa5bbc143175d94fbdc249c25497d, fb5a520f6fc95a97c3f55791f494901c, 6e35d18b018e6775a1871abc0d3f5e5d The default animation under the root element and set tag is performed at the same time. If you want to perform it sequentially, you need the startOffset element.
Pay attention to the intermediate coordinates of >
<set android:shareInterpolator="false"> <scale android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromXScale="1.0" android:toXScale="1.4" android:fromYScale="1.0" android:toYScale="0.6" android:pivotX="50%" android:pivotY="50%" android:fillAfter="false" android:duration="700" /> <set android:interpolator="@android:anim/decelerate_interpolator"> <scale android:fromXScale="1.4" android:toXScale="0.0" android:fromYScale="0.6" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:startOffset="700" android:duration="400" android:fillBefore="false" /> <rotate android:fromDegrees="0" android:toDegrees="-45" android:toYScale="0.0" android:pivotX="50%" android:pivotY="50%" android:startOffset="700" android:duration="400" /> </set></set>
Want to start animation at a specific time, You can use the Animation.setStartTime() method and set it to View through the View.setAnimation(). method.
ImageView spaceshipImage = (ImageView) findViewById(R.id.spaceshipImage);Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump);spaceshipImage.startAnimation(hyperspaceJumpAnimation);