package com.wd.workoffice.app;

import com.wd.workoffice.util.WorkUtils;

import flexible.xd.android_base.base.BaseActivity;
import flexible.xd.android_base.mvpBase.IBaseView;
import me.jessyan.autosize.AutoSize;


/**
 * Created by flexible on 2018/6/6.
 */

public abstract class WorkBaseActivity extends BaseActivity implements IBaseView {
//    private NetWorkBroadcast netWorkBroadcast;
//    @Override
//    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
//        super.onCreate(savedInstanceState, persistentState);
//        networkListener();
//    }

    @Override
    protected void onResume() {
        super.onResume();
        AutoSize.autoConvertDensity(this, 375, true);
        WorkUtils.addPermissionRule(getWindow().getDecorView());
    }

//    private void networkListener() {
//        netWorkBroadcast = new NetWorkBroadcast();
//        IntentFilter intentFilter = new IntentFilter();
//        intentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
//        intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
//        intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
//        registerReceiver(netWorkBroadcast, intentFilter);
//    }

    @Override
    public void showLoading() {
        isLoad(true);
    }

    @Override
    public void hideLoading() {
        isLoad(false);
    }

    @Override
    public void onError(String message) {
        toast(message);
    }
}
