Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +9 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public abstract class ExpandableView extends FrameLayout { private int mClipTopOptimization; private static Rect mClipRect = new Rect(); private boolean mWillBeGone; private int mMinClipTopAmount = 0; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -400,6 +401,14 @@ public abstract class ExpandableView extends FrameLayout { mWillBeGone = willBeGone; } public int getMinClipTopAmount() { return mMinClipTopAmount; } public void setMinClipTopAmount(int minClipTopAmount) { mMinClipTopAmount = minClipTopAmount; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +1 −6 Original line number Diff line number Diff line Loading @@ -946,6 +946,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, addPostCollapseAction(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); try { mBarService.onClearAllNotifications(mCurrentUserId); } catch (Exception ex) { } Loading @@ -960,12 +961,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, Runnable animationFinishAction = new Runnable() { @Override public void run() { mStackScroller.post(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); } }); animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); } }; Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +9 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AmbientState { private int mTopPadding; private boolean mShadeExpanded; private float mMaxHeadsUpTranslation; private boolean mDismissAllInProgress; public int getScrollY() { return mScrollY; Loading Loading @@ -183,4 +184,12 @@ public class AmbientState { HeadsUpManager.HeadsUpEntry topEntry = mHeadsUpManager.getTopEntry(); return topEntry == null ? null : topEntry.entry.row; } public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; } public boolean isDismissAllInProgress() { return mDismissAllInProgress; } } packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +20 −2 Original line number Diff line number Diff line Loading @@ -773,8 +773,7 @@ public class NotificationStackScrollLayout extends ViewGroup } public boolean canChildBeDismissed(View v) { final View veto = v.findViewById(R.id.veto); return (veto != null && veto.getVisibility() != View.GONE); return StackScrollAlgorithm.canChildBeDismissed(v); } @Override Loading Loading @@ -2610,9 +2609,28 @@ public class NotificationStackScrollLayout extends ViewGroup public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; mDismissView.setDismissAllInProgress(dismissAllInProgress); mAmbientState.setDismissAllInProgress(dismissAllInProgress); if (dismissAllInProgress) { disableClipOptimization(); } handleDismissAllClipping(); } private void handleDismissAllClipping() { final int count = getChildCount(); boolean previousChildWillBeDismissed = false; for (int i = 0; i < count; i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child.getVisibility() == GONE) { continue; } if (mDismissAllInProgress && previousChildWillBeDismissed) { child.setMinClipTopAmount(child.getClipTopAmount()); } else { child.setMinClipTopAmount(0); } previousChildWillBeDismissed = canChildBeDismissed(child); } } private void disableClipOptimization() { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +17 −3 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ public class StackScrollAlgorithm { private void updateClipping(StackScrollState resultState, StackScrollAlgorithmState algorithmState, AmbientState ambientState) { boolean dismissAllInProgress = ambientState.isDismissAllInProgress(); float previousNotificationEnd = 0; float previousNotificationStart = 0; boolean previousNotificationIsSwiped = false; Loading Loading @@ -237,16 +238,29 @@ public class StackScrollAlgorithm { updateChildClippingAndBackground(state, newHeight, clipHeight, newHeight - (previousNotificationStart - newYTranslation)); if (dismissAllInProgress) { state.clipTopAmount = Math.max(child.getMinClipTopAmount(), state.clipTopAmount); } if (!child.isTransparent()) { // Only update the previous values if we are not transparent, // otherwise we would clip to a transparent view. previousNotificationStart = newYTranslation + state.clipTopAmount * state.scale; previousNotificationEnd = newNotificationEnd; if ((dismissAllInProgress && canChildBeDismissed(child))) { previousNotificationIsSwiped = true; } else { previousNotificationIsSwiped = ambientState.getDraggedViews().contains(child); previousNotificationEnd = newNotificationEnd; previousNotificationStart = newYTranslation + state.clipTopAmount * state.scale; } } } } public static boolean canChildBeDismissed(View v) { final View veto = v.findViewById(R.id.veto); return (veto != null && veto.getVisibility() != View.GONE); } /** * Updates the shadow outline and the clipping for a view. * Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +9 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ public abstract class ExpandableView extends FrameLayout { private int mClipTopOptimization; private static Rect mClipRect = new Rect(); private boolean mWillBeGone; private int mMinClipTopAmount = 0; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -400,6 +401,14 @@ public abstract class ExpandableView extends FrameLayout { mWillBeGone = willBeGone; } public int getMinClipTopAmount() { return mMinClipTopAmount; } public void setMinClipTopAmount(int minClipTopAmount) { mMinClipTopAmount = minClipTopAmount; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +1 −6 Original line number Diff line number Diff line Loading @@ -946,6 +946,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, addPostCollapseAction(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); try { mBarService.onClearAllNotifications(mCurrentUserId); } catch (Exception ex) { } Loading @@ -960,12 +961,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, Runnable animationFinishAction = new Runnable() { @Override public void run() { mStackScroller.post(new Runnable() { @Override public void run() { mStackScroller.setDismissAllInProgress(false); } }); animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); } }; Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +9 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class AmbientState { private int mTopPadding; private boolean mShadeExpanded; private float mMaxHeadsUpTranslation; private boolean mDismissAllInProgress; public int getScrollY() { return mScrollY; Loading Loading @@ -183,4 +184,12 @@ public class AmbientState { HeadsUpManager.HeadsUpEntry topEntry = mHeadsUpManager.getTopEntry(); return topEntry == null ? null : topEntry.entry.row; } public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; } public boolean isDismissAllInProgress() { return mDismissAllInProgress; } }
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +20 −2 Original line number Diff line number Diff line Loading @@ -773,8 +773,7 @@ public class NotificationStackScrollLayout extends ViewGroup } public boolean canChildBeDismissed(View v) { final View veto = v.findViewById(R.id.veto); return (veto != null && veto.getVisibility() != View.GONE); return StackScrollAlgorithm.canChildBeDismissed(v); } @Override Loading Loading @@ -2610,9 +2609,28 @@ public class NotificationStackScrollLayout extends ViewGroup public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; mDismissView.setDismissAllInProgress(dismissAllInProgress); mAmbientState.setDismissAllInProgress(dismissAllInProgress); if (dismissAllInProgress) { disableClipOptimization(); } handleDismissAllClipping(); } private void handleDismissAllClipping() { final int count = getChildCount(); boolean previousChildWillBeDismissed = false; for (int i = 0; i < count; i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child.getVisibility() == GONE) { continue; } if (mDismissAllInProgress && previousChildWillBeDismissed) { child.setMinClipTopAmount(child.getClipTopAmount()); } else { child.setMinClipTopAmount(0); } previousChildWillBeDismissed = canChildBeDismissed(child); } } private void disableClipOptimization() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +17 −3 Original line number Diff line number Diff line Loading @@ -202,6 +202,7 @@ public class StackScrollAlgorithm { private void updateClipping(StackScrollState resultState, StackScrollAlgorithmState algorithmState, AmbientState ambientState) { boolean dismissAllInProgress = ambientState.isDismissAllInProgress(); float previousNotificationEnd = 0; float previousNotificationStart = 0; boolean previousNotificationIsSwiped = false; Loading Loading @@ -237,16 +238,29 @@ public class StackScrollAlgorithm { updateChildClippingAndBackground(state, newHeight, clipHeight, newHeight - (previousNotificationStart - newYTranslation)); if (dismissAllInProgress) { state.clipTopAmount = Math.max(child.getMinClipTopAmount(), state.clipTopAmount); } if (!child.isTransparent()) { // Only update the previous values if we are not transparent, // otherwise we would clip to a transparent view. previousNotificationStart = newYTranslation + state.clipTopAmount * state.scale; previousNotificationEnd = newNotificationEnd; if ((dismissAllInProgress && canChildBeDismissed(child))) { previousNotificationIsSwiped = true; } else { previousNotificationIsSwiped = ambientState.getDraggedViews().contains(child); previousNotificationEnd = newNotificationEnd; previousNotificationStart = newYTranslation + state.clipTopAmount * state.scale; } } } } public static boolean canChildBeDismissed(View v) { final View veto = v.findViewById(R.id.veto); return (veto != null && veto.getVisibility() != View.GONE); } /** * Updates the shadow outline and the clipping for a view. * Loading