Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +23 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ public abstract class ExpandableView extends FrameLayout { private boolean mActualHeightInitialized; private boolean mDark; private ArrayList<View> mMatchParentViews = new ArrayList<View>(); private int mClipTopOptimization; private static Rect mClipRect = new Rect(); public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -141,6 +143,7 @@ public abstract class ExpandableView extends FrameLayout { public void setActualHeight(int actualHeight, boolean notifyListeners) { mActualHeightInitialized = true; mActualHeight = actualHeight; updateClipping(); if (notifyListeners) { notifyHeightChanged(); } Loading Loading @@ -299,6 +302,26 @@ public abstract class ExpandableView extends FrameLayout { outRect.top += getTranslationY() + getClipTopAmount(); } private void updateClipping() { mClipRect.set(0, mClipTopOptimization, getWidth(), getActualHeight()); setClipBounds(mClipRect); } public int getClipTopOptimization() { return mClipTopOptimization; } /** * Set that the view will be clipped by a given amount from the top. Contrary to * {@link #setClipTopAmount} this amount doesn't effect shadows and the background. * * @param clipTopOptimization the amount to clip from the top */ public void setClipTopOptimization(int clipTopOptimization) { mClipTopOptimization = clipTopOptimization; updateClipping(); } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +15 −2 Original line number Diff line number Diff line Loading @@ -723,7 +723,6 @@ public class NotificationStackScrollLayout extends ViewGroup } public void dismissViewAnimated(View child, Runnable endRunnable, int delay, long duration) { child.setClipBounds(null); mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration); } Loading Loading @@ -1566,7 +1565,7 @@ public class NotificationStackScrollLayout extends ViewGroup updateAnimationState(false, child); // Make sure the clipRect we might have set is removed child.setClipBounds(null); ((ExpandableView) child).setClipTopOptimization(0); } /** Loading Loading @@ -2343,6 +2342,20 @@ public class NotificationStackScrollLayout extends ViewGroup public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; mDismissView.setDismissAllInProgress(dismissAllInProgress); if (dismissAllInProgress) { disableClipOptimization(); } } private void disableClipOptimization() { final int count = getChildCount(); for (int i = 0; i < count; i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child.getVisibility() == GONE) { continue; } child.setClipTopOptimization(0); } } public boolean isDismissViewNotGone() { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java +4 −18 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.stack; import android.graphics.Rect; import android.util.Log; import android.view.View; import android.view.ViewGroup; Loading @@ -40,7 +39,6 @@ public class StackScrollState { private final ViewGroup mHostView; private Map<ExpandableView, StackViewState> mStateMap; private final Rect mClipRect = new Rect(); private final int mClearAllTopPadding; public StackScrollState(ViewGroup hostView) { Loading Loading @@ -152,7 +150,10 @@ public class StackScrollState { if (oldClipTopAmount != state.clipTopAmount) { view.setClipTopAmount(state.clipTopAmount); } updateChildClip(view, newHeight, state.topOverLap); float oldClipTopOptimization = view.getClipTopOptimization(); if (oldClipTopOptimization != state.topOverLap) { view.setClipTopOptimization(state.topOverLap); } return true; } Loading Loading @@ -211,21 +212,6 @@ public class StackScrollState { } } /** * Updates the clipping of a view * * @param child the view to update * @param height the currently applied height of the view * @param clipInset how much should this view be clipped from the top */ private void updateChildClip(View child, int height, int clipInset) { mClipRect.set(0, clipInset, child.getWidth(), height); child.setClipBounds(mClipRect); } public void performSpeedBumpAnimation(int i, SpeedBumpView speedBump, StackViewState state, long delay) { View nextChild = getNextChildNotGone(i); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class StackStateAnimator { continue; } child.setClipBounds(null); child.setClipTopOptimization(0); startStackAnimations(child, viewState, finalState, i, -1 /* fixedDelay */); } if (!isRunning()) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java +23 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ public abstract class ExpandableView extends FrameLayout { private boolean mActualHeightInitialized; private boolean mDark; private ArrayList<View> mMatchParentViews = new ArrayList<View>(); private int mClipTopOptimization; private static Rect mClipRect = new Rect(); public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -141,6 +143,7 @@ public abstract class ExpandableView extends FrameLayout { public void setActualHeight(int actualHeight, boolean notifyListeners) { mActualHeightInitialized = true; mActualHeight = actualHeight; updateClipping(); if (notifyListeners) { notifyHeightChanged(); } Loading Loading @@ -299,6 +302,26 @@ public abstract class ExpandableView extends FrameLayout { outRect.top += getTranslationY() + getClipTopAmount(); } private void updateClipping() { mClipRect.set(0, mClipTopOptimization, getWidth(), getActualHeight()); setClipBounds(mClipRect); } public int getClipTopOptimization() { return mClipTopOptimization; } /** * Set that the view will be clipped by a given amount from the top. Contrary to * {@link #setClipTopAmount} this amount doesn't effect shadows and the background. * * @param clipTopOptimization the amount to clip from the top */ public void setClipTopOptimization(int clipTopOptimization) { mClipTopOptimization = clipTopOptimization; updateClipping(); } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +15 −2 Original line number Diff line number Diff line Loading @@ -723,7 +723,6 @@ public class NotificationStackScrollLayout extends ViewGroup } public void dismissViewAnimated(View child, Runnable endRunnable, int delay, long duration) { child.setClipBounds(null); mSwipeHelper.dismissChild(child, 0, endRunnable, delay, true, duration); } Loading Loading @@ -1566,7 +1565,7 @@ public class NotificationStackScrollLayout extends ViewGroup updateAnimationState(false, child); // Make sure the clipRect we might have set is removed child.setClipBounds(null); ((ExpandableView) child).setClipTopOptimization(0); } /** Loading Loading @@ -2343,6 +2342,20 @@ public class NotificationStackScrollLayout extends ViewGroup public void setDismissAllInProgress(boolean dismissAllInProgress) { mDismissAllInProgress = dismissAllInProgress; mDismissView.setDismissAllInProgress(dismissAllInProgress); if (dismissAllInProgress) { disableClipOptimization(); } } private void disableClipOptimization() { final int count = getChildCount(); for (int i = 0; i < count; i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child.getVisibility() == GONE) { continue; } child.setClipTopOptimization(0); } } public boolean isDismissViewNotGone() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollState.java +4 −18 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.stack; import android.graphics.Rect; import android.util.Log; import android.view.View; import android.view.ViewGroup; Loading @@ -40,7 +39,6 @@ public class StackScrollState { private final ViewGroup mHostView; private Map<ExpandableView, StackViewState> mStateMap; private final Rect mClipRect = new Rect(); private final int mClearAllTopPadding; public StackScrollState(ViewGroup hostView) { Loading Loading @@ -152,7 +150,10 @@ public class StackScrollState { if (oldClipTopAmount != state.clipTopAmount) { view.setClipTopAmount(state.clipTopAmount); } updateChildClip(view, newHeight, state.topOverLap); float oldClipTopOptimization = view.getClipTopOptimization(); if (oldClipTopOptimization != state.topOverLap) { view.setClipTopOptimization(state.topOverLap); } return true; } Loading Loading @@ -211,21 +212,6 @@ public class StackScrollState { } } /** * Updates the clipping of a view * * @param child the view to update * @param height the currently applied height of the view * @param clipInset how much should this view be clipped from the top */ private void updateChildClip(View child, int height, int clipInset) { mClipRect.set(0, clipInset, child.getWidth(), height); child.setClipBounds(mClipRect); } public void performSpeedBumpAnimation(int i, SpeedBumpView speedBump, StackViewState state, long delay) { View nextChild = getNextChildNotGone(i); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +1 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,7 @@ public class StackStateAnimator { continue; } child.setClipBounds(null); child.setClipTopOptimization(0); startStackAnimations(child, viewState, finalState, i, -1 /* fixedDelay */); } if (!isRunning()) { Loading