package com.wd.workoffice.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.ui.activity.login.LoginActivity;
import com.wd.workoffice.ui.activity.mes.MesLoginActivity;
import com.wd.workoffice.ui.activity.user.UserPrivacyActivity;
import com.wd.workoffice.ui.activity.user.UserServerActivity;
import com.wd.workoffice.util.UserKeeper;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 选择角色
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MainLoginActivity extends WorkBaseActivity {


    @BindView(R.id.tv_bat)
    TextView tvBat;
    @BindView(R.id.tv_mes)
    TextView tvMes;
    @BindView(R.id.tv_server)
    TextView tvServer;
    @BindView(R.id.tv_privacy)
    TextView tvPrivacy;
    @BindView(R.id.activity_main)
    LinearLayout activityMain;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
    }

    @Override
    protected void initData() {
        if (!UserKeeper.getInstance().getIsAgree()) {
//            View view = LayoutInflater.from(this).inflate(R.layout.activity_about, null);
//            AlertDialog.Builder builder =new AlertDialog.Builder(this);
//
//            builder.setView(view).setNegativeButton("暂不使用", new DialogInterface.OnClickListener() {
//                @Override
//                public void onClick(DialogInterface dialog, int which) {
//                    dialog.dismiss();
//                }
//            }).setPositiveButton("确定", new DialogInterface.OnClickListener() {
//                @Override
//                public void onClick(DialogInterface dialog, int which) {
//                    dialog.dismiss();
//                    UserKeeper.getInstance().keepIsAgree(true);
//                }
//            }).show();
        }
    }


    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_main_login;
    }


    @OnClick({R.id.tv_bat, R.id.tv_mes, R.id.tv_server, R.id.tv_privacy})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_bat:
                startActivity(LoginActivity.class);
                break;
            case R.id.tv_mes:
                startActivity(MesLoginActivity.class);
                break;
            case R.id.tv_server:
                startActivity(UserServerActivity.class);
                break;
            case R.id.tv_privacy:
                startActivity(UserPrivacyActivity.class);
                break;
        }
    }
}
