Exemplo n.º 1
0
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.lists_menu, menu);

    menu.findItem(R.id.menu_action_lists_sort_ignore_articles)
        .setChecked(DisplaySettings.isSortOrderIgnoringArticles(this));

    return super.onCreateOptionsMenu(menu);
  }
Exemplo n.º 2
0
  private void toggleSortIgnoreArticles() {
    PreferenceManager.getDefaultSharedPreferences(this)
        .edit()
        .putBoolean(
            DisplaySettings.KEY_SORT_IGNORE_ARTICLE,
            !DisplaySettings.isSortOrderIgnoringArticles(this))
        .apply();

    // refresh icon state
    supportInvalidateOptionsMenu();

    // post event, so all active list fragments can react
    EventBus.getDefault().post(new ListsDistillationSettings.ListsSortOrderChangedEvent());
  }