Fix unicode reaction not showing up if no reactions were previsouly present
This commit is contained in:
parent
1ad2257bb1
commit
5f78cd4a8e
1 changed files with 5 additions and 1 deletions
|
@ -277,8 +277,12 @@ public class EmojiReactionsStatusDisplayItem extends StatusDisplayItem {
|
|||
resetBtn.run();
|
||||
if(finalExisting==null){
|
||||
int pos=item.status.reactions.size();
|
||||
boolean previouslyEmpty=item.status.reactions.isEmpty();
|
||||
item.status.reactions.add(pos, info!=null ? EmojiReaction.of(info, me) : EmojiReaction.of(emoji, me));
|
||||
adapter.notifyItemRangeInserted(pos, 1);
|
||||
if(previouslyEmpty)
|
||||
adapter.notifyItemChanged(pos);
|
||||
else
|
||||
adapter.notifyItemInserted(pos);
|
||||
RecyclerView.SmoothScroller scroller=new LinearSmoothScroller(list.getContext());
|
||||
scroller.setTargetPosition(pos);
|
||||
list.getLayoutManager().startSmoothScroll(scroller);
|
||||
|
|
Loading…
Add table
Reference in a new issue