Merge "Adjust QS side spacing in split shade according to specs" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
eb08799ad3
@@ -22,6 +22,4 @@
|
|||||||
<!-- Overload default clock widget parameters -->
|
<!-- Overload default clock widget parameters -->
|
||||||
<dimen name="widget_big_font_size">88dp</dimen>
|
<dimen name="widget_big_font_size">88dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_panel_padding_top">16dp</dimen>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
android:id="@+id/tile_page"
|
android:id="@+id/tile_page"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingStart="@dimen/notification_side_paddings"
|
android:paddingStart="@dimen/qs_tiles_page_horizontal_margin"
|
||||||
android:paddingEnd="@dimen/notification_side_paddings"
|
android:paddingEnd="@dimen/qs_tiles_page_horizontal_margin"
|
||||||
android:clipChildren="false"
|
android:clipChildren="false"
|
||||||
android:clipToPadding="false" />
|
android:clipToPadding="false" />
|
||||||
|
|||||||
@@ -21,13 +21,20 @@
|
|||||||
<dimen name="keyguard_indication_margin_bottom">25dp</dimen>
|
<dimen name="keyguard_indication_margin_bottom">25dp</dimen>
|
||||||
<dimen name="ambient_indication_margin_bottom">115dp</dimen>
|
<dimen name="ambient_indication_margin_bottom">115dp</dimen>
|
||||||
<dimen name="lock_icon_margin_bottom">60dp</dimen>
|
<dimen name="lock_icon_margin_bottom">60dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_media_session_height_expanded">172dp</dimen>
|
|
||||||
|
|
||||||
<!-- margin from keyguard status bar to clock. For split shade it should be
|
<!-- margin from keyguard status bar to clock. For split shade it should be
|
||||||
keyguard_split_shade_top_margin - status_bar_header_height_keyguard = 8dp -->
|
keyguard_split_shade_top_margin - status_bar_header_height_keyguard = 8dp -->
|
||||||
<dimen name="keyguard_clock_top_margin">8dp</dimen>
|
<dimen name="keyguard_clock_top_margin">8dp</dimen>
|
||||||
|
|
||||||
|
<!-- QS-->
|
||||||
|
<dimen name="qs_panel_padding_top">16dp</dimen>
|
||||||
|
<dimen name="qs_content_horizontal_padding">24dp</dimen>
|
||||||
|
<dimen name="qs_horizontal_margin">24dp</dimen>
|
||||||
|
<!-- in split shade qs_tiles_page_horizontal_margin should be equal of qs_horizontal_margin/2,
|
||||||
|
otherwise full space between two pages is qs_horizontal_margin*2, and that makes tiles page
|
||||||
|
not appear immediately after user swipes to the side -->
|
||||||
|
<dimen name="qs_tiles_page_horizontal_margin">12dp</dimen>
|
||||||
|
<dimen name="qs_media_session_height_expanded">172dp</dimen>
|
||||||
|
|
||||||
<dimen name="split_shade_notifications_scrim_margin_bottom">16dp</dimen>
|
<dimen name="split_shade_notifications_scrim_margin_bottom">16dp</dimen>
|
||||||
|
|
||||||
<dimen name="notification_panel_margin_bottom">48dp</dimen>
|
<dimen name="notification_panel_margin_bottom">48dp</dimen>
|
||||||
|
|||||||
@@ -26,6 +26,12 @@
|
|||||||
<dimen name="status_bar_header_height_keyguard">56dp</dimen>
|
<dimen name="status_bar_header_height_keyguard">56dp</dimen>
|
||||||
|
|
||||||
<dimen name="qs_media_session_height_expanded">251dp</dimen>
|
<dimen name="qs_media_session_height_expanded">251dp</dimen>
|
||||||
|
<dimen name="qs_content_horizontal_padding">40dp</dimen>
|
||||||
|
<dimen name="qs_horizontal_margin">40dp</dimen>
|
||||||
|
<!-- in split shade qs_tiles_page_horizontal_margin should be equal of qs_horizontal_margin/2,
|
||||||
|
otherwise full space between two pages is qs_horizontal_margin*2, and that makes tiles page
|
||||||
|
not appear immediately after user swipes to the side -->
|
||||||
|
<dimen name="qs_tiles_page_horizontal_margin">20dp</dimen>
|
||||||
|
|
||||||
<dimen name="lockscreen_shade_max_over_scroll_amount">42dp</dimen>
|
<dimen name="lockscreen_shade_max_over_scroll_amount">42dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -478,6 +478,22 @@
|
|||||||
<dimen name="qqs_layout_margin_top">16dp</dimen>
|
<dimen name="qqs_layout_margin_top">16dp</dimen>
|
||||||
<dimen name="qqs_layout_padding_bottom">24dp</dimen>
|
<dimen name="qqs_layout_padding_bottom">24dp</dimen>
|
||||||
|
|
||||||
|
<!-- Most of the time it should be the same as notification_side_paddings as it's vertically
|
||||||
|
aligned with notifications. The exception is split shade when this value becomes
|
||||||
|
independent -->
|
||||||
|
<dimen name="qs_horizontal_margin">@dimen/notification_side_paddings</dimen>
|
||||||
|
|
||||||
|
<!-- Most of the time it should be the same as notification_shade_content_margin_horizontal as
|
||||||
|
it's vertically aligned with notifications. The exception is split shade when this value
|
||||||
|
becomes independent -->
|
||||||
|
<dimen name="qs_content_horizontal_padding">@dimen/notification_shade_content_margin_horizontal</dimen>
|
||||||
|
|
||||||
|
<!-- Most of the time it should be the same as notification_side_paddings as it's vertically
|
||||||
|
aligned with notifications. That's not the case on large screen when we have either split
|
||||||
|
shade and QS is not above notifications or in portrait shade when notification scrim is no
|
||||||
|
longer full width and next page of tiles should be at the edge of the screen -->
|
||||||
|
<dimen name="qs_tiles_page_horizontal_margin">@dimen/notification_side_paddings</dimen>
|
||||||
|
|
||||||
<dimen name="qs_customize_internal_side_paddings">8dp</dimen>
|
<dimen name="qs_customize_internal_side_paddings">8dp</dimen>
|
||||||
<dimen name="qs_icon_size">20dp</dimen>
|
<dimen name="qs_icon_size">20dp</dimen>
|
||||||
<dimen name="qs_side_view_size">28dp</dimen>
|
<dimen name="qs_side_view_size">28dp</dimen>
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
private QSCustomizer mQSCustomizer;
|
private QSCustomizer mQSCustomizer;
|
||||||
private NonInterceptingScrollView mQSPanelContainer;
|
private NonInterceptingScrollView mQSPanelContainer;
|
||||||
|
|
||||||
private int mSideMargins;
|
private int mHorizontalMargins;
|
||||||
|
private int mTilesPageMargin;
|
||||||
private boolean mQsDisabled;
|
private boolean mQsDisabled;
|
||||||
private int mContentPadding = -1;
|
private int mContentHorizontalPadding = -1;
|
||||||
private boolean mClippingEnabled;
|
private boolean mClippingEnabled;
|
||||||
|
|
||||||
public QSContainerImpl(Context context, AttributeSet attrs) {
|
public QSContainerImpl(Context context, AttributeSet attrs) {
|
||||||
@@ -145,12 +146,17 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
mQSPanelContainer.getPaddingEnd(),
|
mQSPanelContainer.getPaddingEnd(),
|
||||||
bottomPadding);
|
bottomPadding);
|
||||||
|
|
||||||
int sideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings);
|
int horizontalMargins = getResources().getDimensionPixelSize(R.dimen.qs_horizontal_margin);
|
||||||
int padding = getResources().getDimensionPixelSize(
|
int horizontalPadding = getResources().getDimensionPixelSize(
|
||||||
R.dimen.notification_shade_content_margin_horizontal);
|
R.dimen.qs_content_horizontal_padding);
|
||||||
boolean marginsChanged = padding != mContentPadding || sideMargins != mSideMargins;
|
int tilesPageMargin = getResources().getDimensionPixelSize(
|
||||||
mContentPadding = padding;
|
R.dimen.qs_tiles_page_horizontal_margin);
|
||||||
mSideMargins = sideMargins;
|
boolean marginsChanged = horizontalPadding != mContentHorizontalPadding
|
||||||
|
|| horizontalMargins != mHorizontalMargins
|
||||||
|
|| tilesPageMargin != mTilesPageMargin;
|
||||||
|
mContentHorizontalPadding = horizontalPadding;
|
||||||
|
mHorizontalMargins = horizontalMargins;
|
||||||
|
mTilesPageMargin = tilesPageMargin;
|
||||||
if (marginsChanged) {
|
if (marginsChanged) {
|
||||||
updatePaddingsAndMargins(qsPanelController, quickStatusBarHeaderController);
|
updatePaddingsAndMargins(qsPanelController, quickStatusBarHeaderController);
|
||||||
}
|
}
|
||||||
@@ -198,22 +204,22 @@ public class QSContainerImpl extends FrameLayout implements Dumpable {
|
|||||||
// Only padding for FooterActionsView, no margin. That way, the background goes
|
// Only padding for FooterActionsView, no margin. That way, the background goes
|
||||||
// all the way to the edge.
|
// all the way to the edge.
|
||||||
LayoutParams lp = (LayoutParams) view.getLayoutParams();
|
LayoutParams lp = (LayoutParams) view.getLayoutParams();
|
||||||
lp.rightMargin = mSideMargins;
|
lp.rightMargin = mHorizontalMargins;
|
||||||
lp.leftMargin = mSideMargins;
|
lp.leftMargin = mHorizontalMargins;
|
||||||
}
|
}
|
||||||
if (view == mQSPanelContainer) {
|
if (view == mQSPanelContainer) {
|
||||||
// QS panel lays out some of its content full width
|
// QS panel lays out some of its content full width
|
||||||
qsPanelController.setContentMargins(mContentPadding, mContentPadding);
|
qsPanelController.setContentMargins(mContentHorizontalPadding,
|
||||||
// Set it as double the side margin (to simulate end margin of current page +
|
mContentHorizontalPadding);
|
||||||
// start margin of next page).
|
qsPanelController.setPageMargin(mTilesPageMargin);
|
||||||
qsPanelController.setPageMargin(mSideMargins);
|
|
||||||
} else if (view == mHeader) {
|
} else if (view == mHeader) {
|
||||||
quickStatusBarHeaderController.setContentMargins(mContentPadding, mContentPadding);
|
quickStatusBarHeaderController.setContentMargins(mContentHorizontalPadding,
|
||||||
|
mContentHorizontalPadding);
|
||||||
} else {
|
} else {
|
||||||
view.setPaddingRelative(
|
view.setPaddingRelative(
|
||||||
mContentPadding,
|
mContentHorizontalPadding,
|
||||||
view.getPaddingTop(),
|
view.getPaddingTop(),
|
||||||
mContentPadding,
|
mContentHorizontalPadding,
|
||||||
view.getPaddingBottom());
|
view.getPaddingBottom());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user