package com.sf.sdk.demo;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.sf.sdk.SFPlatform;

@SuppressLint("CustomSplashScreen")
public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        SFPlatform.getInstance().setDebugMode(true);                    // 正式发布时设置为false
        // 展示启动画面(2000毫秒后自动消失)
        SFPlatform.getInstance().getUIService().showSplashScreenForSofish(this, false, 2000L);

        getWindow().getDecorView().postDelayed(new Runnable() {
            @Override
            public void run() {
                gotoMainPage();
            }
        }, 2000L);
    }

    private void gotoMainPage() {
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }

}