package com.rv.rvmine.traveler;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
import com.yuyife.okgo.OkGoUtil;

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

/**
 * 设置
 */

public class SettingActivity extends BaseStatusActivity<CommonPresenter> {

    @Override
    protected int setLayout() {
        return R.layout.activity_setting;
    }


    public static Intent getIntent(Context context) {
        return new Intent(context, SettingActivity.class);
    }

    @Override
    protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
        titleView.setTitle(getString(R.string.setting_title));
    }

    @Override
    public void onShowResult(int requestType, BaseBean result) {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
    }

    @OnClick(R2.id.tv_out_sign)
    public void onViewClicked(View view) {
        int id = view.getId();
        if (id == R.id.tv_out_sign) {
            //退出登录
            UtilsManager.getInstance(mActivity).clearShareData("city_json");
            UtilsManager.getInstance(mActivity).setShNull();
            OkGoUtil.clearToken();
            setResult(201);
            showToast("退出成功！");
            finish();
        }
    }
}
