@Config(shadows = ShadowRecyclerView.class) @Test public void testScrollToTop() { verify(userManager).getUser(eq("username"), userCaptor.capture()); userCaptor.getValue().onResponse(user); RecyclerView recyclerView = (RecyclerView) activity.findViewById(R.id.recycler_view); recyclerView.smoothScrollToPosition(1); assertThat(customShadowOf(recyclerView).getScrollPosition()).isEqualTo(1); TabLayout.Tab tab = ((TabLayout) activity.findViewById(R.id.tab_layout)).getTabAt(0); tab.select(); tab.select(); assertThat(customShadowOf(recyclerView).getScrollPosition()).isEqualTo(0); }
@Override public void scrollToTop() { mScrollableHelper.scrollToTop(); }
UserActivity extends InjectableActivity implements Scrollable { @Override public void scrollToTop() { mScrollableHelper.scrollToTop(); } }
UserActivity extends InjectableActivity implements Scrollable { @Override public void scrollToTop() { mScrollableHelper.scrollToTop(); }  }
UserActivity extends InjectableActivity implements Scrollable { @Override public void scrollToTop() { mScrollableHelper.scrollToTop(); }  @Override boolean onKeyDown(int keyCode, KeyEvent event); @Override boolean onKeyUp(int keyCode, KeyEvent event); @Override boolean onKeyLongPress(int keyCode, KeyEvent event); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); }
UserActivity extends InjectableActivity implements Scrollable { @Override public void scrollToTop() { mScrollableHelper.scrollToTop(); }  @Override boolean onKeyDown(int keyCode, KeyEvent event); @Override boolean onKeyUp(int keyCode, KeyEvent event); @Override boolean onKeyLongPress(int keyCode, KeyEvent event); @Override void scrollToTop(); @Override boolean scrollToNext(); @Override boolean scrollToPrevious(); static final String EXTRA_USERNAME; }