Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +4 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mRemoved = removed; } public NotificationChildrenContainer getChildrenContainer() { return mChildrenContainer; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } 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 mMinClipTopAmount = 0; private boolean mClipToActualHeight = true; private boolean mChangingPosition = false; private ViewGroup mTransientContainer; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -416,6 +417,14 @@ public abstract class ExpandableView extends FrameLayout { return mChangingPosition; } public void setTransientContainer(ViewGroup transientContainer) { mTransientContainer = transientContainer; } public ViewGroup getTransientContainer() { return mTransientContainer; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +2 −1 Original line number Diff line number Diff line Loading @@ -1747,7 +1747,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (mNotificationData.get(remove.getStatusBarNotification().getKey()) == null) { // We only want to add an animation if the view is completely removed // otherwise it's just a transfer mStackScroller.notifyGroupChildRemoved(remove); mStackScroller.notifyGroupChildRemoved(remove, parent.getChildrenContainer()); } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +49 −13 Original line number Diff line number Diff line Loading @@ -687,6 +687,17 @@ public class NotificationStackScrollLayout extends ViewGroup } public void onChildDismissed(View v) { ExpandableNotificationRow row = (ExpandableNotificationRow) v; if (!row.isDismissed()) { handleChildDismissed(v); } ViewGroup transientContainer = row.getTransientContainer(); if (transientContainer != null) { transientContainer.removeTransientView(v); } } private void handleChildDismissed(View v) { if (mDismissAllInProgress) { return; } Loading Loading @@ -2071,7 +2082,7 @@ public class NotificationStackScrollLayout extends ViewGroup // we only call our internal methods if this is actually a removal and not just a // notification which becomes a child notification if (!mChildTransferInProgress) { onViewRemovedInternal(child); onViewRemovedInternal(child, this); } } Loading @@ -2083,24 +2094,30 @@ public class NotificationStackScrollLayout extends ViewGroup } } private void onViewRemovedInternal(View child) { private void onViewRemovedInternal(View child, ViewGroup transientContainer) { if (mChangePositionInProgress) { // This is only a position change, don't do anything special return; } ((ExpandableView) child).setOnHeightChangedListener(null); ExpandableView expandableView = (ExpandableView) child; expandableView.setOnHeightChangedListener(null); mCurrentStackScrollState.removeViewStateForView(child); updateScrollStateForRemovedChild((ExpandableView) child); updateScrollStateForRemovedChild(expandableView); boolean animationGenerated = generateRemoveAnimation(child); if (animationGenerated && !mSwipedOutViews.contains(child)) { // Add this view to an overlay in order to ensure that it will still be temporary // drawn when removed if (animationGenerated) { if (!mSwipedOutViews.contains(child)) { getOverlay().add(child); } else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) { transientContainer.addTransientView(child, 0); expandableView.setTransientContainer(transientContainer); } } else { mSwipedOutViews.remove(child); } updateAnimationState(false, child); // Make sure the clipRect we might have set is removed ((ExpandableView) child).setClipTopOptimization(0); expandableView.setClipTopOptimization(0); } private boolean isChildInGroup(View child) { Loading Loading @@ -2277,8 +2294,8 @@ public class NotificationStackScrollLayout extends ViewGroup } } public void notifyGroupChildRemoved(View row) { onViewRemovedInternal(row); public void notifyGroupChildRemoved(View row, ViewGroup childrenContainer) { onViewRemovedInternal(row, childrenContainer); } public void notifyGroupChildAdded(View row) { Loading Loading @@ -2485,8 +2502,8 @@ public class NotificationStackScrollLayout extends ViewGroup // we need to know the view after this one event.viewAfterChangingView = getFirstChildBelowTranlsationY(child.getTranslationY()); mAnimationEvents.add(event); mSwipedOutViews.remove(child); } mSwipedOutViews.clear(); mChildrenToRemoveAnimated.clear(); } Loading Loading @@ -2764,11 +2781,25 @@ public class NotificationStackScrollLayout extends ViewGroup mOwnScrollY = 0; mPhoneStatusBar.resetUserExpandedStates(); // lets make sure nothing is in the overlay anymore // lets make sure nothing is in the overlay / transient anymore clearTransientViews(this); for (int i = 0; i < getChildCount(); i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; clearTransientViews(row.getChildrenContainer()); } } getOverlay().clear(); } } private void clearTransientViews(ViewGroup viewGroup) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { viewGroup.removeTransientView(getTransientView(0)); } } public void onPanelTrackingStarted() { mPanelTracking = true; } Loading Loading @@ -3591,6 +3622,11 @@ public class NotificationStackScrollLayout extends ViewGroup public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { super.dismissChild(view, velocity, useAccelerateInterpolator); if (mIsExpanded) { // We don't want to quick-dismiss when it's a heads up as this might lead to closing // of the panel early. handleChildDismissed(view); } handleGearCoveredOrDismissed(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +5 −1 Original line number Diff line number Diff line Loading @@ -865,8 +865,12 @@ public class StackStateAnimator { } else if (event.animationType == NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT) { // A race condition can trigger the view to be added to the overlay even though // it is swiped out. So let's remove it // it was fully swiped out. So let's remove it mHostLayout.getOverlay().remove(changingView); if (Math.abs(changingView.getTranslation()) == changingView.getWidth() && changingView.getTransientContainer() != null) { changingView.getTransientContainer().removeTransientView(changingView); } } else if (event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_GROUP_EXPANSION_CHANGED) { ExpandableNotificationRow row = (ExpandableNotificationRow) event.changingView; Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +4 −0 Original line number Diff line number Diff line Loading @@ -669,6 +669,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mRemoved = removed; } public NotificationChildrenContainer getChildrenContainer() { return mChildrenContainer; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } 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 mMinClipTopAmount = 0; private boolean mClipToActualHeight = true; private boolean mChangingPosition = false; private ViewGroup mTransientContainer; public ExpandableView(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -416,6 +417,14 @@ public abstract class ExpandableView extends FrameLayout { return mChangingPosition; } public void setTransientContainer(ViewGroup transientContainer) { mTransientContainer = transientContainer; } public ViewGroup getTransientContainer() { return mTransientContainer; } /** * A listener notifying when {@link #getActualHeight} changes. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +2 −1 Original line number Diff line number Diff line Loading @@ -1747,7 +1747,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (mNotificationData.get(remove.getStatusBarNotification().getKey()) == null) { // We only want to add an animation if the view is completely removed // otherwise it's just a transfer mStackScroller.notifyGroupChildRemoved(remove); mStackScroller.notifyGroupChildRemoved(remove, parent.getChildrenContainer()); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +49 −13 Original line number Diff line number Diff line Loading @@ -687,6 +687,17 @@ public class NotificationStackScrollLayout extends ViewGroup } public void onChildDismissed(View v) { ExpandableNotificationRow row = (ExpandableNotificationRow) v; if (!row.isDismissed()) { handleChildDismissed(v); } ViewGroup transientContainer = row.getTransientContainer(); if (transientContainer != null) { transientContainer.removeTransientView(v); } } private void handleChildDismissed(View v) { if (mDismissAllInProgress) { return; } Loading Loading @@ -2071,7 +2082,7 @@ public class NotificationStackScrollLayout extends ViewGroup // we only call our internal methods if this is actually a removal and not just a // notification which becomes a child notification if (!mChildTransferInProgress) { onViewRemovedInternal(child); onViewRemovedInternal(child, this); } } Loading @@ -2083,24 +2094,30 @@ public class NotificationStackScrollLayout extends ViewGroup } } private void onViewRemovedInternal(View child) { private void onViewRemovedInternal(View child, ViewGroup transientContainer) { if (mChangePositionInProgress) { // This is only a position change, don't do anything special return; } ((ExpandableView) child).setOnHeightChangedListener(null); ExpandableView expandableView = (ExpandableView) child; expandableView.setOnHeightChangedListener(null); mCurrentStackScrollState.removeViewStateForView(child); updateScrollStateForRemovedChild((ExpandableView) child); updateScrollStateForRemovedChild(expandableView); boolean animationGenerated = generateRemoveAnimation(child); if (animationGenerated && !mSwipedOutViews.contains(child)) { // Add this view to an overlay in order to ensure that it will still be temporary // drawn when removed if (animationGenerated) { if (!mSwipedOutViews.contains(child)) { getOverlay().add(child); } else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) { transientContainer.addTransientView(child, 0); expandableView.setTransientContainer(transientContainer); } } else { mSwipedOutViews.remove(child); } updateAnimationState(false, child); // Make sure the clipRect we might have set is removed ((ExpandableView) child).setClipTopOptimization(0); expandableView.setClipTopOptimization(0); } private boolean isChildInGroup(View child) { Loading Loading @@ -2277,8 +2294,8 @@ public class NotificationStackScrollLayout extends ViewGroup } } public void notifyGroupChildRemoved(View row) { onViewRemovedInternal(row); public void notifyGroupChildRemoved(View row, ViewGroup childrenContainer) { onViewRemovedInternal(row, childrenContainer); } public void notifyGroupChildAdded(View row) { Loading Loading @@ -2485,8 +2502,8 @@ public class NotificationStackScrollLayout extends ViewGroup // we need to know the view after this one event.viewAfterChangingView = getFirstChildBelowTranlsationY(child.getTranslationY()); mAnimationEvents.add(event); mSwipedOutViews.remove(child); } mSwipedOutViews.clear(); mChildrenToRemoveAnimated.clear(); } Loading Loading @@ -2764,11 +2781,25 @@ public class NotificationStackScrollLayout extends ViewGroup mOwnScrollY = 0; mPhoneStatusBar.resetUserExpandedStates(); // lets make sure nothing is in the overlay anymore // lets make sure nothing is in the overlay / transient anymore clearTransientViews(this); for (int i = 0; i < getChildCount(); i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; clearTransientViews(row.getChildrenContainer()); } } getOverlay().clear(); } } private void clearTransientViews(ViewGroup viewGroup) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { viewGroup.removeTransientView(getTransientView(0)); } } public void onPanelTrackingStarted() { mPanelTracking = true; } Loading Loading @@ -3591,6 +3622,11 @@ public class NotificationStackScrollLayout extends ViewGroup public void dismissChild(final View view, float velocity, boolean useAccelerateInterpolator) { super.dismissChild(view, velocity, useAccelerateInterpolator); if (mIsExpanded) { // We don't want to quick-dismiss when it's a heads up as this might lead to closing // of the panel early. handleChildDismissed(view); } handleGearCoveredOrDismissed(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackStateAnimator.java +5 −1 Original line number Diff line number Diff line Loading @@ -865,8 +865,12 @@ public class StackStateAnimator { } else if (event.animationType == NotificationStackScrollLayout.AnimationEvent.ANIMATION_TYPE_REMOVE_SWIPED_OUT) { // A race condition can trigger the view to be added to the overlay even though // it is swiped out. So let's remove it // it was fully swiped out. So let's remove it mHostLayout.getOverlay().remove(changingView); if (Math.abs(changingView.getTranslation()) == changingView.getWidth() && changingView.getTransientContainer() != null) { changingView.getTransientContainer().removeTransientView(changingView); } } else if (event.animationType == NotificationStackScrollLayout .AnimationEvent.ANIMATION_TYPE_GROUP_EXPANSION_CHANGED) { ExpandableNotificationRow row = (ExpandableNotificationRow) event.changingView; Loading