// Path: app/src/main/java/com/starter/ui/base/mvp/core/MvpPresenter.java
// public interface MvpPresenter<V extends MvpView> {
// 
//     /**
//      * Set or attach the view to this presenter
//      */
//     void attachView(V view);
// 
//     /**
//      * Will be called if the view has been destroyed. Typically this method will be invoked from
//      * <code>Activity.onDestroy()</code> or <code>Fragment.onDestroyView()</code>
//      */
//     void detachView();
// }
// 
// Path: app/src/main/java/com/starter/ui/base/mvp/core/MvpView.java
// public interface MvpView {
// }


import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import com.starter.ui.base.mvp.core.MvpPresenter;
import com.starter.ui.base.mvp.core.MvpView;
package com.starter.ui.base.mvp;


public abstract class MvpBaseFragment<V extends MvpView, P extends MvpPresenter<V>> extends Fragment
    implements MvpView {

    protected P mPresenter;

    @Override
    public void onViewCreated(final View view, final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mPresenter = createPresenter();
        if (mPresenter == null) {
            throw new NullPointerException("Presenter cannot be null!");
        }

        mPresenter.attachView(getMvpView());
    }

    /**
     * Instantiate a presenter instance
     *
     * @return The {@link MvpPresenter} for this view
     */
    @NonNull
    public abstract P createPresenter();

    @NonNull
    public V getMvpView() {
        return (V) this;
    }

// Path: app/src/main/java/com/starter/ui/base/mvp/core/MvpPresenter.java
// public interface MvpPresenter<V extends MvpView> {
// 
//     /**
//      * Set or attach the view to this presenter
//      */
//     void attachView(V view);
// 
//     /**
//      * Will be called if the view has been destroyed. Typically this method will be invoked from
//      * <code>Activity.onDestroy()</code> or <code>Fragment.onDestroyView()</code>
//      */
//     void detachView();
// }
// 
// Path: app/src/main/java/com/starter/ui/base/mvp/core/MvpView.java
// public interface MvpView {
// }


// Path: app/src/main/java/com/starter/ui/base/mvp/MvpBaseFragment.java
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import com.starter.ui.base.mvp.core.MvpPresenter;
import com.starter.ui.base.mvp.core.MvpView;

package com.starter.ui.base.mvp;


public abstract class MvpBaseFragment<V extends MvpView, P extends MvpPresenter<V>> extends Fragment
    implements MvpView {

    protected P mPresenter;

    @Override
    public void onViewCreated(final View view, final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        mPresenter = createPresenter();
        if (mPresenter == null) {
            throw new NullPointerException("Presenter cannot be null!");
        }

        mPresenter.attachView(getMvpView());
    }

    /**
     * Instantiate a presenter instance
     *
     * @return The {@link MvpPresenter} for this view
     */
    @NonNull
    public abstract P createPresenter();

    @NonNull
    public V getMvpView() {
        return (V) this;
    }

    @Override