From 152318ce859830ddf60ad8aa31726f9fa0a0acaa Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Sat, 29 Apr 2023 18:56:27 +0200 Subject: [PATCH] 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. --- .../tusky/adapter/StatusBaseViewHolder.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 6af90953..3bc1a26f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -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 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()); });