Optimize alpha handling for stack scroller
Use a layer when an alpha is set. Currently, this breaks shadows
when alpha != 1f, however, b/15860114 will fix this.
Change-Id: I094d5896a5433ba9a0ecc17549ef2944f6b7881e
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 9b819f2b..e0167e9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -470,6 +470,10 @@
return mBottomStackPeekSize;
}
+ public int getCollapseSecondCardPadding() {
+ return mCollapseSecondCardPadding;
+ }
+
public void setLongPressListener(SwipeHelper.LongPressListener listener) {
mSwipeHelper.setLongPressListener(listener);
mLongPressListener = listener;
@@ -1955,8 +1959,10 @@
}
public void setScrimAlpha(float progress) {
- mAmbientState.setScrimAmount(progress);
- requestChildrenUpdate();
+ if (progress != mAmbientState.getScrimAmount()) {
+ mAmbientState.setScrimAmount(progress);
+ requestChildrenUpdate();
+ }
}
/**