@Test public void testInit() throws Exception { List<News> newses = mock(ArrayList.class); when(newses.size()).thenReturn(DataManager.PAGE_LIMIT); when(mNewsView.isRefreshing()).thenReturn(false); when(mDataManager.getAllNewses(mNewsView.getItemOffset())) .thenReturn(Single.just(newses)); mPresenter.onRefresh(); verify(mNewsView).changeStateView(MultiStateView.VIEW_STATE_LOADING); verify(mNewsView).showNewes(newses, true); }
public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); @Override void onAttach(INewsView view); void onRefresh(); void loadMore(); @Override void onDetach(); }
NewsPresenter extends BasePresenter<INewsView> { public void onRefresh() { getDisposable().clear(); final INewsView view = getView(); if (!view.isRefreshing()) { view.changeStateView(MultiStateView.VIEW_STATE_LOADING); } loadTopics(true); } @Inject  NewsPresenter(DataManager dataManager); @Override void onAttach(INewsView view); void onRefresh(); void loadMore(); @Override void onDetach();  }