diff --git a/packages/SystemUI/res/layout/status_bar_notification_shelf.xml b/packages/SystemUI/res/layout/status_bar_notification_shelf.xml index 088deba807f55..7bfbd3c542e1c 100644 --- a/packages/SystemUI/res/layout/status_bar_notification_shelf.xml +++ b/packages/SystemUI/res/layout/status_bar_notification_shelf.xml @@ -35,8 +35,8 @@ android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingStart="13dp" - android:paddingEnd="13dp" + android:paddingStart="@dimen/shelf_icon_container_padding" + android:paddingEnd="@dimen/shelf_icon_container_padding" android:gravity="center_vertical" /> 32dp + + 13dp + 15dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 6b9a89ef655b5..add47641c4b6a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -95,6 +95,12 @@ public class NotificationShelf extends ActivatableNotificationView { R.dimen.status_bar_padding_start); mPaddingBetweenElements = getResources().getDimensionPixelSize( R.dimen.notification_divider_height); + ViewGroup.LayoutParams layoutParams = getLayoutParams(); + layoutParams.height = getResources().getDimensionPixelOffset( + R.dimen.notification_shelf_height); + setLayoutParams(layoutParams); + int padding = getResources().getDimensionPixelOffset(R.dimen.shelf_icon_container_padding); + mShelfIcons.setPadding(padding, 0, padding, 0); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index 0dbff19b6bcf4..d543f49b9d026 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -8,7 +8,7 @@ import android.graphics.Rect; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; -import android.widget.LinearLayout; +import android.widget.FrameLayout; import com.android.internal.util.NotificationColorUtil; import com.android.systemui.R; @@ -73,16 +73,18 @@ public class NotificationIconAreaController { public void onDensityOrFontScaleChanged(Context context) { reloadDimens(context); - final LinearLayout.LayoutParams params = generateIconLayoutParams(); + final FrameLayout.LayoutParams params = generateIconLayoutParams(); for (int i = 0; i < mNotificationIcons.getChildCount(); i++) { View child = mNotificationIcons.getChildAt(i); child.setLayoutParams(params); + child = mShelfIcons.getChildAt(i); + child.setLayoutParams(params); } } @NonNull - private LinearLayout.LayoutParams generateIconLayoutParams() { - return new LinearLayout.LayoutParams( + private FrameLayout.LayoutParams generateIconLayoutParams() { + return new FrameLayout.LayoutParams( mIconSize + 2 * mIconHPadding, getHeight()); } @@ -203,7 +205,7 @@ public class NotificationIconAreaController { hostLayout.removeView(toRemove.get(i)); } - final LinearLayout.LayoutParams params = generateIconLayoutParams(); + final FrameLayout.LayoutParams params = generateIconLayoutParams(); for (int i = 0; i < toShow.size(); i++) { View v = toShow.get(i); // The view might still be transiently added if it was just removed and added again diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index bb86d6fae06cc..bbbdc13d69e34 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1074,7 +1074,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, updateClearAll(); inflateEmptyShadeView(); updateEmptyShadeView(); - inflateShelf(); mStatusBarKeyguardViewManager.onDensityOrFontScaleChanged(); mUserInfoController.onDensityOrFontScaleChanged(); if (mUserSwitcherController != null) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 49da79388c3a1..522e4a93b40e8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -3961,12 +3961,12 @@ public class NotificationStackScrollLayout extends ViewGroup } public void setShelf(NotificationShelf shelf) { - mShelf = shelf; int index = -1; if (mShelf != null) { index = indexOfChild(mShelf); removeView(mShelf); } + mShelf = shelf; addView(mShelf, index); mAmbientState.setShelf(shelf); mStateAnimator.setShelf(shelf);