Skip to content

Commit

Permalink
Fix empty conversation update item text.
Browse files Browse the repository at this point in the history
For some reason, if an EmojiTextView has a wrap content width and some other set of conditions occur, the view will not request a relayout when text changes.
This change inelegantly calls request layout more often to prevent that from happening.
  • Loading branch information
cody-signal committed Feb 2, 2021
1 parent c15ea8c commit 0d215d6
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -10,6 +10,7 @@
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.ViewGroup;

import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -137,6 +138,10 @@ protected void onDraw(Canvas canvas) {
}
}
}

if (getLayoutParams() != null && getLayoutParams().width == ViewGroup.LayoutParams.WRAP_CONTENT) {
requestLayout();
}
}

public void setOverflowText(@Nullable CharSequence overflowText) {
Expand Down

0 comments on commit 0d215d6

Please sign in to comment.