Show filter title instead of filter keywords (#3589)
Avoid showing the user the things they have filtered on when showing a filter placeholder in a timeline.
This commit is contained in:
parent
5c28cba57d
commit
152318ce85
1 changed files with 4 additions and 5 deletions
|
@ -827,18 +827,17 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
showFilteredPlaceholder(true);
|
showFilteredPlaceholder(true);
|
||||||
|
|
||||||
String matchedKeyword = null;
|
Filter matchedFilter = null;
|
||||||
|
|
||||||
for (FilterResult result : status.getActionable().getFiltered()) {
|
for (FilterResult result : status.getActionable().getFiltered()) {
|
||||||
Filter filter = result.getFilter();
|
Filter filter = result.getFilter();
|
||||||
List<String> keywords = result.getKeywordMatches();
|
if (filter.getAction() == Filter.Action.WARN) {
|
||||||
if (filter.getAction() == Filter.Action.WARN && !keywords.isEmpty()) {
|
matchedFilter = filter;
|
||||||
matchedKeyword = keywords.get(0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredPlaceholderLabel.setText(itemView.getContext().getString(R.string.status_filter_placeholder_label_format, matchedKeyword));
|
filteredPlaceholderLabel.setText(itemView.getContext().getString(R.string.status_filter_placeholder_label_format, matchedFilter.getTitle()));
|
||||||
filteredPlaceholderShowButton.setOnClickListener(view -> {
|
filteredPlaceholderShowButton.setOnClickListener(view -> {
|
||||||
listener.clearWarningAction(getBindingAdapterPosition());
|
listener.clearWarningAction(getBindingAdapterPosition());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue