LayoutAnimationController 用来为一个layout 或是viewgroup 包含的子view添加动画效果, Layout中的每个元素都会采用同一个动画效果,但开始时间不同。 子View动画的缺省开始时间为子View在Layout中的序号index 乘以 一个固定的时间间隔。 LayoutAnimationController 的子类可以重载getDelayForView(android.view.View)为子View定义动画开始时间,如GridLayoutAnimationController 根据子View的行和列来计算子View动画的开始时间。
本例为一GridView 设置Fade淡入 动画,使用App Launcher 中的图标作为数据源,参见Android ApiDemos示例解析(121):Views->Grid->1. Icon Grid。
为GridView 设置LayoutAnimation:
<GridView xmlns:android=”http://schemas.android.com/apk/res/android”
android:id=”@+id/grid”
android:layoutAnimation=”@anim/layout_grid_fade”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:padding=”10dp”
android:verticalSpacing=”10dp”
android:horizontalSpacing=”10dp”
android:numColumns=”auto_fit”
android:columnWidth=”60dp”
android:stretchMode=”columnWidth”
android:gravity=”center” />
layout_grid_fade.xml 定义如下:
<gridLayoutAnimation
xmlns:android=”http://schemas.android.com/apk/res/android”
android:rowDelay=”50%”
android:directionPriority=”column”
android:animation=”@anim/fade” />
- gridLayoutAnimation 为Grid中每个Cell定义对应的动画效果android:animation=@ anim/fade .
- columnDelay: 定义GridView列 动画延迟时间比率
- direction: 定义动画依次发生的方向。
- directionPriority: 动画发生的次序以行或是列优先。
- rowDelay: 定义GridView行 动画延迟时间比率
gridLayoutAnimation 为GridView定义了子Cell依次开始动画的顺序,每个Cell具体的动画由android:animation定义,本例使用@anim/fade 定义Grid每个Cell的动画效果(淡入)。
<alpha xmlns:android=”http://schemas.android.com/apk/res/android”
android:interpolator=”@android:anim/accelerate_interpolator”
android:fromAlpha=”0.0″ android:toAlpha=”1.0″
android:duration=”@android:integer/config_longAnimTime” />
相关推荐
NULL 博文链接:https://kakukemeit.iteye.com/blog/1806388
android apidemos代码的示例解析,讲的挺全的
最新版ApiDemos Android SDK 中带有很多例子,其中ApiDemo 详细介绍了Android 平台主要API,分成了 · App · Content · Graphics · Media · OS · Text · Views 几个大类,每个大类又分为几个小类,...
Android ApiDemos apk, 包括Android presentation双屏异显 demon, App>Activity>Presentation
demos :jdk-8u202-linux-arm64-vfp-hflt-demos.tar.gz
最新Android apidemos
demos :jdk-8u202-linux-x64-demos.tar.gz
api ------------- API目录 demos ------------- 本地demos目录 lib ------------- 框架源代码目录 index.htm ------------- 主页面 loading.gif ------------- loading图标 welcome.htm ------------- 欢迎页面 ...
<EhLib Archive> \ Demos \ DBVertGridEh.SimpleDemo \ Project1.dpr compiled project: <EhLib Archive> \ Demos \ Bin \ DBVertGridEh.SimpleDemo.Exe * There are changes in the grids inheritance tree: ...
API Demos 是 Google 为了 Android 开发者所提供的一个 Android API 合集,其中包含了很多的 API 范例,同时遵循了良好的代码规范,是一个值得开发者研究和学习的典型。android的ApiDemos,需要解压缩后使用。
Centos7离线安装文件 jdk-8u231-linux-x64.tar.gz压缩包 免费下载,现在博客都是付费文件,搞得头大,现在免费分享
<EhLib Archive> \ Demos \ DBVertGridEh.SimpleDemo \ Project1.dpr compiled project: <EhLib Archive> \ Demos \ Bin \ DBVertGridEh.SimpleDemo.Exe * There are changes in the grids inheritance tree: ...
android APIdemos,android 源码简单使用demos
demos :jdk-8u202-linux-arm32-vfp-hflt-demos.tar.gz
文件名称: jdk-8u231-solaris-x64-demos.tar.gz 文件大小: 8.43 MB (8,846,115 字节) MD5: 3b62803c4e86b40f1a83b68be7bce224 SHA1: 3aba5de2157163b949179a5b654494da05b4da9c SHA256: 774c5d41a1422d22d026eaaa39...
该Api Demos 源码是基于Android6.0 ,Eclipse下的,可以直接使用Android studio 导入工程即可。
Android 系统原生应用API示例程序集合,是初学Android 开发的重要参考资料 https://github.com/longtaoge
AndroidDemosStudio AndroidDemos ------- Android Studio
springBoot-demos springBoot-demos 1.springboot-invoke 2.springboot-demo2 3.springboot-static 4.springboot-redis 5springboot-quartz-cluster 6.springboot-shiro 7.springboot-admin 8.springboot-html 9....
Run demos in Assets/FairyGUI/Examples/Scenes. The UI project is in Examples-UIProject.zip, unzip it anywhere. Use FairyGUI Editor to open it. Using FairyGUI in Unity: * Place a UIPanel in scene by ...