From 39e04de208839cd29e9e0353582037a8e5a732b8 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 18 Jul 2018 15:05:49 +0200 Subject: [PATCH] show radio pin for content filter again --- .../newpipe/fragments/list/search/SearchFragment.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index f7ae11fcb..77274c96a 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -358,9 +358,17 @@ public class SearchFragment supportActionBar.setDisplayHomeAsUpEnabled(true); } + int itemId = 0; + boolean isFirstItem = true; for(String filter : service.getSearchQIHFactory().getAvailableContentFilter()) { - menu.add(filter); + MenuItem item = menu.add(1, itemId++, 0, filter); + if(isFirstItem) { + item.setChecked(true); + isFirstItem = false; + } } + menu.setGroupCheckable(1, true, true); + restoreFilterChecked(menu, filterItemCheckedId); }