NineOldAndroids:Android 3.0 Animation API的适配库
来源:互联网 发布:嵌入式软件培训学校 编辑:程序博客网 时间:2024/06/04 19:10
NineOldAndroids是一个让你可以在各个平台甚至1.0版本上都能使用 Honeycomb (Android 3.0) animation API的库,在Honeycomb之前Animation非常局限,所以3.x写出了新的api,现在你只要imports一下,你就能使用同样的api来创建各种动画效果,在各个早于Honeycomb平台上支持旋转,translation,alpha,缩放等效果。
api 使用起来和 Honeycomb API 一样,你只要把imports 改为 com.nineoldandroids.animation.*。
例如,你要创建一个垂直下落的视图
1
ObjectAnimator.ofFloat(myObject,
"translationY"
, -myObject.getHeight()).start();
如果你很熟悉动画api,你会发现这正是你使用原生api时候做的。唯一区别就是我们imports了com.nineoldandroids.animation. 而不是android.animation.ObjectAnimator
下面是一个例子,创建了背景从红变为绿又变为黑,
1
2
3
4
5
6
ValueAnimator colorAnim = ObjectAnimator.ofInt(
this
,
"backgroundColor"
,
/*Red*/
0xFFFF8080
,
/*Blue*/
0xFF8080FF
);
colorAnim.setDuration(
3000
);
colorAnim.setEvaluator(
new
ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
官方网站:http://nineoldandroids.com
GitHub:https://github.com/JakeWharton/NineOldAndroids
0 0
- NineOldAndroids:Android 3.0 Animation API的适配库
- Android -- NineOldAndroids animation 封装
- android的API Demos - - - animation
- Android-nineoldandroids框架的使用
- android nineoldandroids
- Android-nineoldandroids框架的使用(二)
- Android 2.2 API demos --- animation
- Android API Guides---Animation Resources
- Android API Guides---Property Animation
- Android API Guides---View Animation
- Android API Guides---Drawable Animation
- 【android动画开源库】nineoldandroids
- Android开源-NineOldAndroids
- Android属性动画 nineoldandroids
- Android开源NineOldAndroids
- nineoldandroids的使用
- Android API 包解析02-android.animation
- NineOldAndroids
- java验证码识别--1
- mysql视图和触发器
- 11.2.1.2 在 F# 中写单元测试
- java验证码识别--2
- 关于Oracle 的url 连接 最后一个orcl的理解
- NineOldAndroids:Android 3.0 Animation API的适配库
- [leetcode]Binary Tree Postorder Traversal
- java验证码识别--3
- Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class org.crazyit
- Java SE 6 新特性: Instrumentation 新功能
- C++和java技术特性对比
- RDIFramework.NET ━ Web中打印的各种方案参考-欢迎补充
- display:inline、block、inline-block的区别
- QComboBox设置Item行高