Merge "Fix IME and NavBar overlap with Direct Reply" into nyc-dev
am: 5dbb9ff674
* commit '5dbb9ff67468979214542eb6a448711d2d614cdb':
Fix bad one-line MessagingStyle
Change-Id: I1b6cf5033b970aea74fed1ac07c93fe69b7fb1de
This commit is contained in:
@@ -4323,18 +4323,23 @@ public class Notification implements Parcelable
|
|||||||
// experience
|
// experience
|
||||||
bigTextText = mBuilder.processLegacyText(text);
|
bigTextText = mBuilder.processLegacyText(text);
|
||||||
}
|
}
|
||||||
contentView.setTextViewText(R.id.big_text, bigTextText);
|
applyBigTextContentView(mBuilder, contentView, bigTextText);
|
||||||
contentView.setViewVisibility(R.id.big_text,
|
|
||||||
TextUtils.isEmpty(bigTextText) ? View.GONE : View.VISIBLE);
|
|
||||||
contentView.setInt(R.id.big_text, "setMaxLines", calculateMaxLines());
|
|
||||||
contentView.setBoolean(R.id.big_text, "setHasImage", mBuilder.mN.mLargeIcon != null);
|
|
||||||
|
|
||||||
return contentView;
|
return contentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int calculateMaxLines() {
|
static void applyBigTextContentView(Builder builder,
|
||||||
|
RemoteViews contentView, CharSequence bigTextText) {
|
||||||
|
contentView.setTextViewText(R.id.big_text, bigTextText);
|
||||||
|
contentView.setViewVisibility(R.id.big_text,
|
||||||
|
TextUtils.isEmpty(bigTextText) ? View.GONE : View.VISIBLE);
|
||||||
|
contentView.setInt(R.id.big_text, "setMaxLines", calculateMaxLines(builder));
|
||||||
|
contentView.setBoolean(R.id.big_text, "setHasImage", builder.mN.mLargeIcon != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int calculateMaxLines(Builder builder) {
|
||||||
int lineCount = MAX_LINES;
|
int lineCount = MAX_LINES;
|
||||||
boolean hasActions = mBuilder.mActions.size() > 0;
|
boolean hasActions = builder.mActions.size() > 0;
|
||||||
if (hasActions) {
|
if (hasActions) {
|
||||||
lineCount -= LINES_CONSUMED_BY_ACTIONS;
|
lineCount -= LINES_CONSUMED_BY_ACTIONS;
|
||||||
}
|
}
|
||||||
@@ -4532,6 +4537,16 @@ public class Notification implements Parcelable
|
|||||||
: mConversationTitle;
|
: mConversationTitle;
|
||||||
boolean hasTitle = !TextUtils.isEmpty(title);
|
boolean hasTitle = !TextUtils.isEmpty(title);
|
||||||
|
|
||||||
|
if (!hasTitle && mMessages.size() == 1) {
|
||||||
|
CharSequence sender = mMessages.get(0).mSender;
|
||||||
|
CharSequence text = mMessages.get(0).mText;
|
||||||
|
RemoteViews contentView = mBuilder.applyStandardTemplateWithActions(
|
||||||
|
mBuilder.getBigTextLayoutResource(),
|
||||||
|
false /* progress */, sender, null /* text */);
|
||||||
|
BigTextStyle.applyBigTextContentView(mBuilder, contentView, text);
|
||||||
|
return contentView;
|
||||||
|
}
|
||||||
|
|
||||||
RemoteViews contentView = mBuilder.applyStandardTemplateWithActions(
|
RemoteViews contentView = mBuilder.applyStandardTemplateWithActions(
|
||||||
mBuilder.getMessagingLayoutResource(),
|
mBuilder.getMessagingLayoutResource(),
|
||||||
false /* hasProgress */,
|
false /* hasProgress */,
|
||||||
|
|||||||
Reference in New Issue
Block a user