// Path: domain/src/main/java/domain/foundation/BaseView.java
// public interface BaseView {
// }
// 
// Path: domain/src/main/java/domain/foundation/Presenter.java
// public abstract class Presenter<V extends BaseView> {
//     protected V view;
//     protected final Wireframe wireframe;
//     private final SubscribeOn subscribeOn;
//     private final ObserveOn observeOn;
//     private final ParserException parserException;
//     protected final UI ui;
//     private final CompositeSubscription subscriptions;
// 
//     public Presenter(Wireframe wireframe, SubscribeOn subscribeOn, ObserveOn observeOn, ParserException parserException, UI ui) {
//         this.wireframe = wireframe;
//         this.subscribeOn = subscribeOn;
//         this.observeOn = observeOn;
//         this.parserException = parserException;
//         this.ui = ui;
//         this.subscriptions = new CompositeSubscription();
//     }
// 
//     /**
//      * Called when view is required to initialize. On the Android lifecycle ecosystem, it would be onCreated.
//      */
//     public void attachView(V view) {
//         this.view = view;
//     }
// 
//     /**
//      * Called when view is required to resume. On the Android lifecycle ecosystem, it would be onResume.
//      */
//     public void resumeView() {}
// 
//     /**
//      * Handles observable subscriptions, not throw any exception and report it using feedback.
//      */
//     protected <T> Disposing<T> safetyReportError(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .doOnError(throwable -> ui.showFeedback(parserException.with(throwable).react()))
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable subscriptions, not throw any exception and report it using anchoredScreenFeedback.
//      */
//     protected <T> Disposing<T> safetyReportErrorAnchored(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .doOnError(throwable -> ui.showAnchoredScreenFeedback(parserException.with(throwable).react()))
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable subscriptions and not throw any exception.
//      */
//     protected <T> Disposing<T> safety(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable schedulers.
//      */
//     private  <T> Observable<T> schedulers(Observable<T> observable) {
//         return observable.subscribeOn(subscribeOn.getScheduler())
//                 .observeOn(observeOn.getScheduler());
//     }
// 
//     public void dispose() {
//         if (!subscriptions.isUnsubscribed()) {
//             subscriptions.clear();
//         }
//     }
// 
//     /**
//      * Wrapper to hold a reference to the observable and the expected subscription.
//      */
//     protected static class Disposing<T> {
//         private Observable<T> observable;
//         private final CompositeSubscription subscriptions;
// 
//         private Disposing(Observable<T> observable, CompositeSubscription subscriptions) {
//             this.observable = observable;
//             this.subscriptions = subscriptions;
//         }
// 
//         public void disposable(Disposable<T> disposable) {
//             subscriptions.add(disposable.subscription(observable));
//         }
// 
//         public interface Disposable<T> {
//             Subscription subscription(Observable<T> observable);
//         }
//     }
// }
// 
// Path: presentation/src/main/java/presentation/internal/di/ApplicationComponent.java
// @Singleton @Component(modules = {DomainPresentationModule.class, DataPresentationModule.class, ApplicationModule.class})
// public interface ApplicationComponent {
//     void inject(LaunchActivity launchActivity);
// 
//     void inject(DashBoardActivity dashBoardActivity);
//     void inject(UserFragment userFragment);
//     void inject(UsersFragment usersFragment);
//     void inject(SearchUserFragment searchUserFragment);
// }


import domain.foundation.Presenter;
import presentation.internal.di.ApplicationComponent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import javax.inject.Inject;
import butterknife.ButterKnife;
import domain.foundation.BaseView;
    protected void initViews() {}

    @Override public void onDestroyView() {
        super.onDestroyView();
        presenter.dispose();
        ButterKnife.unbind(this);
    }

    @Override public void onResume() {
        super.onResume();
        presenter.resumeView();
    }

    protected ApplicationComponent getApplicationComponent() {
        return ((BaseFragmentActivity)getActivity()).getApplicationComponent();
    }

    public void showToast(String title) {
        Toast.makeText(getActivity(), title, Toast.LENGTH_LONG)
                .show();
    }

    public void showSnackBar(String title) {
        Snackbar.make(getView(), title, Snackbar.LENGTH_LONG)
                .show();
    }

    protected void replaceFragment(int id, Fragment fragment) {
        FragmentManager fragmentManager = getChildFragmentManager();
        fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
// Path: domain/src/main/java/domain/foundation/BaseView.java
// public interface BaseView {
// }
// 
// Path: domain/src/main/java/domain/foundation/Presenter.java
// public abstract class Presenter<V extends BaseView> {
//     protected V view;
//     protected final Wireframe wireframe;
//     private final SubscribeOn subscribeOn;
//     private final ObserveOn observeOn;
//     private final ParserException parserException;
//     protected final UI ui;
//     private final CompositeSubscription subscriptions;
// 
//     public Presenter(Wireframe wireframe, SubscribeOn subscribeOn, ObserveOn observeOn, ParserException parserException, UI ui) {
//         this.wireframe = wireframe;
//         this.subscribeOn = subscribeOn;
//         this.observeOn = observeOn;
//         this.parserException = parserException;
//         this.ui = ui;
//         this.subscriptions = new CompositeSubscription();
//     }
// 
//     /**
//      * Called when view is required to initialize. On the Android lifecycle ecosystem, it would be onCreated.
//      */
//     public void attachView(V view) {
//         this.view = view;
//     }
// 
//     /**
//      * Called when view is required to resume. On the Android lifecycle ecosystem, it would be onResume.
//      */
//     public void resumeView() {}
// 
//     /**
//      * Handles observable subscriptions, not throw any exception and report it using feedback.
//      */
//     protected <T> Disposing<T> safetyReportError(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .doOnError(throwable -> ui.showFeedback(parserException.with(throwable).react()))
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable subscriptions, not throw any exception and report it using anchoredScreenFeedback.
//      */
//     protected <T> Disposing<T> safetyReportErrorAnchored(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .doOnError(throwable -> ui.showAnchoredScreenFeedback(parserException.with(throwable).react()))
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable subscriptions and not throw any exception.
//      */
//     protected <T> Disposing<T> safety(Observable<T> observable) {
//         Observable<T> configured = schedulers(observable)
//                 .onErrorResumeNext(throwable -> Observable.empty());
// 
//         return new Disposing(configured, subscriptions);
//     }
// 
//     /**
//      * Handles observable schedulers.
//      */
//     private  <T> Observable<T> schedulers(Observable<T> observable) {
//         return observable.subscribeOn(subscribeOn.getScheduler())
//                 .observeOn(observeOn.getScheduler());
//     }
// 
//     public void dispose() {
//         if (!subscriptions.isUnsubscribed()) {
//             subscriptions.clear();
//         }
//     }
// 
//     /**
//      * Wrapper to hold a reference to the observable and the expected subscription.
//      */
//     protected static class Disposing<T> {
//         private Observable<T> observable;
//         private final CompositeSubscription subscriptions;
// 
//         private Disposing(Observable<T> observable, CompositeSubscription subscriptions) {
//             this.observable = observable;
//             this.subscriptions = subscriptions;
//         }
// 
//         public void disposable(Disposable<T> disposable) {
//             subscriptions.add(disposable.subscription(observable));
//         }
// 
//         public interface Disposable<T> {
//             Subscription subscription(Observable<T> observable);
//         }
//     }
// }
// 
// Path: presentation/src/main/java/presentation/internal/di/ApplicationComponent.java
// @Singleton @Component(modules = {DomainPresentationModule.class, DataPresentationModule.class, ApplicationModule.class})
// public interface ApplicationComponent {
//     void inject(LaunchActivity launchActivity);
// 
//     void inject(DashBoardActivity dashBoardActivity);
//     void inject(UserFragment userFragment);
//     void inject(UsersFragment usersFragment);
//     void inject(SearchUserFragment searchUserFragment);
// }


// Path: presentation/src/main/java/presentation/foundation/BasePresenterFragment.java
import domain.foundation.Presenter;
import presentation.internal.di.ApplicationComponent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import javax.inject.Inject;
import butterknife.ButterKnife;
import domain.foundation.BaseView;

    protected void initViews() {}

    @Override public void onDestroyView() {
        super.onDestroyView();
        presenter.dispose();
        ButterKnife.unbind(this);
    }

    @Override public void onResume() {
        super.onResume();
        presenter.resumeView();
    }

    protected ApplicationComponent getApplicationComponent() {
        return ((BaseFragmentActivity)getActivity()).getApplicationComponent();
    }

    public void showToast(String title) {
        Toast.makeText(getActivity(), title, Toast.LENGTH_LONG)
                .show();
    }

    public void showSnackBar(String title) {
        Snackbar.make(getView(), title, Snackbar.LENGTH_LONG)
                .show();
    }

    protected void replaceFragment(int id, Fragment fragment) {
        FragmentManager fragmentManager = getChildFragmentManager();
        fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
        fragmentManager.beginTransaction()