2
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-08-30 06:07:51 +00:00

SearchFragment: show filter in brackets behind service name

This is still not perfect, but it will show the selected search filter
in addition to the service name, like: “Search YouTube (Playlists)”.

It will not distinguish between a YouTube Music and Youtube filter, so
it will display the same thing. Could be improved, but then the text
gets too long! :(
This commit is contained in:
Profpatsch 2025-06-05 14:30:04 +02:00
parent 769e98acd0
commit 16e32dfc96
2 changed files with 13 additions and 7 deletions

View File

@ -945,13 +945,18 @@ public class SearchFragment extends BaseListFragment<SearchInfo, ListExtractor.I
filterItemCheckedId = item.getItemId(); filterItemCheckedId = item.getItemId();
item.setChecked(true); item.setChecked(true);
if ((theContentFilter.isEmpty() || "all".equals(theContentFilter.get(0))) if (service != null) {
&& service != null) { final boolean isNotFiltered = theContentFilter.isEmpty()
searchEditText.setHint( || "all".equals(theContentFilter.get(0));
getString(R.string.search_with_service_name, if (isNotFiltered) {
service.getServiceInfo().getName())); searchEditText.setHint(
} else { getString(R.string.search_with_service_name,
searchEditText.setHint(getString(R.string.search_with_service_name, item.getTitle())); service.getServiceInfo().getName()));
} else {
searchEditText.setHint(getString(R.string.search_with_service_name_and_filter,
service.getServiceInfo().getName(),
item.getTitle()));
}
} }
contentFilter = theContentFilter.toArray(new String[0]); contentFilter = theContentFilter.toArray(new String[0]);

View File

@ -18,6 +18,7 @@
<string name="controls_download_desc">Download stream file</string> <string name="controls_download_desc">Download stream file</string>
<string name="search">Search</string> <string name="search">Search</string>
<string name="search_with_service_name">Search %1$s</string> <string name="search_with_service_name">Search %1$s</string>
<string name="search_with_service_name_and_filter">Search %1$s (%2$s)</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<string name="did_you_mean">Did you mean \"%1$s\"?</string> <string name="did_you_mean">Did you mean \"%1$s\"?</string>
<string name="search_showing_result_for">Showing results for: %s</string> <string name="search_showing_result_for">Showing results for: %s</string>