fix statuses collapsing when faving/boosting in ViewThreadFragment (#1047)

This commit is contained in:
Konrad Pozniak 2019-02-16 14:35:06 +01:00 committed by GitHub
parent fcc67c6918
commit d371074d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -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);
if(position == statusIndex && card != null) {
StatusViewData.Concrete viewData = new StatusViewData.Builder(statuses.getPairedItem(position))
.setCard(card)
.setReblogged(status.getReblogged())
.setReblogsCount(status.getReblogsCount())
.setFavourited(status.getFavourited())
.setFavouritesCount(status.getFavouritesCount())
.createStatusViewData();
statuses.setPairedItem(position, viewData);
}
adapter.setItem(position, statuses.getPairedItem(position), true);
adapter.setItem(position, viewData, true);
}
}