|
|
package net.micode.notes.ui;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Looper;
|
|
|
import android.view.MotionEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.WindowInsets;
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
|
import net.micode.notes.databinding.ActivitySplashBinding;
|
|
|
import net.micode.notes.R;
|
|
|
|
|
|
/**
|
|
|
* An example full-screen activity that shows and hides the system UI (i.e.
|
|
|
* status bar and navigation/system bar) with user interaction.
|
|
|
*/
|
|
|
public class SplashActivity extends AppCompatActivity {
|
|
|
/**
|
|
|
* Whether or not the system UI should be auto-hidden after
|
|
|
* {@link #AUTO_HIDE_DELAY_MILLIS} milliseconds.
|
|
|
*/
|
|
|
private static final boolean AUTO_HIDE = true;
|
|
|
|
|
|
/**
|
|
|
* If {@link #AUTO_HIDE} is set, the number of milliseconds to wait after
|
|
|
* user interaction before hiding the system UI.
|
|
|
*/
|
|
|
private static final int AUTO_HIDE_DELAY_MILLIS = 3000;
|
|
|
|
|
|
Handler mHandler=new Handler();
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState); //加载启动界面
|
|
|
setContentView(R.layout.activity_splash); //加载启动图片
|
|
|
|
|
|
// 当计时结束时,跳转至NotesListActivity
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
Intent intent=new Intent();
|
|
|
intent.setClass(SplashActivity.this, NotesListActivity.class);
|
|
|
startActivity(intent);
|
|
|
finish(); //销毁欢迎页面
|
|
|
}
|
|
|
}, 2000); // 2 秒后跳转
|
|
|
}
|
|
|
} |