// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/EmptyStateView.java
// public interface EmptyStateView {
// 
//     Action showEmptyState();
// 
//     Action hideEmptyState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/errorstate/ErrorStateView.java
// public interface ErrorStateView {
// 
//     Action showErrorState();
// 
//     Action hideErrorState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/loadingcontent/LoadingView.java
// public interface LoadingView {
// 
//     Action showLoading();
// 
//     Action hideLoading();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/networking/NetworkingErrorView.java
// public interface NetworkingErrorView {
// 
//     Action reportNetworkingError();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/tooglerefresh/ToogleRefreshView.java
// public interface ToogleRefreshView {
// 
//     Action disableRefresh();
// 
//     Action enableRefresh();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/trivia/presentation/DisplayFactsView.java
// public interface DisplayFactsView extends
//         LoadingView,
//         ErrorStateView,
//         EmptyStateView,
//         NetworkingErrorView,
//         ToogleRefreshView {
// 
//     Disposable subscribeInto(Flowable<FactViewModel> flow);
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/trivia/ui/FactsAboutNumbersActivity.java
// public class FactsAboutNumbersActivity
//         extends AppCompatActivity implements DisplayFactsView {
// 
//     private static final String TAG = FactsAboutNumbersActivity.class.getSimpleName();
// 
//     @BindView(R.id.recyclerview_facts) public RecyclerView factsView;
//     @BindView(R.id.container) View container;
//     @BindView(R.id.label_feedback_message) TextView feedbackMessage;
//     @BindView(R.id.progressBar) ProgressBar loading;
//     @BindView(R.id.fab) FloatingActionButton fab;
// 
//     @Inject FactsPresenter presenter;
// 
//     public FactsAdapter adapter;
// 
//     @Override protected void onCreate(Bundle savedInstanceState) {
//         AndroidInjection.inject(this);
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_main);
//         ButterKnife.bind(this);
//         setupViews();
//     }
// 
//     @Override protected void onResume() {
//         super.onResume();
//         newTrivia();
//     }
// 
//     @Override public Action showLoading() {
//         return () -> loading.setVisibility(View.VISIBLE);
//     }
// 
//     @Override public Action hideLoading() {
//         return () -> loading.setVisibility(View.GONE);
//     }
// 
//     @Override public Action showEmptyState() {
//         return () -> {
//             feedbackMessage.setVisibility(View.VISIBLE);
//             feedbackMessage.setText(R.string.feedback_empty_state);
//         };
//     }
// 
//     @Override public Action hideEmptyState() {
//         return () -> feedbackMessage.setVisibility(View.GONE);
//     }
// 
//     @Override public Action showErrorState() {
//         return () -> {
//             feedbackMessage.setVisibility(View.VISIBLE);
//             feedbackMessage.setText(R.string.feedback_error_state);
//         };
//     }
// 
//     @Override public Action hideErrorState() {
//         return () -> feedbackMessage.setVisibility(View.GONE);
//     }
// 
//     @Override public Action reportNetworkingError() {
//         return () ->
//                 Snackbar.make(container, R.string.feedback_message_internet_issue, LENGTH_INDEFINITE)
//                         .setAction("TENTAR NOVAMENTE", view -> newTrivia())
//                         .show();
//     }
// 
//     @Override public Action disableRefresh() {
//         return () -> fab.setVisibility(View.GONE);
//     }
// 
//     @Override public Action enableRefresh() {
//         return () -> fab.setVisibility(View.VISIBLE);
//     }
// 
//     @Override public Disposable subscribeInto(Flowable<FactViewModel> flow) {
//         adapter.clear();
//         return flow
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(
//                         model -> adapter.addModel(model),
//                         throwable -> Log.e(TAG, "Error -> " + throwable.getMessage()),
//                         () -> Log.i(TAG, "Done")
//                 );
//     }
// 
//     private void setupViews() {
//         fab.setOnClickListener(view -> newTrivia());
//         adapter = new FactsAdapter(LayoutInflater.from(this));
//         factsView.setLayoutManager(new LinearLayoutManager(this));
//         factsView.setAdapter(adapter);
//     }
// 
//     private void newTrivia() {
//         if (presenter != null) presenter.fetchRandomFacts();
//     }
// 
// }


import android.arch.lifecycle.LifecycleOwner;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.EmptyStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.errorstate.ErrorStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.loadingcontent.LoadingView;
import br.ufs.demos.rxmvp.playground.core.behaviours.networking.NetworkingErrorView;
import br.ufs.demos.rxmvp.playground.core.behaviours.tooglerefresh.ToogleRefreshView;
import br.ufs.demos.rxmvp.playground.trivia.presentation.DisplayFactsView;
import br.ufs.demos.rxmvp.playground.trivia.ui.FactsAboutNumbersActivity;
import dagger.Binds;
import dagger.Module;
package br.ufs.demos.rxmvp.playground.dagger.modules;



/**
 * Created by bira on 7/5/17.
 */

@Module(
        includes = {
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/EmptyStateView.java
// public interface EmptyStateView {
// 
//     Action showEmptyState();
// 
//     Action hideEmptyState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/errorstate/ErrorStateView.java
// public interface ErrorStateView {
// 
//     Action showErrorState();
// 
//     Action hideErrorState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/loadingcontent/LoadingView.java
// public interface LoadingView {
// 
//     Action showLoading();
// 
//     Action hideLoading();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/networking/NetworkingErrorView.java
// public interface NetworkingErrorView {
// 
//     Action reportNetworkingError();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/tooglerefresh/ToogleRefreshView.java
// public interface ToogleRefreshView {
// 
//     Action disableRefresh();
// 
//     Action enableRefresh();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/trivia/presentation/DisplayFactsView.java
// public interface DisplayFactsView extends
//         LoadingView,
//         ErrorStateView,
//         EmptyStateView,
//         NetworkingErrorView,
//         ToogleRefreshView {
// 
//     Disposable subscribeInto(Flowable<FactViewModel> flow);
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/trivia/ui/FactsAboutNumbersActivity.java
// public class FactsAboutNumbersActivity
//         extends AppCompatActivity implements DisplayFactsView {
// 
//     private static final String TAG = FactsAboutNumbersActivity.class.getSimpleName();
// 
//     @BindView(R.id.recyclerview_facts) public RecyclerView factsView;
//     @BindView(R.id.container) View container;
//     @BindView(R.id.label_feedback_message) TextView feedbackMessage;
//     @BindView(R.id.progressBar) ProgressBar loading;
//     @BindView(R.id.fab) FloatingActionButton fab;
// 
//     @Inject FactsPresenter presenter;
// 
//     public FactsAdapter adapter;
// 
//     @Override protected void onCreate(Bundle savedInstanceState) {
//         AndroidInjection.inject(this);
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_main);
//         ButterKnife.bind(this);
//         setupViews();
//     }
// 
//     @Override protected void onResume() {
//         super.onResume();
//         newTrivia();
//     }
// 
//     @Override public Action showLoading() {
//         return () -> loading.setVisibility(View.VISIBLE);
//     }
// 
//     @Override public Action hideLoading() {
//         return () -> loading.setVisibility(View.GONE);
//     }
// 
//     @Override public Action showEmptyState() {
//         return () -> {
//             feedbackMessage.setVisibility(View.VISIBLE);
//             feedbackMessage.setText(R.string.feedback_empty_state);
//         };
//     }
// 
//     @Override public Action hideEmptyState() {
//         return () -> feedbackMessage.setVisibility(View.GONE);
//     }
// 
//     @Override public Action showErrorState() {
//         return () -> {
//             feedbackMessage.setVisibility(View.VISIBLE);
//             feedbackMessage.setText(R.string.feedback_error_state);
//         };
//     }
// 
//     @Override public Action hideErrorState() {
//         return () -> feedbackMessage.setVisibility(View.GONE);
//     }
// 
//     @Override public Action reportNetworkingError() {
//         return () ->
//                 Snackbar.make(container, R.string.feedback_message_internet_issue, LENGTH_INDEFINITE)
//                         .setAction("TENTAR NOVAMENTE", view -> newTrivia())
//                         .show();
//     }
// 
//     @Override public Action disableRefresh() {
//         return () -> fab.setVisibility(View.GONE);
//     }
// 
//     @Override public Action enableRefresh() {
//         return () -> fab.setVisibility(View.VISIBLE);
//     }
// 
//     @Override public Disposable subscribeInto(Flowable<FactViewModel> flow) {
//         adapter.clear();
//         return flow
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(
//                         model -> adapter.addModel(model),
//                         throwable -> Log.e(TAG, "Error -> " + throwable.getMessage()),
//                         () -> Log.i(TAG, "Done")
//                 );
//     }
// 
//     private void setupViews() {
//         fab.setOnClickListener(view -> newTrivia());
//         adapter = new FactsAdapter(LayoutInflater.from(this));
//         factsView.setLayoutManager(new LinearLayoutManager(this));
//         factsView.setAdapter(adapter);
//     }
// 
//     private void newTrivia() {
//         if (presenter != null) presenter.fetchRandomFacts();
//     }
// 
// }


// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/dagger/modules/FactsAboutNumbersModule.java
import android.arch.lifecycle.LifecycleOwner;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.EmptyStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.errorstate.ErrorStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.loadingcontent.LoadingView;
import br.ufs.demos.rxmvp.playground.core.behaviours.networking.NetworkingErrorView;
import br.ufs.demos.rxmvp.playground.core.behaviours.tooglerefresh.ToogleRefreshView;
import br.ufs.demos.rxmvp.playground.trivia.presentation.DisplayFactsView;
import br.ufs.demos.rxmvp.playground.trivia.ui.FactsAboutNumbersActivity;
import dagger.Binds;
import dagger.Module;

package br.ufs.demos.rxmvp.playground.dagger.modules;



/**
 * Created by bira on 7/5/17.
 */

@Module(
        includes = {
                BehavioursModule.class,