diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java index 45edfec2b..f7bfb8209 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java @@ -10,7 +10,6 @@ import org.joinmastodon.android.events.StatusCountersUpdatedEvent; import org.joinmastodon.android.events.StatusCreatedEvent; import org.joinmastodon.android.events.StatusDeletedEvent; import org.joinmastodon.android.events.StatusUpdatedEvent; -import org.joinmastodon.android.events.StatusUnpinnedEvent; import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.FooterStatusDisplayItem; @@ -63,6 +62,59 @@ public abstract class StatusListFragment extends BaseStatusListFragment{ protected void onStatusCreated(StatusCreatedEvent ev){} + protected void onStatusUpdated(StatusUpdatedEvent ev){ + ArrayList statusesForDisplayItems=new ArrayList<>(); + for(int i=0;i postItems=displayItems.subList(start, i); + postItems.clear(); + postItems.addAll(buildDisplayItems(s)); + int oldSize=i-start, newSize=postItems.size(); + if(oldSize==newSize){ + adapter.notifyItemRangeChanged(start, newSize); + }else if(oldSize{ StatusListFragment.this.onStatusCreated(ev); } + @Subscribe + public void onStatusUpdated(StatusUpdatedEvent ev){ + StatusListFragment.this.onStatusUpdated(ev); + } + @Subscribe public void onPollUpdated(PollUpdatedEvent ev){ if(!ev.accountID.equals(accountID))