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 8b7d6eec..980f644b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -1046,6 +1046,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder { actionable.getPoll() == null && card != null && !TextUtils.isEmpty(card.getUrl()) && + (!actionable.getSensitive() || status.isExpanded()) && (!status.isCollapsible() || !status.isCollapsed())) { cardView.setVisibility(View.VISIBLE); cardTitle.setText(card.getTitle()); diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java index bf2c05e0..ae0b0678 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusDetailedViewHolder.java @@ -103,20 +103,26 @@ class StatusDetailedViewHolder extends StatusBaseViewHolder { @NonNull final StatusActionListener listener, @NonNull StatusDisplayOptions statusDisplayOptions, @Nullable Object payloads) { - super.setupWithStatus(status, listener, statusDisplayOptions, payloads); - setupCard(status, CardViewMode.FULL_WIDTH, statusDisplayOptions, listener); // Always show card for detailed status + // We never collapse statuses in the detail view + StatusViewData.Concrete uncollapsedStatus = (status.isCollapsible() && status.isCollapsed()) ? + status.copyWithCollapsed(false) : + status; + + super.setupWithStatus(uncollapsedStatus, listener, statusDisplayOptions, payloads); + setupCard(uncollapsedStatus, CardViewMode.FULL_WIDTH, statusDisplayOptions, listener); // Always show card for detailed status if (payloads == null) { + Status actionable = uncollapsedStatus.getActionable(); if (!statusDisplayOptions.hideStats()) { - setReblogAndFavCount(status.getActionable().getReblogsCount(), - status.getActionable().getFavouritesCount(), listener); + setReblogAndFavCount(actionable.getReblogsCount(), + actionable.getFavouritesCount(), listener); } else { hideQuantitativeStats(); } - setApplication(status.getActionable().getApplication()); + setApplication(actionable.getApplication()); - setStatusVisibility(status.getActionable().getVisibility()); + setStatusVisibility(actionable.getVisibility()); } } diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index aed121a1..ee540286 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -538,7 +538,7 @@ public class NotificationsFragment extends SFragment implements @Override public void onContentCollapsedChange(boolean isCollapsed, int position) { - updateViewDataAt(position, (vd) -> vd.copyWIthCollapsed(isCollapsed)); + updateViewDataAt(position, (vd) -> vd.copyWithCollapsed(isCollapsed)); ; } diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java index 98466cc9..1d6525d1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -387,7 +387,7 @@ public final class ViewThreadFragment extends SFragment implements public void onContentCollapsedChange(boolean isCollapsed, int position) { adapter.setItem( position, - statuses.getPairedItem(position).copyWIthCollapsed(isCollapsed), + statuses.getPairedItem(position).copyWithCollapsed(isCollapsed), true ); } diff --git a/app/src/main/java/com/keylesspalace/tusky/viewdata/StatusViewData.kt b/app/src/main/java/com/keylesspalace/tusky/viewdata/StatusViewData.kt index 8ac212d9..bef7d0e1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/viewdata/StatusViewData.kt +++ b/app/src/main/java/com/keylesspalace/tusky/viewdata/StatusViewData.kt @@ -47,8 +47,8 @@ sealed class StatusViewData { get() = status.id /** - * Specifies whether the content of this post is allowed to be collapsed or if it should show - * all content regardless. + * Specifies whether the content of this post is long enough to be automatically + * collapsed or if it should show all content regardless. * * @return Whether the post is collapsible or never collapsed. */ @@ -106,7 +106,7 @@ sealed class StatusViewData { } /** Helper for Java */ - fun copyWIthCollapsed(isCollapsed: Boolean): Concrete { + fun copyWithCollapsed(isCollapsed: Boolean): Concrete { return copy(isCollapsed = isCollapsed) } }