From bef6de8b3fafea4453e28ecd419561563fcae771 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 3 Feb 2016 11:26:07 -0500 Subject: [PATCH] Update QS + Notification landscape width Make it bigger, also make QS + Notification width update on config change, so the new width can take effect. Change-Id: Id069d21358d7bb716a1dfadc21fa11d1e5d69575 --- packages/SystemUI/res/values-land/config.xml | 2 -- packages/SystemUI/res/values-land/dimens.xml | 3 +-- .../res/values-w550dp-land/config.xml | 24 +++++++++++++++++++ .../res/values-w550dp-land/dimens.xml | 21 ++++++++++++++++ .../NotificationsQuickSettingsContainer.java | 15 ++++++++++++ 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 packages/SystemUI/res/values-w550dp-land/config.xml create mode 100644 packages/SystemUI/res/values-w550dp-land/dimens.xml diff --git a/packages/SystemUI/res/values-land/config.xml b/packages/SystemUI/res/values-land/config.xml index e0affa1778979..43e7bacd3d411 100644 --- a/packages/SystemUI/res/values-land/config.xml +++ b/packages/SystemUI/res/values-land/config.xml @@ -38,6 +38,4 @@ while the stack is not focused. --> -2 1.5 - - 4 diff --git a/packages/SystemUI/res/values-land/dimens.xml b/packages/SystemUI/res/values-land/dimens.xml index c75a89fa4b315..26a81c8d835cf 100644 --- a/packages/SystemUI/res/values-land/dimens.xml +++ b/packages/SystemUI/res/values-land/dimens.xml @@ -19,8 +19,7 @@ @*android:dimen/navigation_bar_width - - @dimen/standard_notification_panel_width + @integer/standard_notification_panel_layout_gravity 2dp diff --git a/packages/SystemUI/res/values-w550dp-land/config.xml b/packages/SystemUI/res/values-w550dp-land/config.xml new file mode 100644 index 0000000000000..71e54a1ca61c9 --- /dev/null +++ b/packages/SystemUI/res/values-w550dp-land/config.xml @@ -0,0 +1,24 @@ + + + + + + 4 + diff --git a/packages/SystemUI/res/values-w550dp-land/dimens.xml b/packages/SystemUI/res/values-w550dp-land/dimens.xml new file mode 100644 index 0000000000000..eaca9d718fd20 --- /dev/null +++ b/packages/SystemUI/res/values-w550dp-land/dimens.xml @@ -0,0 +1,21 @@ + + + + + 544dp + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java index cbb71c5d97e61..fd28b095c09de 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.phone; import android.content.Context; +import android.content.res.Configuration; import android.graphics.Canvas; import android.util.AttributeSet; import android.view.View; @@ -54,6 +55,20 @@ public class NotificationsQuickSettingsContainer extends FrameLayout mUserSwitcher = userSwitcher; } + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + reloadWidth(mScrollView); + reloadWidth(mStackScroller); + } + + private void reloadWidth(View view) { + LayoutParams params = (LayoutParams) view.getLayoutParams(); + params.width = getContext().getResources().getDimensionPixelSize( + R.dimen.notification_panel_width); + view.setLayoutParams(params); + } + @Override public WindowInsets onApplyWindowInsets(WindowInsets insets) { setPadding(0, 0, 0, insets.getSystemWindowInsetBottom());