Merge "Set max width on sender/group name too" into rvc-dev am: 0d07c9ac52
Change-Id: I030523c49fac1b594ced4597a2aa7d5c4609cff4
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
|
android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
|
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fontFamily="@*android:string/config_bodyFontFamily"
|
android:fontFamily="@*android:string/config_bodyFontFamily"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
|
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -230,8 +230,12 @@ public class BubbleFlyoutView extends FrameLayout {
|
|||||||
mSenderText.setTranslationX(0);
|
mSenderText.setTranslationX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int maxTextViewWidth =
|
||||||
|
(int) (parentWidth * FLYOUT_MAX_WIDTH_PERCENT) - mFlyoutPadding * 2;
|
||||||
|
|
||||||
// Name visibility
|
// Name visibility
|
||||||
if (!TextUtils.isEmpty(flyoutMessage.senderName)) {
|
if (!TextUtils.isEmpty(flyoutMessage.senderName)) {
|
||||||
|
mSenderText.setMaxWidth(maxTextViewWidth);
|
||||||
mSenderText.setText(flyoutMessage.senderName);
|
mSenderText.setText(flyoutMessage.senderName);
|
||||||
mSenderText.setVisibility(VISIBLE);
|
mSenderText.setVisibility(VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
@@ -248,8 +252,7 @@ public class BubbleFlyoutView extends FrameLayout {
|
|||||||
// Set the flyout TextView's max width in terms of percent, and then subtract out the
|
// Set the flyout TextView's max width in terms of percent, and then subtract out the
|
||||||
// padding so that the entire flyout view will be the desired width (rather than the
|
// padding so that the entire flyout view will be the desired width (rather than the
|
||||||
// TextView being the desired width + extra padding).
|
// TextView being the desired width + extra padding).
|
||||||
mMessageText.setMaxWidth(
|
mMessageText.setMaxWidth(maxTextViewWidth);
|
||||||
(int) (parentWidth * FLYOUT_MAX_WIDTH_PERCENT) - mFlyoutPadding * 2);
|
|
||||||
mMessageText.setText(flyoutMessage.message);
|
mMessageText.setText(flyoutMessage.message);
|
||||||
|
|
||||||
// Wait for the TextView to lay out so we know its line count.
|
// Wait for the TextView to lay out so we know its line count.
|
||||||
|
|||||||
Reference in New Issue
Block a user