From c8f575bd851147e9d4be96211e7f0f5913af0136 Mon Sep 17 00:00:00 2001 From: Niko Strijbol Date: Sat, 27 Jan 2024 00:03:51 +0100 Subject: [PATCH] Hide options for cold meals --- .../hydra/feed/cards/resto/RestoCardViewHolder.java | 10 +--------- .../zeus/hydra/feed/preferences/HomeFragment.java | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/be/ugent/zeus/hydra/feed/cards/resto/RestoCardViewHolder.java b/app/src/main/java/be/ugent/zeus/hydra/feed/cards/resto/RestoCardViewHolder.java index 645430b93..0cfd02f97 100644 --- a/app/src/main/java/be/ugent/zeus/hydra/feed/cards/resto/RestoCardViewHolder.java +++ b/app/src/main/java/be/ugent/zeus/hydra/feed/cards/resto/RestoCardViewHolder.java @@ -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; } diff --git a/app/src/main/java/be/ugent/zeus/hydra/feed/preferences/HomeFragment.java b/app/src/main/java/be/ugent/zeus/hydra/feed/preferences/HomeFragment.java index caa89e01a..b9ff40031 100644 --- a/app/src/main/java/be/ugent/zeus/hydra/feed/preferences/HomeFragment.java +++ b/app/src/main/java/be/ugent/zeus/hydra/feed/preferences/HomeFragment.java @@ -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;