一.隐藏状态栏和标题栏的方法
1、在styles.xml文件中自定义一个style:
<style name="NoTitle" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
2.在AndroidManifest中修改Activiy的Theme:
<activity android:name=".MainActivity"
android:theme="@style/NoTitle">
二.闪屏动画设置
linearLayout = findViewById(R.id.row);
//旋转
RotateAnimation rotateAnimation = new RotateAnimation(0,360, Animation.RELATIVE_TO_SELF,0.5f);//基于自身中心点旋转360度
rotateAnimation.setDuration(1000);//动画时间:1秒钟
rotateAnimation.setFillAfter(true);//保持住动画结束的状态
//缩放
ScaleAnimation scaleAnimation = new ScaleAnimation(0,1,0,1,Animation.RELATIVE_TO_SELF,0.5f);
scaleAnimation.setDuration(1000);
scaleAnimation.setFillAfter(true);
//渐变
AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
alphaAnimation.setDuration(2000);
alphaAnimation.setFillAfter(true);
//动画集合
AnimationSet set = new AnimationSet(false);
set.addAnimation(rotateAnimation);
set.addAnimation(scaleAnimation);
set.addAnimation(alphaAnimation);
//启动动画
linearLayout.startAnimation(set);
三.动画的监听和闪屏页面结束的跳转
set.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
//动画结束
//跳到新手引导页
startActivity(new Intent(getApplicationContext(), GuideActivity.class));
finish();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});