Skip to content

Commit

Permalink
Hide options for cold meals
Browse files Browse the repository at this point in the history
  • Loading branch information
niknetniko committed Jan 26, 2024
1 parent 4356a3c commit c8f575b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,12 @@ public void onCreateMenu(Menu menu) {
} else {
menu.add(NONE, KindMenu.SHOW_HOT, NONE, R.string.feed_pref_resto_show_hot);
}

if ((kind & MenuTable.DisplayKind.COLD) == MenuTable.DisplayKind.COLD) {
if (displayed > 1) {
menu.add(NONE, KindMenu.HIDE_COLD, NONE, R.string.feed_pref_resto_hide_cold);
}
} else {
menu.add(NONE, KindMenu.SHOW_COLD, NONE, R.string.feed_pref_resto_show_cold);
}
}

@Override
public boolean onMenuItemClick(MenuItem item) {
return switch (item.getItemId()) {
case KindMenu.HIDE_HOT, KindMenu.HIDE_SOUP, KindMenu.SHOW_HOT, KindMenu.SHOW_SOUP, KindMenu.SHOW_COLD, KindMenu.HIDE_COLD -> {
case KindMenu.HIDE_HOT, KindMenu.HIDE_SOUP, KindMenu.SHOW_HOT, KindMenu.SHOW_SOUP -> {
adapter.companion().executeCommand(new RestoKindCommand(item.getItemId()));
yield true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class HomeFragment extends PreferenceFragment {

public static final String PREF_DATA_SAVER = "pref_home_feed_save_data";
public static final boolean PREF_DATA_SAVER_DEFAULT = false;
private static final String PREF_RESTO_KINDS = "pref_feed_resto_kinds_v2";
private static final String PREF_RESTO_KINDS = "pref_feed_resto_kinds_v3";
@MenuTable.DisplayKind
private static final int PREF_RESTO_KINDS_DEFAULT = MenuTable.DisplayKind.HOT | MenuTable.DisplayKind.SOUP;
private DeleteViewModel viewModel;
Expand Down

0 comments on commit c8f575b

Please sign in to comment.