文件名称:android_LayoutAnimationController
介绍说明--下载内容均来自于网络,请自行研究使用
如果我们需要一个界面中的多个控件按照相同的动画方式但是每个控件完成该动画的时刻不同的话,就可采用本节讲的LayoutAnimationController来方便的完成了。 参考资料为Mars老师的教程,http://www.mars-droid.com/.
首先我们来看看用java代码怎么完成该功能,主要遵循以下步骤:
在anim下新建一个xml文件,该文件里面设置了控件的动态效果,所以根标签为set。
在java代码中新建一个Animation对象,采用AnimationUtils.loadAnimation()的方法获得,该方法有一个输入参数及anim下的xml文件id。
新建一个LayoutAnimationController对象,输入参数为上一步新建的Animation对象。
设置改LayoutAnimationController对象的属性,比如控件出场的顺序(该顺序主要有随机,从头到尾,反向3种),控件出现的间隔时间等。
在布局文件中加载该LayoutAnimationController对象。-If we need more controls in one interface in accordance with the same animation, but each control to complete the moment of the animation, you can use this section stresses the LayoutAnimationController convenient. Reference to Mars teacher tutorials, http://www.mars-droid.com/ First, we look at how to complete the java code, the following steps: Create a new xml file in anim, the file set the dynamic effect of the control, so the root tag for the set. Java code create a new Animation object, using AnimationUtils.loadAnimation () methods, this method has one input parameter and the anim under the xml file id. New one LayoutAnimationController object on the input parameters for the step by the new Animation object. Set Changing LayoutAnimationController object properties, such as control the appearance of order (the order of the main random, from start to finish, three kinds of reverse), the controls appear interval. Load the LayoutAnimationController objects in the layout file.
首先我们来看看用java代码怎么完成该功能,主要遵循以下步骤:
在anim下新建一个xml文件,该文件里面设置了控件的动态效果,所以根标签为set。
在java代码中新建一个Animation对象,采用AnimationUtils.loadAnimation()的方法获得,该方法有一个输入参数及anim下的xml文件id。
新建一个LayoutAnimationController对象,输入参数为上一步新建的Animation对象。
设置改LayoutAnimationController对象的属性,比如控件出场的顺序(该顺序主要有随机,从头到尾,反向3种),控件出现的间隔时间等。
在布局文件中加载该LayoutAnimationController对象。-If we need more controls in one interface in accordance with the same animation, but each control to complete the moment of the animation, you can use this section stresses the LayoutAnimationController convenient. Reference to Mars teacher tutorials, http://www.mars-droid.com/ First, we look at how to complete the java code, the following steps: Create a new xml file in anim, the file set the dynamic effect of the control, so the root tag for the set. Java code create a new Animation object, using AnimationUtils.loadAnimation () methods, this method has one input parameter and the anim under the xml file id. New one LayoutAnimationController object on the input parameters for the step by the new Animation object. Set Changing LayoutAnimationController object properties, such as control the appearance of order (the order of the main random, from start to finish, three kinds of reverse), the controls appear interval. Load the LayoutAnimationController objects in the layout file.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Android开发历程_10(LayoutAnimationController的初步使用).docx
anim_4\.classpath
......\.project
......\.settings\org.eclipse.jdt.core.prefs
......\AndroidManifest.xml
......\bin\AndroidManifest.xml
......\...\anim_4.apk
......\...\classes\com\example\anim_4\BuildConfig.class
......\...\.......\...\.......\......\MainActivity.class
......\...\.......\...\.......\......\R$anim.class
......\...\.......\...\.......\......\R$animator.class
......\...\.......\...\.......\......\R$attr.class
......\...\.......\...\.......\......\R$drawable.class
......\...\.......\...\.......\......\R$id.class
......\...\.......\...\.......\......\R$layout.class
......\...\.......\...\.......\......\R$menu.class
......\...\.......\...\.......\......\R$string.class
......\...\.......\...\.......\......\R$style.class
......\...\.......\...\.......\......\R.class
......\...\classes.dex
......\...\jarlist.cache
......\...\res\drawable-hdpi\ic_action_search.png
......\...\...\.............\ic_launcher.png
......\...\...\.........ldpi\icon1.png
......\...\...\.............\icon2.png
......\...\...\.............\icon3.png
......\...\...\.............\icon4.png
......\...\...\.............\icon5.png
......\...\...\.............\icon6.png
......\...\...\.............\icon7.png
......\...\...\.............\ic_launcher.png
......\...\...\.........mdpi\ic_action_search.png
......\...\...\.............\ic_launcher.png
......\...\...\.........xhdpi\ic_action_search.png
......\...\...\..............\ic_launcher.png
......\...\resources.ap_
......\gen\com\example\anim_4\BuildConfig.java
......\...\...\.......\......\R.java
......\ic_launcher-web.png
......\libs\android-support-v4.jar
......\proguard-project.txt
......\project.properties
......\res\anim\list_anim.xml
......\...\....ator\list_anim_layout.xml
......\...\drawable-hdpi\ic_action_search.png
......\...\.............\ic_launcher.png
......\...\.........ldpi\icon1.png
......\...\.............\icon2.png
......\...\.............\icon3.png
......\...\.............\icon4.png
......\...\.............\icon5.png
......\...\.............\icon6.png
......\...\.............\icon7.png
......\...\.............\ic_launcher.png
......\...\.........mdpi\ic_action_search.png
......\...\.............\ic_launcher.png
......\...\.........xhdpi\ic_action_search.png
......\...\..............\ic_launcher.png
......\...\layout\activity_main.xml
......\...\......\grid_item.xml
......\...\menu\activity_main.xml
......\...\values\strings.xml
......\...\......\styles.xml
......\...\......-v11\styles.xml
......\...\.........4\styles.xml
......\src\com\example\anim_4\MainActivity.java
......\bin\classes\com\example\anim_4
......\...\.......\...\example
......\gen\com\example\anim_4
......\src\com\example\anim_4
......\bin\classes\com
......\...\res\drawable-hdpi
......\...\...\drawable-ldpi
......\...\...\drawable-mdpi
......\...\...\drawable-xhdpi
......\gen\com\example
......\src\com\example
......\bin\classes
......\...\res
......\gen\com
......\res\anim
......\...\animator
......\...\drawable-hdpi
......\...\drawable-ldpi
......\...\drawable-mdpi
......\...\drawable-xhdpi
......\...\layout
......\...\menu
......\...\values
......\...\values-v11
......\...\values-v14
......\src\com
......\.settings
......\assets
......\bin
......\gen
......\libs
......\res
......\src
anim_4
anim_4\.classpath
......\.project
......\.settings\org.eclipse.jdt.core.prefs
......\AndroidManifest.xml
......\bin\AndroidManifest.xml
......\...\anim_4.apk
......\...\classes\com\example\anim_4\BuildConfig.class
......\...\.......\...\.......\......\MainActivity.class
......\...\.......\...\.......\......\R$anim.class
......\...\.......\...\.......\......\R$animator.class
......\...\.......\...\.......\......\R$attr.class
......\...\.......\...\.......\......\R$drawable.class
......\...\.......\...\.......\......\R$id.class
......\...\.......\...\.......\......\R$layout.class
......\...\.......\...\.......\......\R$menu.class
......\...\.......\...\.......\......\R$string.class
......\...\.......\...\.......\......\R$style.class
......\...\.......\...\.......\......\R.class
......\...\classes.dex
......\...\jarlist.cache
......\...\res\drawable-hdpi\ic_action_search.png
......\...\...\.............\ic_launcher.png
......\...\...\.........ldpi\icon1.png
......\...\...\.............\icon2.png
......\...\...\.............\icon3.png
......\...\...\.............\icon4.png
......\...\...\.............\icon5.png
......\...\...\.............\icon6.png
......\...\...\.............\icon7.png
......\...\...\.............\ic_launcher.png
......\...\...\.........mdpi\ic_action_search.png
......\...\...\.............\ic_launcher.png
......\...\...\.........xhdpi\ic_action_search.png
......\...\...\..............\ic_launcher.png
......\...\resources.ap_
......\gen\com\example\anim_4\BuildConfig.java
......\...\...\.......\......\R.java
......\ic_launcher-web.png
......\libs\android-support-v4.jar
......\proguard-project.txt
......\project.properties
......\res\anim\list_anim.xml
......\...\....ator\list_anim_layout.xml
......\...\drawable-hdpi\ic_action_search.png
......\...\.............\ic_launcher.png
......\...\.........ldpi\icon1.png
......\...\.............\icon2.png
......\...\.............\icon3.png
......\...\.............\icon4.png
......\...\.............\icon5.png
......\...\.............\icon6.png
......\...\.............\icon7.png
......\...\.............\ic_launcher.png
......\...\.........mdpi\ic_action_search.png
......\...\.............\ic_launcher.png
......\...\.........xhdpi\ic_action_search.png
......\...\..............\ic_launcher.png
......\...\layout\activity_main.xml
......\...\......\grid_item.xml
......\...\menu\activity_main.xml
......\...\values\strings.xml
......\...\......\styles.xml
......\...\......-v11\styles.xml
......\...\.........4\styles.xml
......\src\com\example\anim_4\MainActivity.java
......\bin\classes\com\example\anim_4
......\...\.......\...\example
......\gen\com\example\anim_4
......\src\com\example\anim_4
......\bin\classes\com
......\...\res\drawable-hdpi
......\...\...\drawable-ldpi
......\...\...\drawable-mdpi
......\...\...\drawable-xhdpi
......\gen\com\example
......\src\com\example
......\bin\classes
......\...\res
......\gen\com
......\res\anim
......\...\animator
......\...\drawable-hdpi
......\...\drawable-ldpi
......\...\drawable-mdpi
......\...\drawable-xhdpi
......\...\layout
......\...\menu
......\...\values
......\...\values-v11
......\...\values-v14
......\src\com
......\.settings
......\assets
......\bin
......\gen
......\libs
......\res
......\src
anim_4