Loading core/java/android/app/Notification.java +21 −17 Original line number Diff line number Diff line Loading @@ -4826,33 +4826,37 @@ public class Notification implements Parcelable contentView.setViewVisibility(rowId, View.GONE); } final boolean largeText = mBuilder.mContext.getResources().getConfiguration().fontScale > 1f; final float subTextSize = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_subtext_size); int i=0; final float density = mBuilder.mContext.getResources().getDisplayMetrics().density; int topPadding = (int) (5 * density); int bottomPadding = mBuilder.mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_content_margin_bottom); int topPadding = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_inbox_item_top_padding); boolean first = true; while (i < mTexts.size() && i < rowIds.length) { int onlyViewId = 0; int maxRows = rowIds.length; if (mBuilder.mActions.size() > 0) { maxRows--; } while (i < mTexts.size() && i < maxRows) { CharSequence str = mTexts.get(i); if (str != null && !str.equals("")) { if (!TextUtils.isEmpty(str)) { contentView.setViewVisibility(rowIds[i], View.VISIBLE); contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str)); if (largeText) { contentView.setTextViewTextSize(rowIds[i], TypedValue.COMPLEX_UNIT_PX, subTextSize); } contentView.setViewPadding(rowIds[i], 0, topPadding, 0, i == rowIds.length - 1 || i == mTexts.size() - 1 ? bottomPadding : 0); contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0); handleInboxImageMargin(contentView, rowIds[i], first); if (first) { onlyViewId = rowIds[i]; } else { onlyViewId = 0; } first = false; } i++; } if (onlyViewId != 0) { // We only have 1 entry, lets make it look like the normal Text of a Bigtext topPadding = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_text_margin_top); contentView.setViewPadding(onlyViewId, 0, topPadding, 0, 0); } return contentView; } Loading core/res/res/layout/notification_template_material_big_text.xml +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ <com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="0.5dp" android:layout_marginTop="@dimen/notification_text_margin_top" android:paddingBottom="@dimen/notification_content_margin_bottom" android:textAppearance="@style/TextAppearance.Material.Notification" android:singleLine="false" Loading core/res/res/layout/notification_template_material_inbox.xml +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ android:layout_gravity="top" android:paddingStart="@dimen/notification_content_margin_start" android:paddingEnd="@dimen/notification_content_margin_end" android:paddingBottom="@dimen/notification_content_margin_bottom" android:minHeight="@dimen/notification_min_content_height" android:clipToPadding="false" android:orientation="vertical" Loading core/res/res/layout/notification_template_text.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginTop="0.5dp" android:layout_marginTop="@dimen/notification_text_margin_top" android:ellipsize="marquee" android:fadingEdge="horizontal" android:gravity="top" Loading core/res/res/values/dimens.xml +6 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,12 @@ <!-- Padding for notification icon when drawn with circle around it --> <dimen name="notification_large_icon_circle_padding">11dp</dimen> <!-- The margin on top of the text of the notification --> <dimen name="notification_text_margin_top">0.5dp</dimen> <!-- The padding on top of inbox style elements --> <dimen name="notification_inbox_item_top_padding">5dp</dimen> <!-- Size of the profile badge for notifications --> <dimen name="notification_badge_size">12dp</dimen> Loading Loading
core/java/android/app/Notification.java +21 −17 Original line number Diff line number Diff line Loading @@ -4826,33 +4826,37 @@ public class Notification implements Parcelable contentView.setViewVisibility(rowId, View.GONE); } final boolean largeText = mBuilder.mContext.getResources().getConfiguration().fontScale > 1f; final float subTextSize = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_subtext_size); int i=0; final float density = mBuilder.mContext.getResources().getDisplayMetrics().density; int topPadding = (int) (5 * density); int bottomPadding = mBuilder.mContext.getResources().getDimensionPixelSize( com.android.internal.R.dimen.notification_content_margin_bottom); int topPadding = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_inbox_item_top_padding); boolean first = true; while (i < mTexts.size() && i < rowIds.length) { int onlyViewId = 0; int maxRows = rowIds.length; if (mBuilder.mActions.size() > 0) { maxRows--; } while (i < mTexts.size() && i < maxRows) { CharSequence str = mTexts.get(i); if (str != null && !str.equals("")) { if (!TextUtils.isEmpty(str)) { contentView.setViewVisibility(rowIds[i], View.VISIBLE); contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str)); if (largeText) { contentView.setTextViewTextSize(rowIds[i], TypedValue.COMPLEX_UNIT_PX, subTextSize); } contentView.setViewPadding(rowIds[i], 0, topPadding, 0, i == rowIds.length - 1 || i == mTexts.size() - 1 ? bottomPadding : 0); contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0); handleInboxImageMargin(contentView, rowIds[i], first); if (first) { onlyViewId = rowIds[i]; } else { onlyViewId = 0; } first = false; } i++; } if (onlyViewId != 0) { // We only have 1 entry, lets make it look like the normal Text of a Bigtext topPadding = mBuilder.mContext.getResources().getDimensionPixelSize( R.dimen.notification_text_margin_top); contentView.setViewPadding(onlyViewId, 0, topPadding, 0, 0); } return contentView; } Loading
core/res/res/layout/notification_template_material_big_text.xml +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ <com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="0.5dp" android:layout_marginTop="@dimen/notification_text_margin_top" android:paddingBottom="@dimen/notification_content_margin_bottom" android:textAppearance="@style/TextAppearance.Material.Notification" android:singleLine="false" Loading
core/res/res/layout/notification_template_material_inbox.xml +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ android:layout_gravity="top" android:paddingStart="@dimen/notification_content_margin_start" android:paddingEnd="@dimen/notification_content_margin_end" android:paddingBottom="@dimen/notification_content_margin_bottom" android:minHeight="@dimen/notification_min_content_height" android:clipToPadding="false" android:orientation="vertical" Loading
core/res/res/layout/notification_template_text.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginTop="0.5dp" android:layout_marginTop="@dimen/notification_text_margin_top" android:ellipsize="marquee" android:fadingEdge="horizontal" android:gravity="top" Loading
core/res/res/values/dimens.xml +6 −0 Original line number Diff line number Diff line Loading @@ -290,6 +290,12 @@ <!-- Padding for notification icon when drawn with circle around it --> <dimen name="notification_large_icon_circle_padding">11dp</dimen> <!-- The margin on top of the text of the notification --> <dimen name="notification_text_margin_top">0.5dp</dimen> <!-- The padding on top of inbox style elements --> <dimen name="notification_inbox_item_top_padding">5dp</dimen> <!-- Size of the profile badge for notifications --> <dimen name="notification_badge_size">12dp</dimen> Loading