1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-07-24 12:52:57 +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();
item.setChecked(true);
if ((theContentFilter.isEmpty() || "all".equals(theContentFilter.get(0)))
&& service != null) {
searchEditText.setHint(
getString(R.string.search_with_service_name,
service.getServiceInfo().getName()));
} else {
searchEditText.setHint(getString(R.string.search_with_service_name, item.getTitle()));
if (service != null) {
final boolean isNotFiltered = theContentFilter.isEmpty()
|| "all".equals(theContentFilter.get(0));
if (isNotFiltered) {
searchEditText.setHint(
getString(R.string.search_with_service_name,
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]);

View File

@ -18,6 +18,7 @@
<string name="controls_download_desc">Download stream file</string>
<string name="search">Search</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="did_you_mean">Did you mean \"%1$s\"?</string>
<string name="search_showing_result_for">Showing results for: %s</string>