From e18c2cd81050061c2ec3adf8f7939dcdb2d80900 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 8 May 2014 19:16:49 +0200 Subject: [PATCH] Make notification panel fullscreen on tablets. We only inset the notification themselves on tablets, and also the header when not on the lockscreen (on the lockscreen, the header must be full width so the icons are at the correct location). Change-Id: I85c8a4559f59b016432dab4a73236352233d9159 --- .../SystemUI/res/layout/status_bar_expanded.xml | 11 ++--------- .../res/layout/status_bar_expanded_header.xml | 6 +++--- packages/SystemUI/res/layout/super_status_bar.xml | 3 ++- packages/SystemUI/res/values-sw600dp/styles.xml | 9 +++++++-- packages/SystemUI/res/values/styles.xml | 6 ++++-- .../statusbar/phone/StatusBarHeaderView.java | 14 ++++++++++++++ 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 56c0e10b70f36..f045da47a2cbd 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -50,9 +50,8 @@ /> @@ -89,13 +88,7 @@ - - + diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index f7cd37ce81ce6..26616cd29756b 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -35,7 +35,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" > diff --git a/packages/SystemUI/res/values-sw600dp/styles.xml b/packages/SystemUI/res/values-sw600dp/styles.xml index 1ea94429e738a..d4a99866335c1 100644 --- a/packages/SystemUI/res/values-sw600dp/styles.xml +++ b/packages/SystemUI/res/values-sw600dp/styles.xml @@ -19,9 +19,14 @@ 480dp - + + diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 6608c5d1e2ce8..1ad1e3e4af9d8 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -171,10 +171,12 @@ + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java index b8c5374743752..d79642fba5fd4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java @@ -42,6 +42,9 @@ public class StatusBarHeaderView extends RelativeLayout { private int mExpandedHeight; private int mKeyguardHeight; + private int mKeyguardWidth = ViewGroup.LayoutParams.MATCH_PARENT; + private int mNormalWidth; + private boolean mKeyguardShowing; public StatusBarHeaderView(Context context, AttributeSet attrs) { @@ -65,6 +68,7 @@ public class StatusBarHeaderView extends RelativeLayout { R.dimen.status_bar_header_height_expanded); mKeyguardHeight = getResources().getDimensionPixelSize( R.dimen.status_bar_header_height_keyguard); + mNormalWidth = getLayoutParams().width; } public int getCollapsedHeight() { @@ -107,6 +111,15 @@ public class StatusBarHeaderView extends RelativeLayout { } } + private void updateWidth() { + int width = mKeyguardShowing ? mKeyguardWidth : mNormalWidth; + ViewGroup.LayoutParams lp = getLayoutParams(); + if (width != lp.width) { + lp.width = width; + setLayoutParams(lp); + } + } + public void setExpansion(float height) { if (height < mCollapsedHeight) { height = mCollapsedHeight; @@ -140,6 +153,7 @@ public class StatusBarHeaderView extends RelativeLayout { setTranslationZ(0); } updateHeights(); + updateWidth(); } public void setUserInfoController(UserInfoController userInfoController) {