package com.sunzee.base;


import android.os.Bundle;
import android.util.Log;
import android.view.View;

public abstract class MvpFragment<P extends BasePresenter> extends BaseFragment {
    protected P mvpPresenter;
    private static final String TAG = "MvpFragment";
    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        mvpPresenter = createPresenter();
    }

    protected abstract P createPresenter();


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        Log.d(TAG, "onDestroyView: ");
        if (mvpPresenter != null) {
            mvpPresenter.detachView();
        }
    }
}
