package gongzibai.co.cc;
import android.graphics.Matrix;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;
public class TV extends Animation {
private int halfWidth;
private int halfHeight;
@Override
public void initialize(int width, int height, int parentWidth,
int parentHeight) {
// TODO Auto-generated method stub
super.initialize(width, height, parentWidth, parentHeight);
setDuration(800);
setFillAfter(true);
// 保存View的中心点
halfWidth = width / 2;
halfHeight = height / 2;
setInterpolator(new AccelerateDecelerateInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
// TODO Auto-generated method stub
super.applyTransformation(interpolatedTime, 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);
}
}
}
--------配合定时器 使用:
mLinearLayout.startAnimation(new TVOffAnimation());
new Timer().schedule(new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
android.os.Process.killProcess(android.os.Process.myPid());
}
}, 1000);
分享到:
相关推荐
Android程序研发源码Android View中添加Animation
Android应用源码之animation_Android
Android-android-ui-animation-components-and-libraries.zip,android ui库、组件和动画作者@ramotion-https://github.com/ramotion/swift-ui-animation-components-libraries,安卓系统是谷歌在2008年设计和制造的。...
Android 动画 Animation Demo
Android的动画Animation详解 Android的动画Animation详解
安卓Android源码——(Animation动画).rar
比较全的android动画例子,包括基础的tween animation,这个就不必说了,还有比较新的属性动画:property animation
android 动画效果之Animation的一个绚丽demo
Android ViewFlipper Animation 使用
Android 开发应用源码 参考学习使用
见博客:http://blog.csdn.net/baidu_nod/article/details/37810483
安卓Android源码——(Animation动画).zip
Android应用源码之animation1(_animation
Android 补间动画 Animation 各个动画的例子 Animation使用到自定义View里
代码为博客实例代码:http://blog.csdn.net/lmj623565791/article/details/38067475 有问题博客留言
Android animation图片移动效果
Android Animation Detailed Tutorial / Android 动画详尽教程 中文讲解(README)请直接点击对应标题 English explanation(or readme), Do not click on the title, please click on the tip ...
Android动画例子(AnimationExample),写了四种效果 alpha 渐变透明度动画效果 scale 渐变尺寸伸缩动画效果 translate 画面转换位置移动动画效果 rotate 画面转移旋转动画效果 文章:...
Android View中添加Animation.zip