diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 457238acfdfb7..caade703acb4b 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -1614,6 +1614,7 @@ public class Notification implements Parcelable
{
private CharSequence mBigContentTitle;
private CharSequence mSummaryText = null;
+ private boolean mSummaryTextSet = false;
protected Builder mBuilder;
@@ -1630,6 +1631,7 @@ public class Notification implements Parcelable
*/
protected void internalSetSummaryText(CharSequence cs) {
mSummaryText = cs;
+ mSummaryTextSet = true;
}
public void setBuilder(Builder builder) {
@@ -1660,9 +1662,13 @@ public class Notification implements Parcelable
contentView.setViewVisibility(R.id.line1, View.VISIBLE);
}
- // The last line defaults to the content text or subtext, but can be replaced by mSummaryText
- if (mSummaryText != null && !mSummaryText.equals("")) {
- contentView.setTextViewText(R.id.text, mSummaryText);
+ // The last line defaults to the subtext, but can be replaced by mSummaryText
+ final CharSequence overflowText =
+ mSummaryTextSet ? mSummaryText
+ : mBuilder.mSubText;
+ if (overflowText != null) {
+ contentView.setTextViewText(R.id.text, overflowText);
+ contentView.setViewVisibility(R.id.overflow_divider, View.VISIBLE);
contentView.setViewVisibility(R.id.line3, View.VISIBLE);
}
@@ -1803,9 +1809,16 @@ public class Notification implements Parcelable
}
private RemoteViews makeBigContentView() {
- // Remove the content text so line3 disappears entirely
+ // Remove the content text so line3 only shows if you have a summary
+ final boolean hadThreeLines = (mBuilder.mContentText != null && mBuilder.mSubText != null);
mBuilder.mContentText = null;
RemoteViews contentView = getStandardView(R.layout.notification_template_big_text);
+
+ if (hadThreeLines) {
+ // vertical centering
+ contentView.setViewPadding(R.id.line1, 0, 0, 0, 0);
+ }
+
contentView.setTextViewText(R.id.big_text, mBigText);
contentView.setViewVisibility(R.id.big_text, View.VISIBLE);
contentView.setViewVisibility(R.id.text2, View.GONE);
@@ -1875,7 +1888,10 @@ public class Notification implements Parcelable
}
private RemoteViews makeBigContentView() {
+ // Remove the content text so line3 disappears unless you have a summary
+ mBuilder.mContentText = null;
RemoteViews contentView = getStandardView(R.layout.notification_template_inbox);
+
contentView.setViewVisibility(R.id.text2, View.GONE);
int[] rowIds = {R.id.inbox_text0, R.id.inbox_text1, R.id.inbox_text2, R.id.inbox_text3,
diff --git a/core/res/res/layout/notification_template_big_picture.xml b/core/res/res/layout/notification_template_big_picture.xml
index ecb36168ce81a..172dfe5e41e16 100644
--- a/core/res/res/layout/notification_template_big_picture.xml
+++ b/core/res/res/layout/notification_template_big_picture.xml
@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="208dp"
- android:layout_marginLeft="64dp"
+ android:paddingLeft="64dp"
android:layout_gravity="bottom"
android:background="#CC111111"
>
diff --git a/core/res/res/layout/notification_template_big_text.xml b/core/res/res/layout/notification_template_big_text.xml
index b86177e4e64ff..d37788203294a 100644
--- a/core/res/res/layout/notification_template_big_text.xml
+++ b/core/res/res/layout/notification_template_big_text.xml
@@ -110,6 +110,7 @@
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
+ android:layout_marginTop="2dp"
android:singleLine="false"
android:visibility="gone"
android:maxLines="8"
diff --git a/core/res/res/layout/notification_template_inbox.xml b/core/res/res/layout/notification_template_inbox.xml
index e9a3686dbe895..8ee626395244c 100644
--- a/core/res/res/layout/notification_template_inbox.xml
+++ b/core/res/res/layout/notification_template_inbox.xml
@@ -191,9 +191,8 @@
+ android:id="@+id/overflow_divider"
+ android:layout_marginTop="8dp"
+ android:visibility="visible"
+ android:background="?android:attr/dividerHorizontal" />