package com.longtu.sample;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;

import com.longtu.sdk.utils.Log.Logs;
import com.longtugame.globalsample.R;

import static com.longtu.sample.LTBase_Demo_MainActivity.AutoLogin;
import static com.longtu.sample.LTBase_Demo_MainActivity.LOGTAG;

/**
 * 作者：liqingshuo on 11/19/20 16:22
 *
 * @author liqingshuo
 */
public class LTBase_Demo_LogoActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.longtu_demo_login);
        AlertDialog.Builder dialog = new AlertDialog.Builder(LTBase_Demo_LogoActivity.this);
        dialog.setTitle("提示");
        dialog.setMessage("初始化成功时候 是否自动调用登录 \n 用于模拟游戏自动调用登录的情况。");
        dialog.setCancelable(false);
        dialog.setPositiveButton("手动登录", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {


                Logs.i(LOGTAG,
                        " autoLogin = " + "false");
                jumpGameActivity();
            }
        });
        dialog.setNegativeButton("自动登录", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                LTBase_Demo_MainActivity.AutoLogin = true;
                Logs.i(LOGTAG,
                        " autoLogin = " + "true");
                jumpGameActivity();
            }

        });
        dialog.show();


    }


    /**
     * 授权以后 进入游戏
     */
    private void jumpGameActivity() {
        Intent intent = new Intent(this, LTBase_Demo_MainActivity.class);
        startActivity(intent);
        this.finish();
    }


}
