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:
Nik Clayton 2023-04-29 18:56:27 +02:00 committed by GitHub
parent 5c28cba57d
commit 152318ce85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -827,18 +827,17 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
showFilteredPlaceholder(true);
String matchedKeyword = null;
Filter matchedFilter = null;
for (FilterResult result : status.getActionable().getFiltered()) {
Filter filter = result.getFilter();
List<String> keywords = result.getKeywordMatches();
if (filter.getAction() == Filter.Action.WARN && !keywords.isEmpty()) {
matchedKeyword = keywords.get(0);
if (filter.getAction() == Filter.Action.WARN) {
matchedFilter = filter;
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 -> {
listener.clearWarningAction(getBindingAdapterPosition());
});