From 4698d07323c2dc0e1c2b4cbbafafa4783548f07f Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 9 Jun 2021 16:14:03 +0200 Subject: [PATCH] Do not hide feed buttons (show/hide & help) behind three-dots menu --- .../java/org/schabi/newpipe/fragments/MainFragment.java | 2 +- .../java/org/schabi/newpipe/local/feed/FeedFragment.kt | 8 +------- app/src/main/res/menu/menu_feed_fragment.xml | 4 +++- .../{main_fragment_menu.xml => menu_main_fragment.xml} | 0 4 files changed, 5 insertions(+), 9 deletions(-) rename app/src/main/res/menu/{main_fragment_menu.xml => menu_main_fragment.xml} (100%) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 88d7e757e..7e0186e1c 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -130,7 +130,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte Log.d(TAG, "onCreateOptionsMenu() called with: " + "menu = [" + menu + "], inflater = [" + inflater + "]"); } - inflater.inflate(R.menu.main_fragment_menu, menu); + inflater.inflate(R.menu.menu_main_fragment, menu); final ActionBar supportActionBar = activity.getSupportActionBar(); if (supportActionBar != null) { diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index d6d75fec5..4665ebb7f 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -169,13 +169,7 @@ class FeedFragment : BaseStateFragment() { activity.supportActionBar?.subtitle = groupName inflater.inflate(R.menu.menu_feed_fragment, menu) - - menu.findItem(R.id.menu_item_feed_toggle_played_items).apply { - updateTogglePlayedItemsButton(this) - if (useAsFrontPage) { - setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) - } - } + updateTogglePlayedItemsButton(menu.findItem(R.id.menu_item_feed_toggle_played_items)) } override fun onOptionsItemSelected(item: MenuItem): Boolean { diff --git a/app/src/main/res/menu/menu_feed_fragment.xml b/app/src/main/res/menu/menu_feed_fragment.xml index cd6e1696c..7a948ea8a 100644 --- a/app/src/main/res/menu/menu_feed_fragment.xml +++ b/app/src/main/res/menu/menu_feed_fragment.xml @@ -4,6 +4,7 @@ + android:orderInCategory="3" + app:showAsAction="ifRoom" /> diff --git a/app/src/main/res/menu/main_fragment_menu.xml b/app/src/main/res/menu/menu_main_fragment.xml similarity index 100% rename from app/src/main/res/menu/main_fragment_menu.xml rename to app/src/main/res/menu/menu_main_fragment.xml