XML parameter parsing for Android animation

Source: Internet
Author: User
Tags time in milliseconds

This blog is mainly about the animation XML parameters before the 3.0 property animation


1 Alpha Gradient Transparency animation effect

<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    <Alphaandroid:duration= "+"Android:fromalpha= "0.0"Android:toalpha= "1.0" />    <!--transparency controls the animation effect Alpha Float value: The Fromalpha property is the Transparency Toalpha property at the beginning of the animation when the transparency description is at the end of the animation: 0.0 indicates full transparency 1.0 represents a full opacity above value takes a numeric long integer value between 0.0-1.0 and the float data type: dur ation property for animation duration Description: Time in milliseconds -</Set>

2 scale gradient Resize animation effect

<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    < Scaleandroid:duration= "+"Android:fillafter= "false"Android:fromxscale= "0.0"Android:fromyscale= "0.0"Android:interpolator= "@android: Anim/accelerate_decelerate_interpolator"Android:pivotx= "50%"Android:pivoty= "50%"Android:toxscale= "1.4"Android:toyscale= "1.4" /></Set><!--     Size Stretch animation effect Scale property: interpolator Specifies an animated insert during my trial, there are three types of animation inserts found when using resources in Android.res.anim: Accelerate_decelerate_interpolator acceleration-deceleration animation Insert accelerate_interpolator acceleration-Animation Insert Decelerate_                Interpolator Deceleration-Animation insert other specific animation effects floating-point values: The Fromxscale property is the scaling dimension on the x-coordinate at the start of the animation The Toxscale property is the scaling dimension on the x-coordinate at the end of the animation Fromyscale property is the scaling dimension on the y-coordinate at the start of the animation Toyscale property is the end of the animation y Scaling dimensions on coordinates description: 0.0 of the above four attribute values means that there is no 1.0 table Show normal no scaling value less than 1.0 means that the shrinkage value is greater than 1.0 indicates that the magnification Pivotx property is the start bit of an animation relative to the X coordinate of the object                    The Pivoty property is the start position of the animation relative to the object's y-coordinate: The above two attribute values are taken from the 0%-100% value            50% is the long value of the midpoint position on the x or y-coordinate of the object: The Duration property is the animation duration description: The time is in milliseconds Boolean value: Fillafter property when set to TruE, the animation is converted at the end of the animation is applied  -

3 Translate picture conversion position move animation effect

<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    <Translateandroid:duration= "$"Android:fromxdelta= "+"Android:fromydelta= "+"Android:toxdelta= " -80"Android:toydelta= "+" />    <!--Translate position transfer animation effect integer value: The Fromxdelta property is the position on the x-coordinate at the start of the animation Toxdelta property is the position on the x-coordinate at the end of the animation The Fromydelta property is the position of the y-coordinate at the start of the animation Toydelta property is the position of the y-coordinate at the end of the animation note: no FromX specified Type Toxtype fromytype Toytype, the default is to use their own relative reference long Integer value: The Duration property for the animated continuous Time Description: The time is measured in milliseconds -</Set>

4 Rotate Picture Transfer rotation animation effect

<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    <Rotateandroid:duration= " the"android:fromdegrees= "0"Android:interpolator= "@android: Anim/accelerate_decelerate_interpolator"Android:pivotx= "50%"Android:pivoty= "50%"android:todegrees= "+350" />    <!--      Rotate rotation Animation effect properties: interpolator Specifies an animated insert during my trial, there are three types of animation inserts found when using resources in Android.res.anim: Accelerate_decelerate_interpolator acceleration-deceleration animation Insert accelerate_interpolator acceleration-Animation plug                                  Decelerate_interpolator Deceleration-Animation insert other animation effects that belong to a specific Floating-point value: The Fromdegrees property is the angle of the object at the start of the animation Todegrees property is at the end of the animation the angle of the object rotation can be greater than 360 degrees description : When the angle is negative--indicates counterclockwise rotation when the angle is positive--Indicates a clockwise rotation (negative from--to positive number: Clockwise rotation) (negative from--to negative: counterclockwise) (positive from--to positive: clockwise rotation) (positive from-                            -to Negative Number: counterclockwise rotation) The Pivotx property is the start position of the animation relative to the object's x-coordinate Pivoty property is the beginning of the animation relative to the object's y-coordinate Note: The above two attribute values from the 0%-100% value 50% is the object's X or y-direction coordinates on the midpoint position Long value: Duration property is   Animation Duration Description:    The time is measured in milliseconds      -</Set>

XML parameter parsing for Android animation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.