rebound是facebook的开源动画库
网址:http://www.jcodecraeer.com/a/opensource/2015/0121/2338.html
介绍:
运行效果:

使用说明:
1.首先添加Rebound库依赖
Rebound提供了三种方式引入,当然在Android Studio下还是推荐使用Gradle方式。
添加Gradle依赖(推荐)
dependencies {
compile 'com.facebook.rebound:rebound:0.3.6'
}
下载Rebound Jar文件,导入工程,添加Maven依赖
<dependency>
<groupId>com.facebook.rebound</groupId>
<artifactId>rebound</artifactId>
<version>0.3.</version>
</dependency>
2.首先创建一个SpringSystem对象
SpringSystem mSpringSystem = SpringSystem.create();
3.添加一个“弹簧”到系统
Spring mSpring = mSpringSystem.createSpring();
4.添加监听器
mSpring.addListener(this);
//实现SpringListener接口,需要实现下面方法
@Override
public void onSpringUpdate(Spring spring) {
}
@Override
public void onSpringAtRest(Spring spring) {
}
@Override
public void onSpringActivate(Spring spring) {
}
@Override
public void onSpringEndStateChange(Spring spring) {
}
5.设置动画结束值
mSpring.setEndValue(1f);
6.在弹簧更新数据是对图片进行对应伸缩
public void onSpringUpdate(Spring spring) {
float value = (float) spring.getCurrentValue();
float scale = 1f - (value * 0.5f);
mImageToAnimate.setScaleX(scale);
mImageToAnimate.setScaleY(scale);
}
通过上面几个步骤可以很方便的实现弹簧阻尼效果的图片伸缩。
参考 :http://qichaochen.github.io/2014/11/21/107-Facebook-Rebound-Demo/
rebound是facebook的开源动画库的更多相关文章
- Facebook开源动画库 POP-POPBasicAnimation运用
动画在APP开发过程中还是经常出现,将花几天的时间对Facebook开源动画库 POP进行简单的学习:本文主要针对的是POPBasicAnimation运用:实例源代码已经上传至gitHub,地址:h ...
- 第三方开源动画库EasyAnimation中一个小bug的修复
看过iOS动画之旅的都知道,其中在最后提到一个作者写的开源动画库EasyAnimation(以下简称EA). EA对CoreAnimation中的view和layer动画做了更高层次的包装和抽象,使得 ...
- Lottie安卓开源动画库使用
碉堡的Lottie Airbnb最近开源了一个名叫Lottie的动画库,它能够同时支持iOS,Android与ReactNative的开发.此消息一出,还在苦于探索自定义控件各种炫酷特效的我,兴奋地就 ...
- Facebook 开源动画库 pop
官网:https://github.com/facebook/pop Demo: https://github.com/callmeed/pop-playground 一:pop的基本构成: POPP ...
- 使用 Facebook开源动画库 POP 实现真实衰减动画
1. POP动画基于底层刷新原理.是基于CADisplayLink,1秒钟运行60秒,接近于游戏开发引擎 @interface ViewController () @property (nonatom ...
- Facebook开源动画库 POP-小实例
实例1:图片视图跟着手在屏幕上的点改变大小 - (void)viewDidLoad { [super viewDidLoad]; //添加手势 UIPanGestureRecognizer *gest ...
- Facebook开源动画库 POP-POPDecayAnimation运用
关于POPDecayAnimation的介绍先引用别人写的一些内容,基本上把它的一些注意点都说明了: Decay Animation 就是 POP 提供的另外一个非常特别的动画,他实现了一个衰减的效果 ...
- Facebook开源动画库 POP-POPSpringAnimation运用
POPSpringAnimation也许是大多数人使用POP的理由 其提供一个类似弹簧一般的动画效果:实例源代码已经上传至gitHub,地址:https://github.com/wujunyang/ ...
- Facebook的Pop动画库相关资料
https://github.com/facebook/pop http://www.cocoachina.com/industry/20140507/8339.html http://www.ui. ...
随机推荐
- 基于Bootstrap的下拉框插件bootstrap-select
写在前面: 在这次的项目中,没有再使用liger-ui做为前端框架了,改为了Bootstrap,这次也好接触下新的技术,在学习的过程中发现,Bootstrap的一些组件基本都是采用class的形式,就 ...
- 学习Flash 3D图形图像知识的网络资源集合
1. 华中科技大学计算机学院开放式课程--计算机图形学 http://cs.hust.edu.cn/webroot/courses/csgraphics/index.php 2.深入Stage3D_7 ...
- UIPanGestureRecognizer判断滑动的方向
.h文件 CGFloat const gestureMinimumTranslation = 20.0 ; typedef enum : NSInteger { kCameraMoveDirectio ...
- SSMS查看表行数以及使用空间 How to show table row count and space used in SSMS - SSMS Tutorials
原文:How to show table row count and space used in SSMS - SSMS Tutorials There's a quick and convenien ...
- easyui text-box multiline
//多行文本输入框 <input id="payDescribe" class="easyui-textbox" data-options="m ...
- [置顶]
kubernetes创建资源yaml文件例子--pod
kubernetes创建pod的yaml文件,参数说明 apiVersion: v1 #指定api版本,此值必须在kubectl apiversion中 kind: Pod #指定创建资源的角色/类型 ...
- ncurses简单的一个多窗体程序
#include <ncurses.h> #include <string.h> #include <iostream> #include <stdlib.h ...
- 为什么输入shutdown -h -t会报错:command not fount
如果是直接用普通用户($)的身份进行输入[user@localhost ~]$ shutdown -h -t 是不能执行,因为普通用户没有关闭机器的权限. 然而直接使用[user@localhost ...
- tensorflow cnn+rnn基本结构
#CNN x = tf.placeholder(tf.float32,[None,input_node],name="x_input") y_ = tf.placeholder(t ...
- 转: javascript技术栈
http://www.infoq.com/cn/articles/state-of-javascript-2016