From 185b6f6483c9e9b81092f4280496b6c5842d1266 Mon Sep 17 00:00:00 2001 From: Anthony Chen Date: Thu, 25 May 2017 10:58:23 -0700 Subject: [PATCH] Fix bug where the wrong width was being set on the NotificationPanelView. The QS panel and notification panel now have different widths; so, need to pass the correct one when reloading it. Test: booted up on AAE headunit and phone Change-Id: I9aef0c6725dd1969fabedaa3f08bf01811f52d6b --- .../phone/NotificationsQuickSettingsContainer.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 41154376daa8c..1952a21057caf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java @@ -20,6 +20,7 @@ import android.app.Fragment; import android.content.Context; import android.content.res.Configuration; import android.graphics.Canvas; +import android.support.annotation.DimenRes; import android.util.AttributeSet; import android.view.View; import android.view.ViewStub; @@ -32,7 +33,6 @@ import com.android.systemui.SysUiServiceProvider; import com.android.systemui.fragments.FragmentHostManager; import com.android.systemui.fragments.FragmentHostManager.FragmentListener; import com.android.systemui.plugins.qs.QS; -import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.statusbar.NotificationData.Entry; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; @@ -91,14 +91,16 @@ public class NotificationsQuickSettingsContainer extends FrameLayout @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - reloadWidth(mQsFrame); - reloadWidth(mStackScroller); + reloadWidth(mQsFrame, R.dimen.qs_panel_width); + reloadWidth(mStackScroller, R.dimen.notification_panel_width); } - private void reloadWidth(View view) { + /** + * Loads the given width resource and sets it on the given View. + */ + private void reloadWidth(View view, @DimenRes int width) { LayoutParams params = (LayoutParams) view.getLayoutParams(); - params.width = getContext().getResources().getDimensionPixelSize( - R.dimen.qs_panel_width); + params.width = getResources().getDimensionPixelSize(width); view.setLayoutParams(params); }