@@ -1614,6 +1614,7 @@ public static abstract class Style
16141614 {
16151615 private CharSequence mBigContentTitle ;
16161616 private CharSequence mSummaryText = null ;
1617+ private boolean mSummaryTextSet = false ;
16171618
16181619 protected Builder mBuilder ;
16191620
@@ -1630,6 +1631,7 @@ protected void internalSetBigContentTitle(CharSequence title) {
16301631 */
16311632 protected void internalSetSummaryText (CharSequence cs ) {
16321633 mSummaryText = cs ;
1634+ mSummaryTextSet = true ;
16331635 }
16341636
16351637 public void setBuilder (Builder builder ) {
@@ -1660,9 +1662,13 @@ protected RemoteViews getStandardView(int layoutId) {
16601662 contentView .setViewVisibility (R .id .line1 , View .VISIBLE );
16611663 }
16621664
1663- // The last line defaults to the content text or subtext, but can be replaced by mSummaryText
1664- if (mSummaryText != null && !mSummaryText .equals ("" )) {
1665- contentView .setTextViewText (R .id .text , mSummaryText );
1665+ // The last line defaults to the subtext, but can be replaced by mSummaryText
1666+ final CharSequence overflowText =
1667+ mSummaryTextSet ? mSummaryText
1668+ : mBuilder .mSubText ;
1669+ if (overflowText != null ) {
1670+ contentView .setTextViewText (R .id .text , overflowText );
1671+ contentView .setViewVisibility (R .id .overflow_divider , View .VISIBLE );
16661672 contentView .setViewVisibility (R .id .line3 , View .VISIBLE );
16671673 }
16681674
@@ -1803,9 +1809,16 @@ public BigTextStyle bigText(CharSequence cs) {
18031809 }
18041810
18051811 private RemoteViews makeBigContentView () {
1806- // Remove the content text so line3 disappears entirely
1812+ // Remove the content text so line3 only shows if you have a summary
1813+ final boolean hadThreeLines = (mBuilder .mContentText != null && mBuilder .mSubText != null );
18071814 mBuilder .mContentText = null ;
18081815 RemoteViews contentView = getStandardView (R .layout .notification_template_big_text );
1816+
1817+ if (hadThreeLines ) {
1818+ // vertical centering
1819+ contentView .setViewPadding (R .id .line1 , 0 , 0 , 0 , 0 );
1820+ }
1821+
18091822 contentView .setTextViewText (R .id .big_text , mBigText );
18101823 contentView .setViewVisibility (R .id .big_text , View .VISIBLE );
18111824 contentView .setViewVisibility (R .id .text2 , View .GONE );
@@ -1875,7 +1888,10 @@ public InboxStyle addLine(CharSequence cs) {
18751888 }
18761889
18771890 private RemoteViews makeBigContentView () {
1891+ // Remove the content text so line3 disappears unless you have a summary
1892+ mBuilder .mContentText = null ;
18781893 RemoteViews contentView = getStandardView (R .layout .notification_template_inbox );
1894+
18791895 contentView .setViewVisibility (R .id .text2 , View .GONE );
18801896
18811897 int [] rowIds = {R .id .inbox_text0 , R .id .inbox_text1 , R .id .inbox_text2 , R .id .inbox_text3 ,
0 commit comments