@Test public void testFilter() { shadowOf(activity).clickMenuItem(menuResId); verify(itemManager, atLeastOnce()).getStories(eq(expectedRange), eq(ItemManager.MODE_DEFAULT)); assertThat(activity.getSupportActionBar()).hasSubtitle(expectedSubtitleResId); assertEquals(expectedRange, Preferences.getPopularRange(activity)); Bundle savedState = new Bundle(); activity.onSaveInstanceState(savedState); controller = Robolectric.buildActivity(PopularActivity.class); activity = controller.create(savedState).start().resume().visible().get(); assertThat(activity.getSupportActionBar()).hasSubtitle(expectedSubtitleResId); }
private void filter(@AlgoliaPopularClient.Range String range) { setRange(range); Preferences.setPopularRange(this, range); ListFragment listFragment = (ListFragment) getSupportFragmentManager() .findFragmentByTag(LIST_FRAGMENT_TAG); if (listFragment != null) { listFragment.filter(range); } }
PopularActivity extends BaseListActivity { private void filter(@AlgoliaPopularClient.Range String range) { setRange(range); Preferences.setPopularRange(this, range); ListFragment listFragment = (ListFragment) getSupportFragmentManager() .findFragmentByTag(LIST_FRAGMENT_TAG); if (listFragment != null) { listFragment.filter(range); } } }
PopularActivity extends BaseListActivity { private void filter(@AlgoliaPopularClient.Range String range) { setRange(range); Preferences.setPopularRange(this, range); ListFragment listFragment = (ListFragment) getSupportFragmentManager() .findFragmentByTag(LIST_FRAGMENT_TAG); if (listFragment != null) { listFragment.filter(range); } }  }
PopularActivity extends BaseListActivity { private void filter(@AlgoliaPopularClient.Range String range) { setRange(range); Preferences.setPopularRange(this, range); ListFragment listFragment = (ListFragment) getSupportFragmentManager() .findFragmentByTag(LIST_FRAGMENT_TAG); if (listFragment != null) { listFragment.filter(range); } }  @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); }
PopularActivity extends BaseListActivity { private void filter(@AlgoliaPopularClient.Range String range) { setRange(range); Preferences.setPopularRange(this, range); ListFragment listFragment = (ListFragment) getSupportFragmentManager() .findFragmentByTag(LIST_FRAGMENT_TAG); if (listFragment != null) { listFragment.filter(range); } }  @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item);  }