博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
欢迎界面旋转进入
阅读量:7046 次
发布时间:2019-06-28

本文共 1980 字,大约阅读时间需要 6 分钟。

 

 


image_progress.xml
 
public class WelcomeActivity extends Activity {    private RelativeLayout rl_welcome_root;    private Handler handler  = new Handler(){        public void handleMessage(android.os.Message msg) {            if(msg.what==1) {                startActivity(new Intent(WelcomeActivity.this, SetupGuide1Activity.class));                //关闭自己                finish();            }        }    };    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_welcome);                rl_welcome_root = (RelativeLayout) findViewById(R.id.rl_welcome_root);                //显示动画        showAnimation();                //发送延迟3s的消息        handler.sendEmptyMessageDelayed(1, 3000);    }    /**     * 显示动画     *      * 旋转动画  RotateAnimation: 0-->360 视图的中心点 2s     * 透明度动画 AlphaAnimation: 0-->1 2s     * 缩放动画 ScaleAnimation: 0-->1 视图的中心点 2s     */    private void showAnimation() {        //旋转动画  RotateAnimation: 0-->360 视图的中心点 2s        RotateAnimation rotateAnimation = new RotateAnimation(0, 360,                 Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);        rotateAnimation.setDuration(2000);        //透明度动画 AlphaAnimation: 0-->1 2s        AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);        alphaAnimation.setDuration(2000);        //缩放动画 ScaleAnimation: 0-->1 视图的中心点 2s        ScaleAnimation scaleAnimation = new ScaleAnimation(0, 1, 0, 1,                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);        scaleAnimation.setDuration(2000);        //创建复合动画,并添加        AnimationSet animationSet = new AnimationSet(true);        animationSet.addAnimation(rotateAnimation);        animationSet.addAnimation(alphaAnimation);        animationSet.addAnimation(scaleAnimation);        //启动        rl_welcome_root.startAnimation(animationSet);    }}

 

转载于:https://www.cnblogs.com/znsongshu/p/9365355.html

你可能感兴趣的文章
Unity Mathf/Math数学运算函数说明全集(Chinar总结)
查看>>
关于图片的存与读
查看>>
Windows 2012 AD配置
查看>>
LeetCode c语言-Rotate Image
查看>>
神经网络和深度学习 - 一些公式
查看>>
Kafka相关概念及核心配置说明
查看>>
Redis源码研究--跳表
查看>>
pymysql-sqlalchemy-orm
查看>>
易·school使用体验
查看>>
使用cxf构建webservice
查看>>
19.Kubernetes深入Pod之容器共享Volume
查看>>
Makefile中的变量和shell变量
查看>>
<转>ThinkPHP的开发常用系统配置项
查看>>
真正的让iframe自适应高度 兼容多种浏览器随着窗口大小改变
查看>>
tomcat部署项目(war文件)
查看>>
大数据多维分析平台的实践
查看>>
Python常用函数
查看>>
二分法习题HDU2199
查看>>
strcpy,sprintf,memcpy的区别
查看>>
ucore-lab1-练习4report
查看>>