@Test public void shouldShowLoadingWhenInitialize(){ presenter.setView(view); presenter.initialize(); InOrder inOrder = inOrder(view); inOrder.verify(view).showLoading(); inOrder.verify(view).hideLoading(); }
@Override public void initialize() { getView().showLoading(); getActorsByQuery.subscribe(new ActorsSubscriber()); getActorsByQuery.setActions(new Actions( () -> getView().showLoading() , () -> getView().hideLoading() , () -> getView().clearAdapter() )); getView().hideLoading(); }
ActorsPresenter extends BasePresenter<ActorsPresenter.View> { @Override public void initialize() { getView().showLoading(); getActorsByQuery.subscribe(new ActorsSubscriber()); getActorsByQuery.setActions(new Actions( () -> getView().showLoading() , () -> getView().hideLoading() , () -> getView().clearAdapter() )); getView().hideLoading(); } }
ActorsPresenter extends BasePresenter<ActorsPresenter.View> { @Override public void initialize() { getView().showLoading(); getActorsByQuery.subscribe(new ActorsSubscriber()); getActorsByQuery.setActions(new Actions( () -> getView().showLoading() , () -> getView().hideLoading() , () -> getView().clearAdapter() )); getView().hideLoading(); } ActorsPresenter(GetActorsByQuery getActorsByQuery); }
ActorsPresenter extends BasePresenter<ActorsPresenter.View> { @Override public void initialize() { getView().showLoading(); getActorsByQuery.subscribe(new ActorsSubscriber()); getActorsByQuery.setActions(new Actions( () -> getView().showLoading() , () -> getView().hideLoading() , () -> getView().clearAdapter() )); getView().hideLoading(); } ActorsPresenter(GetActorsByQuery getActorsByQuery); @Override void initialize(); void setActors(List<Actor> actors); void onGetTextFromSearchField(String query); void onActorClicked(int actorId , int viewHolderPosition); void onDestroy(); }
ActorsPresenter extends BasePresenter<ActorsPresenter.View> { @Override public void initialize() { getView().showLoading(); getActorsByQuery.subscribe(new ActorsSubscriber()); getActorsByQuery.setActions(new Actions( () -> getView().showLoading() , () -> getView().hideLoading() , () -> getView().clearAdapter() )); getView().hideLoading(); } ActorsPresenter(GetActorsByQuery getActorsByQuery); @Override void initialize(); void setActors(List<Actor> actors); void onGetTextFromSearchField(String query); void onActorClicked(int actorId , int viewHolderPosition); void onDestroy();  }