From 2b466dc2e4db5a88bcc10157039ee906111deef7 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sat, 16 Feb 2019 14:35:06 +0100 Subject: [PATCH] fix statuses collapsing when faving/boosting in ViewThreadFragment (#1047) --- .../tusky/fragment/ViewThreadFragment.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 865f266b..cc94e3a1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/ViewThreadFragment.java @@ -270,15 +270,15 @@ public final class ViewThreadFragment extends SFragment implements private void updateStatus(int position, Status status) { if(position >= 0 && position < statuses.size()) { - statuses.set(position, status); + StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position)) + .setReblogged(status.getReblogged()) + .setReblogsCount(status.getReblogsCount()) + .setFavourited(status.getFavourited()) + .setFavouritesCount(status.getFavouritesCount()) + .createStatusViewData(); + statuses.setPairedItem(position, viewData); - if(position == statusIndex && card != null) { - StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position)) - .setCard(card) - .createStatusViewData(); - statuses.setPairedItem(position, viewData); - } - adapter.setItem(position, statuses.getPairedItem(position), true); + adapter.setItem(position, viewData, true); } }