From ad077cf09293ded4db4e9a00e73b6d04a9a20b01 Mon Sep 17 00:00:00 2001 From: Levi Bard Date: Thu, 14 Apr 2022 19:58:08 +0200 Subject: [PATCH] Don't show preview cards on statuses with polls. (#2430) Fixes #2427 --- .../keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 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 1239ea715..dbca518ac 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -1043,9 +1043,11 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { StatusDisplayOptions statusDisplayOptions, final StatusActionListener listener ) { - final Card card = status.getActionable().getCard(); + final Status actionable = status.getActionable(); + final Card card = actionable.getCard(); if (cardViewMode != CardViewMode.NONE && - status.getActionable().getAttachments().size() == 0 && + actionable.getAttachments().size() == 0 && + actionable.getPoll() == null && card != null && !TextUtils.isEmpty(card.getUrl()) && (!status.isCollapsible() || !status.isCollapsed())) { @@ -1067,7 +1069,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { // Statuses from other activitypub sources can be marked sensitive even if there's no media, // so let's blur the preview in that case // If media previews are disabled, show placeholder for cards as well - if (statusDisplayOptions.mediaPreviewEnabled() && !status.getActionable().getSensitive() && !TextUtils.isEmpty(card.getImage())) { + if (statusDisplayOptions.mediaPreviewEnabled() && !actionable.getSensitive() && !TextUtils.isEmpty(card.getImage())) { int topLeftRadius = 0; int topRightRadius = 0;