ObjectAnimator设置动画
来源:互联网 发布:安卓蓝牙通信源码 编辑:程序博客网 时间:2024/05/23 17:59
public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); //查找控件 ImageView imageView = findViewById(R.id.action_image); //设置图片 Glide.with(this).load(R.drawable.splash) .apply(bitmapTransform(new CenterCrop())) .into(imageView); //设置位移 ObjectAnimator trans = ObjectAnimator.ofFloat(imageView, "translationY",0f, 500f); //设置缩放x ObjectAnimator scaleX = ObjectAnimator.ofFloat(imageView, "scaleX", 2f, 1f); //设置缩放y ObjectAnimator scaleY = ObjectAnimator.ofFloat(imageView, "scaleY", 2f, 1f); //设置透明到不透明 ObjectAnimator alpha = ObjectAnimator.ofFloat(imageView, "alpha", 0.0f, 1f).setDuration(1000); // 旋转为旋转一圈 ObjectAnimator rotation = ObjectAnimator.ofFloat(imageView, "rotation", 0f, 360f).setDuration(1000); //设置组合动画 AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(trans); animatorSet.play(scaleX); animatorSet.play(scaleY); animatorSet.play(alpha); animatorSet.play(rotation); //设置时间,启动 animatorSet.setDuration(3000).start(); //设置监听 animatorSet.addListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } //结束的方法 @Override public void onAnimationEnd(Animator animation) { Intent intent = new Intent(SplashActivity.this,GoodContActivity.class); startActivity(intent); finish(); } @Override public void onAnimationCancel(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } }); }}
阅读全文
0 0
- 使用ObjectAnimator设置动画
- ObjectAnimator设置动画
- 浅谈ObjectAnimator设置动画
- ObjectAnimator设置动画
- ObjectAnimator设置动画
- ObjectAnimator动画
- ObjectAnimator如何设置PivotX(属性动画如何设置起始点)
- fragment设置关于translationY属性的objectAnimator属性动画
- 属性动画ObjectAnimator
- ObjectAnimator动画使用
- 属性动画之ObjectAnimator
- 属性动画之ObjectAnimator
- 属性动画ObjectAnimator
- ObjectAnimator 动画小技巧
- 动画[4]PropertyAnimator ObjectAnimator
- Android动画-属性动画-ObjectAnimator
- android 动画 属性动画 ObjectAnimator
- Android - ObjectAnimator set pivot value属性动画设置放大时的中心点设置
- QT下载地址
- Reflection2017.12.20
- 关于金融信息系统基础大作业——ATM系统(不限要求)
- 网狐荣耀316版本出现“诈金花下载失败,错误码:7,92的解决办法
- 2017年浙江中医药大学大学生程序设计竞赛-D:CC的神奇背包(思维)
- ObjectAnimator设置动画
- 传统机器视觉相关知识点汇总
- Android 安卓使用VideoView播放本地视频
- 多目标跟踪:Simple Online and Realtime Tracking with a Deep Association Metric 2017 (deep-sort)
- 写了一个最简单的 js 模板引擎,直接贴代码
- 排序算法——堆排序
- bzoj 2724: [Violet 6]蒲公英 区间众数 分块
- oracle最大连接数、连接信息
- Maven依赖传递