Merge "Fixed the paddings in inbox style to match the rest of the templates" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
14d8be728b
@@ -4826,33 +4826,37 @@ public class Notification implements Parcelable
|
|||||||
contentView.setViewVisibility(rowId, View.GONE);
|
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;
|
int i=0;
|
||||||
final float density = mBuilder.mContext.getResources().getDisplayMetrics().density;
|
int topPadding = mBuilder.mContext.getResources().getDimensionPixelSize(
|
||||||
int topPadding = (int) (5 * density);
|
R.dimen.notification_inbox_item_top_padding);
|
||||||
int bottomPadding = mBuilder.mContext.getResources().getDimensionPixelSize(
|
|
||||||
com.android.internal.R.dimen.notification_content_margin_bottom);
|
|
||||||
boolean first = true;
|
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);
|
CharSequence str = mTexts.get(i);
|
||||||
if (str != null && !str.equals("")) {
|
if (!TextUtils.isEmpty(str)) {
|
||||||
contentView.setViewVisibility(rowIds[i], View.VISIBLE);
|
contentView.setViewVisibility(rowIds[i], View.VISIBLE);
|
||||||
contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str));
|
contentView.setTextViewText(rowIds[i], mBuilder.processLegacyText(str));
|
||||||
if (largeText) {
|
contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0);
|
||||||
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);
|
|
||||||
handleInboxImageMargin(contentView, rowIds[i], first);
|
handleInboxImageMargin(contentView, rowIds[i], first);
|
||||||
|
if (first) {
|
||||||
|
onlyViewId = rowIds[i];
|
||||||
|
} else {
|
||||||
|
onlyViewId = 0;
|
||||||
|
}
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
i++;
|
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;
|
return contentView;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text"
|
<com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
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:paddingBottom="@dimen/notification_content_margin_bottom"
|
||||||
android:textAppearance="@style/TextAppearance.Material.Notification"
|
android:textAppearance="@style/TextAppearance.Material.Notification"
|
||||||
android:singleLine="false"
|
android:singleLine="false"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingStart="@dimen/notification_content_margin_start"
|
android:paddingStart="@dimen/notification_content_margin_start"
|
||||||
android:paddingEnd="@dimen/notification_content_margin_end"
|
android:paddingEnd="@dimen/notification_content_margin_end"
|
||||||
|
android:paddingBottom="@dimen/notification_content_margin_bottom"
|
||||||
android:minHeight="@dimen/notification_min_content_height"
|
android:minHeight="@dimen/notification_min_content_height"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:layout_marginTop="0.5dp"
|
android:layout_marginTop="@dimen/notification_text_margin_top"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:fadingEdge="horizontal"
|
android:fadingEdge="horizontal"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
|
|||||||
@@ -290,6 +290,12 @@
|
|||||||
<!-- Padding for notification icon when drawn with circle around it -->
|
<!-- Padding for notification icon when drawn with circle around it -->
|
||||||
<dimen name="notification_large_icon_circle_padding">11dp</dimen>
|
<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 -->
|
<!-- Size of the profile badge for notifications -->
|
||||||
<dimen name="notification_badge_size">12dp</dimen>
|
<dimen name="notification_badge_size">12dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -2548,6 +2548,9 @@
|
|||||||
|
|
||||||
<java-symbol type="dimen" name="notification_messaging_spacing" />
|
<java-symbol type="dimen" name="notification_messaging_spacing" />
|
||||||
|
|
||||||
|
<java-symbol type="dimen" name="notification_text_margin_top" />
|
||||||
|
<java-symbol type="dimen" name="notification_inbox_item_top_padding" />
|
||||||
|
|
||||||
<!-- WallpaperManager config -->
|
<!-- WallpaperManager config -->
|
||||||
<java-symbol type="string" name="config_wallpaperCropperPackage" />
|
<java-symbol type="string" name="config_wallpaperCropperPackage" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user