summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2018-08-17 15:26:03 -0700
committer android-build-merger <android-build-merger@google.com> 2018-08-17 15:26:03 -0700
commite206929da39baef76f41a63af74a6ba8af80aa1e (patch)
treeb02a0c48b7e592e33cbafeb59380f48fb9b59dc2
parent6497c5bd2167a0cd0d076a7c74d5d914f5feb0f7 (diff)
parent99168a6371363e09f75e0ed4e81c32e9ccb969c7 (diff)
Merge "Fixed an issue where the message could be empty" into pi-dev
am: 99168a6371 Change-Id: I848486310a74b37dcac41bf81a5746ca15dc0d7d
-rw-r--r--core/java/com/android/internal/widget/MessagingLinearLayout.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/com/android/internal/widget/MessagingLinearLayout.java b/core/java/com/android/internal/widget/MessagingLinearLayout.java
index 64b1f241464b..0c8613b460f6 100644
--- a/core/java/com/android/internal/widget/MessagingLinearLayout.java
+++ b/core/java/com/android/internal/widget/MessagingLinearLayout.java
@@ -111,14 +111,16 @@ public class MessagingLinearLayout extends ViewGroup {
final int childHeight = child.getMeasuredHeight();
int newHeight = Math.max(totalHeight, totalHeight + childHeight + lp.topMargin +
lp.bottomMargin + spacing);
- first = false;
int measureType = MessagingChild.MEASURED_NORMAL;
if (messagingChild != null) {
measureType = messagingChild.getMeasuredType();
linesRemaining -= messagingChild.getConsumedLines();
}
- boolean isShortened = measureType == MessagingChild.MEASURED_SHORTENED;
- boolean isTooSmall = measureType == MessagingChild.MEASURED_TOO_SMALL;
+
+ // We never measure the first item as too small, we want to at least show something.
+ boolean isTooSmall = measureType == MessagingChild.MEASURED_TOO_SMALL && !first;
+ boolean isShortened = measureType == MessagingChild.MEASURED_SHORTENED
+ || measureType == MessagingChild.MEASURED_TOO_SMALL && first;
if (newHeight <= targetHeight && !isTooSmall) {
totalHeight = newHeight;
measuredWidth = Math.max(measuredWidth,
@@ -131,6 +133,7 @@ public class MessagingLinearLayout extends ViewGroup {
} else {
break;
}
+ first = false;
}
setMeasuredDimension(