package me.bell.librarydemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import me.bello.bellolibrary.Loading.LoadingDialogFragment;

/**
 * @Info
 * @Auth Bello
 * @Time 18-4-18 下午6:02
 * @Ver
 */
public class BaseActivity extends AppCompatActivity {

    //加载进度的view
    public LoadingDialogFragment loadingView = new LoadingDialogFragment();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //设置加载进度view
        Bundle bundle = new Bundle();
        bundle.putBoolean("close", true);
        bundle.putBoolean("showBg", true);
        loadingView.setArguments(bundle);

    }

    @Override
    protected void onDestroy() {
        //退出时取消进度view显示
        if (loadingView.getShowsDialog())
        loadingView.dismiss();
        super.onDestroy();
    }
}
