package com.sipai.jspatrol.Base;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

/**
 * created by lvliming on 2020/3/23
 */
public abstract class BaseFragmentView<P extends BaseFragmentPresenter,CONTRACT> extends Fragment {
    protected P p;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        p = getPresenter();
        p.bindView(this);
    }

    public abstract CONTRACT getContract();

    public abstract P getPresenter();

    public void  error(Exception e){}

    @Override
    public void onDestroy() {
        super.onDestroy();
        p.unBindView();
    }
}
