Skip to content

Commit

Permalink
Remove jumpiness when rendering reactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Apr 21, 2020
1 parent b8ccc44 commit 00b6a22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
Expand Down Expand Up @@ -912,10 +911,7 @@ private void setReactions(@NonNull MessageRecord current) {
return;
}

if (bodyBubble.getWidth() != 0) {
setReactionsWithWidth(current, bodyBubble.getWidth());
}

setReactionsWithWidth(current, bodyBubble.getWidth());
bodyBubble.setOnSizeChangedListener((width, height) -> setReactionsWithWidth(current, width));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ private void init(@Nullable AttributeSet attrs) {
}
}



public void clear() {
this.records.clear();
this.bubbleWidth = 0;
Expand All @@ -78,7 +76,9 @@ public void setReactions(@NonNull List<ReactionRecord> records, int bubbleWidth)
removeAllViews();

for (Reaction reaction : reactions) {
addView(buildPill(getContext(), this, reaction));
View pill = buildPill(getContext(), this, reaction);
pill.setVisibility(bubbleWidth == 0 ? INVISIBLE : VISIBLE);
addView(pill);
}

measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
Expand Down

0 comments on commit 00b6a22

Please sign in to comment.