Loading core/java/android/app/Notification.java +34 −2 Original line number Diff line number Diff line Loading @@ -3386,8 +3386,16 @@ public class Notification implements Parcelable */ public static abstract class Style { private CharSequence mBigContentTitle; private CharSequence mSummaryText = null; private boolean mSummaryTextSet = false; /** * @hide */ protected CharSequence mSummaryText = null; /** * @hide */ protected boolean mSummaryTextSet = false; protected Builder mBuilder; Loading Loading @@ -3679,6 +3687,11 @@ public class Notification implements Parcelable * @see Notification#bigContentView */ public static class BigTextStyle extends Style { private static final int MAX_LINES = 13; private static final int LINES_CONSUMED_BY_ACTIONS = 3; private static final int LINES_CONSUMED_BY_SUMMARY = 2; private CharSequence mBigText; public BigTextStyle() { Loading Loading @@ -3745,6 +3758,7 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.big_text, mBuilder.processLegacyText(mBigText)); contentView.setViewVisibility(R.id.big_text, View.VISIBLE); contentView.setInt(R.id.big_text, "setMaxLines", calculateMaxLines()); contentView.setViewVisibility(R.id.text2, View.GONE); applyTopPadding(contentView); Loading @@ -3756,6 +3770,24 @@ public class Notification implements Parcelable return contentView; } private int calculateMaxLines() { int lineCount = MAX_LINES; boolean hasActions = mBuilder.mActions.size() > 0; boolean hasSummary = (mSummaryTextSet ? mSummaryText : mBuilder.mSubText) != null; if (hasActions) { lineCount -= LINES_CONSUMED_BY_ACTIONS; } if (hasSummary) { lineCount -= LINES_CONSUMED_BY_SUMMARY; } // If we have less top padding at the top, we can fit less lines. if (!mBuilder.mHasThreeLines) { lineCount--; } return lineCount; } /** * @hide */ Loading core/res/res/layout/notification_template_material_inbox.xml +1 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ android:layout_width="match_parent" android:layout_weight="1" android:layout_height="0dp" android:layout_marginEnd="8dp" android:orientation="horizontal" > <TextView android:id="@+id/inbox_text0" Loading @@ -60,7 +61,6 @@ android:layout_height="@dimen/notification_badge_size" android:layout_weight="0" android:layout_marginStart="4dp" android:layout_marginEnd="8dp" android:scaleType="fitCenter" android:visibility="gone" /> Loading Loading
core/java/android/app/Notification.java +34 −2 Original line number Diff line number Diff line Loading @@ -3386,8 +3386,16 @@ public class Notification implements Parcelable */ public static abstract class Style { private CharSequence mBigContentTitle; private CharSequence mSummaryText = null; private boolean mSummaryTextSet = false; /** * @hide */ protected CharSequence mSummaryText = null; /** * @hide */ protected boolean mSummaryTextSet = false; protected Builder mBuilder; Loading Loading @@ -3679,6 +3687,11 @@ public class Notification implements Parcelable * @see Notification#bigContentView */ public static class BigTextStyle extends Style { private static final int MAX_LINES = 13; private static final int LINES_CONSUMED_BY_ACTIONS = 3; private static final int LINES_CONSUMED_BY_SUMMARY = 2; private CharSequence mBigText; public BigTextStyle() { Loading Loading @@ -3745,6 +3758,7 @@ public class Notification implements Parcelable contentView.setTextViewText(R.id.big_text, mBuilder.processLegacyText(mBigText)); contentView.setViewVisibility(R.id.big_text, View.VISIBLE); contentView.setInt(R.id.big_text, "setMaxLines", calculateMaxLines()); contentView.setViewVisibility(R.id.text2, View.GONE); applyTopPadding(contentView); Loading @@ -3756,6 +3770,24 @@ public class Notification implements Parcelable return contentView; } private int calculateMaxLines() { int lineCount = MAX_LINES; boolean hasActions = mBuilder.mActions.size() > 0; boolean hasSummary = (mSummaryTextSet ? mSummaryText : mBuilder.mSubText) != null; if (hasActions) { lineCount -= LINES_CONSUMED_BY_ACTIONS; } if (hasSummary) { lineCount -= LINES_CONSUMED_BY_SUMMARY; } // If we have less top padding at the top, we can fit less lines. if (!mBuilder.mHasThreeLines) { lineCount--; } return lineCount; } /** * @hide */ Loading
core/res/res/layout/notification_template_material_inbox.xml +1 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ android:layout_width="match_parent" android:layout_weight="1" android:layout_height="0dp" android:layout_marginEnd="8dp" android:orientation="horizontal" > <TextView android:id="@+id/inbox_text0" Loading @@ -60,7 +61,6 @@ android:layout_height="@dimen/notification_badge_size" android:layout_weight="0" android:layout_marginStart="4dp" android:layout_marginEnd="8dp" android:scaleType="fitCenter" android:visibility="gone" /> Loading