diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2019-08-31 13:52:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-31 13:52:48 +0200 |
commit | 79199eec09e32dd144e066a813ab5d46eaedff3c (patch) | |
tree | 90a6ac3bfbc1ee1e4bb30bdf27d7a14e986cd402 | |
parent | 1e1cc3e6d59fa6f490f8fd6ccc704dd1afd0c0fd (diff) | |
parent | 0333b2cecfdc7ba100d51673f826b69d9f5af842 (diff) | |
download | AntennaPod-79199eec09e32dd144e066a813ab5d46eaedff3c.zip |
Merge pull request #3353 from ByteHamster/searchview
Collapse search view
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 15 | ||||
-rw-r--r-- | app/src/main/res/menu/feedlist.xml | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 706829f8b..f8ef7f7a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -203,6 +203,21 @@ public class FeedItemlistFragment extends ListFragment { final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem); MenuItemUtils.adjustTextColor(getActivity(), sv); sv.setQueryHint(getString(R.string.search_hint)); + searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() { + @Override + public boolean onMenuItemActionExpand(MenuItem item) { + menu.findItem(R.id.filter_items).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + menu.findItem(R.id.episode_actions).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + menu.findItem(R.id.refresh_item).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER); + return true; + } + + @Override + public boolean onMenuItemActionCollapse(MenuItem item) { + getActivity().invalidateOptionsMenu(); + return true; + } + }); sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String s) { diff --git a/app/src/main/res/menu/feedlist.xml b/app/src/main/res/menu/feedlist.xml index e62fc9d36..0cc8addfe 100644 --- a/app/src/main/res/menu/feedlist.xml +++ b/app/src/main/res/menu/feedlist.xml @@ -33,7 +33,7 @@ <item android:id="@+id/action_search" android:icon="?attr/action_search" - custom:showAsAction="always" + custom:showAsAction="always|collapseActionView" custom:actionViewClass="android.support.v7.widget.SearchView" android:title="@string/search_label"/> |