package com.demo;
import android.graphics.Matrix;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;
/**
* @author Roger Zhang
*/
public class TVOffAnimation extends Animation {
private int halfWidth;
private int halfHeight;
@Override
public void initialize(int width, int height, int parentWidth,
int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
setDuration(500);
setFillAfter(true);
//保存View的中心点
halfWidth = width / 2;
halfHeight = height / 2;
setInterpolator(new AccelerateDecelerateInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
final Matrix matrix = t.getMatrix();
if (interpolatedTime < 0.8) {
matrix.preScale(1+0.625f*interpolatedTime, 1-interpolatedTime/0.8f+0.01f,halfWidth,halfHeight);
}else{
matrix.preScale(7.5f*(1-interpolatedTime),0.01f,halfWidth,halfHeight);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
电视机Android系统自动关闭的动画效果代码
共26个文件
class:9个
png:4个
java:3个
4星 · 超过85%的资源 需积分: 35 18 下载量 187 浏览量
2012-03-21
16:36:06
上传
评论
收藏 433KB RAR 举报
温馨提示
最近研究android的Animation 做了几个小动画 分享给大家~ 大家都看过老式电视机关闭的时候画面一闪消失的那个效果吧~ 觉得那个不错~就试着做一个~
资源推荐
资源详情
资源评论
收起资源包目录
TVOffDemo.rar (26个子文件)
.project 845B
default.properties 362B
bin
TVOffDemo.apk 144KB
com
demo
R$string.class 397B
R$layout.class 364B
R$drawable.class 396B
TVOffDemo.class 893B
R.class 461B
TVOffDemo$1.class 902B
R$attr.class 310B
TVOffAnimation.class 1KB
R$id.class 391B
resources.ap_ 141KB
classes.dex 4KB
proguard.cfg 1KB
AndroidManifest.xml 672B
src
com
demo
TVOffDemo.java 652B
TVOffAnimation.java 1KB
res
values
strings.xml 169B
layout
main.xml 580B
drawable-ldpi
bg.png 132KB
icon.png 2KB
drawable-hdpi
icon.png 4KB
drawable-mdpi
icon.png 3KB
.classpath 280B
gen
com
demo
R.java 832B
assets
共 26 条
- 1
资源评论
- 弥勒长生佛2014-05-05这个分数太贵了,不是很值得啊
- 菜鸟叨叨2012-12-27有点简单,但能说明问题
- lovingqiaoyan7892013-09-23动画写的很简单,但是效果是出来的,学习了
- 金满溢2013-04-02有点简单,但能说明问题 .
huazi_888
- 粉丝: 2
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功