Merge "Switch to SystemUI dimen for notification margins."
This commit is contained in:
committed by
Android (Google) Code Review
commit
5230154698
@@ -207,9 +207,6 @@
|
||||
<!-- Default padding for dialogs. -->
|
||||
<dimen name="dialog_padding">16dp</dimen>
|
||||
|
||||
<!-- The horizontal margin of the content in the notification shade -->
|
||||
<dimen name="notification_shade_content_margin_horizontal">16dp</dimen>
|
||||
|
||||
<!-- The margin on the start of the content view -->
|
||||
<dimen name="notification_content_margin_start">16dp</dimen>
|
||||
|
||||
|
||||
@@ -2864,7 +2864,6 @@
|
||||
<java-symbol type="drawable" name="ic_collapse_bundle" />
|
||||
<java-symbol type="dimen" name="notification_min_content_height" />
|
||||
<java-symbol type="dimen" name="notification_header_shrink_min_width" />
|
||||
<java-symbol type="dimen" name="notification_shade_content_margin_horizontal" />
|
||||
<java-symbol type="dimen" name="notification_content_margin_start" />
|
||||
<java-symbol type="dimen" name="notification_content_margin_end" />
|
||||
<java-symbol type="dimen" name="notification_reply_inset" />
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@*android:dimen/notification_content_margin_start">
|
||||
android:paddingStart="@dimen/notification_shade_content_margin_horizontal">
|
||||
|
||||
<!-- Package Info -->
|
||||
<LinearLayout
|
||||
@@ -120,7 +120,7 @@ asked for it -->
|
||||
android:id="@+id/inline_controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
||||
android:paddingEnd="@dimen/notification_shade_content_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/notification_guts_option_vertical_padding"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@*android:dimen/notification_content_margin_start">
|
||||
android:paddingStart="@dimen/notification_shade_content_margin_horizontal">
|
||||
|
||||
<!-- Package Info -->
|
||||
<LinearLayout
|
||||
@@ -93,7 +93,7 @@
|
||||
android:id="@+id/inline_controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="@*android:dimen/notification_content_margin_end"
|
||||
android:paddingEnd="@dimen/notification_shade_content_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/notification_guts_option_vertical_padding"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
|
||||
@@ -623,6 +623,9 @@
|
||||
@dimen/notification_divider_height
|
||||
</dimen>
|
||||
|
||||
<!-- The horizontal margin of the content in the notification shade -->
|
||||
<dimen name="notification_shade_content_margin_horizontal">16dp</dimen>
|
||||
|
||||
<!-- The top margin for the notification children container in its non-expanded form. -->
|
||||
<dimen name="notification_children_container_margin_top">
|
||||
@*android:dimen/notification_content_margin_top
|
||||
|
||||
@@ -71,8 +71,7 @@ public class QSContainerImpl extends FrameLayout {
|
||||
|
||||
private int mSideMargins;
|
||||
private boolean mQsDisabled;
|
||||
private int mContentPaddingStart = -1;
|
||||
private int mContentPaddingEnd = -1;
|
||||
private int mContentPadding = -1;
|
||||
private boolean mAnimateBottomOnNextLayout;
|
||||
|
||||
public QSContainerImpl(Context context, AttributeSet attrs) {
|
||||
@@ -206,10 +205,9 @@ public class QSContainerImpl extends FrameLayout {
|
||||
|
||||
mSideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings);
|
||||
int padding = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_shade_content_margin_horizontal);
|
||||
boolean marginsChanged = padding != mContentPaddingStart || padding != mContentPaddingEnd;
|
||||
mContentPaddingStart = padding;
|
||||
mContentPaddingEnd = padding;
|
||||
R.dimen.notification_shade_content_margin_horizontal);
|
||||
boolean marginsChanged = padding != mContentPadding;
|
||||
mContentPadding = padding;
|
||||
if (marginsChanged) {
|
||||
updatePaddingsAndMargins();
|
||||
}
|
||||
@@ -290,19 +288,19 @@ public class QSContainerImpl extends FrameLayout {
|
||||
lp.leftMargin = mSideMargins;
|
||||
if (view == mQSPanelContainer) {
|
||||
// QS panel lays out some of its content full width
|
||||
mQSPanel.setContentMargins(mContentPaddingStart, mContentPaddingEnd);
|
||||
mQSPanel.setContentMargins(mContentPadding, mContentPadding);
|
||||
Pair<Integer, Integer> margins = mQSPanel.getVisualSideMargins();
|
||||
// Apply paddings based on QSPanel
|
||||
mQSCustomizer.setContentPaddings(margins.first, margins.second);
|
||||
} else if (view == mHeader) {
|
||||
// The header contains the QQS panel which needs to have special padding, to
|
||||
// visually align them.
|
||||
mHeader.setContentMargins(mContentPaddingStart, mContentPaddingEnd);
|
||||
mHeader.setContentMargins(mContentPadding, mContentPadding);
|
||||
} else {
|
||||
view.setPaddingRelative(
|
||||
mContentPaddingStart,
|
||||
mContentPadding,
|
||||
view.getPaddingTop(),
|
||||
mContentPaddingEnd,
|
||||
mContentPadding,
|
||||
view.getPaddingBottom());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user