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:
parent
769e98acd0
commit
16e32dfc96
2 changed files with 13 additions and 7 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue