Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
the changes i made were wrong (what a surprise)
Browse files Browse the repository at this point in the history
  • Loading branch information
sk22 committed Oct 16, 2023
1 parent db18c7a commit 71039d6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ protected boolean needDividerForExtraItem(View child, View bottomSibling, Recycl

public abstract void onItemClick(String id);

protected void updatePoll(String parentID, Status statusForContent, Poll poll){
statusForContent.poll=poll;
protected void updatePoll(String itemID, Status status, Poll poll){
status.poll=poll;
int firstOptionIndex=-1, footerIndex=-1;
int i=0;
for(StatusDisplayItem item:displayItems){
if(item.getContentID().equals(statusForContent.id)){
if(item.parentID.equals(itemID)){
if(item instanceof PollOptionStatusDisplayItem && firstOptionIndex==-1){
firstOptionIndex=i;
}else if(item instanceof PollFooterStatusDisplayItem){
Expand All @@ -485,7 +485,7 @@ protected void updatePoll(String parentID, Status statusForContent, Poll poll){
List<StatusDisplayItem> pollItems=displayItems.subList(firstOptionIndex, footerIndex+1);
int prevSize=pollItems.size();
pollItems.clear();
StatusDisplayItem.buildPollItems(parentID, this, poll, pollItems);
StatusDisplayItem.buildPollItems(itemID, this, poll, pollItems);
if(prevSize!=pollItems.size()){
adapter.notifyItemRangeRemoved(firstOptionIndex, prevSize);
adapter.notifyItemRangeInserted(firstOptionIndex, pollItems.size());
Expand Down

0 comments on commit 71039d6

Please sign in to comment.