Fix crash when getLayout() is null.
This commit is contained in:
parent
a5790edb2b
commit
d4cabce876
2 changed files with 8 additions and 3 deletions
|
@ -153,7 +153,7 @@ public class EmojiTextView extends AppCompatTextView {
|
|||
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
CharSequence text = getText();
|
||||
if (!measureLastLine || text == null || text.length() == 0) {
|
||||
if (getLayout() == null || !measureLastLine || text == null || text.length() == 0) {
|
||||
lastLineWidth = -1;
|
||||
} else {
|
||||
Layout layout = getLayout();
|
||||
|
@ -175,7 +175,7 @@ public class EmojiTextView extends AppCompatTextView {
|
|||
}
|
||||
|
||||
public boolean isSingleLine() {
|
||||
return getLayout().getLineCount() == 1;
|
||||
return getLayout() != null && getLayout().getLineCount() == 1;
|
||||
}
|
||||
|
||||
public void setOverflowText(@Nullable CharSequence overflowText) {
|
||||
|
|
|
@ -387,7 +387,12 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
|||
}
|
||||
}
|
||||
|
||||
if (!updatingFooter && !isCaptionlessMms(messageRecord) && !isViewOnceMessage(messageRecord) && isFooterVisible(messageRecord, nextMessageRecord, groupThread)) {
|
||||
if (!updatingFooter &&
|
||||
!isCaptionlessMms(messageRecord) &&
|
||||
!isViewOnceMessage(messageRecord) &&
|
||||
isFooterVisible(messageRecord, nextMessageRecord, groupThread) &&
|
||||
bodyText.getLastLineWidth() > 0)
|
||||
{
|
||||
int footerWidth = footer.getMeasuredWidth();
|
||||
int availableWidth = getAvailableMessageBubbleWidth(bodyText);
|
||||
if (bodyText.isSingleLine()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue