Loading packages/SystemUI/src/com/android/systemui/ExpandHelper.java +24 −2 Original line number Original line Diff line number Diff line Loading @@ -545,6 +545,16 @@ public class ExpandHelper implements Gefingerpoken { */ */ @VisibleForTesting @VisibleForTesting void finishExpanding(boolean forceAbort, float velocity) { void finishExpanding(boolean forceAbort, float velocity) { finishExpanding(forceAbort, velocity, true /* allowAnimation */); } /** * Finish the current expand motion * @param forceAbort whether the expansion should be forcefully aborted and returned to the old * state * @param velocity the velocity this was expanded/ collapsed with */ private void finishExpanding(boolean forceAbort, float velocity, boolean allowAnimation) { if (!mExpanding) return; if (!mExpanding) return; if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mResizedView); if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mResizedView); Loading @@ -568,7 +578,7 @@ public class ExpandHelper implements Gefingerpoken { mCallback.expansionStateChanged(false); mCallback.expansionStateChanged(false); int naturalHeight = mScaler.getNaturalHeight(); int naturalHeight = mScaler.getNaturalHeight(); float targetHeight = nowExpanded ? naturalHeight : mSmallSize; float targetHeight = nowExpanded ? naturalHeight : mSmallSize; if (targetHeight != currentHeight && mEnabled) { if (targetHeight != currentHeight && mEnabled && allowAnimation) { mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setupStartValues(); mScaleAnimation.setupStartValues(); final View scaledView = mResizedView; final View scaledView = mResizedView; Loading Loading @@ -621,11 +631,23 @@ public class ExpandHelper implements Gefingerpoken { mResizedView = null; mResizedView = null; } } /** * Use this to abort any pending expansions in progress and force that there will be no * animations. */ public void cancelImmediately() { cancel(false /* allowAnimation */); } /** /** * Use this to abort any pending expansions in progress. * Use this to abort any pending expansions in progress. */ */ public void cancel() { public void cancel() { finishExpanding(true /* forceAbort */, 0f /* velocity */); cancel(true /* allowAnimation */); } private void cancel(boolean allowAnimation) { finishExpanding(true /* forceAbort */, 0f /* velocity */, allowAnimation); clearView(); clearView(); // reset the gesture detector // reset the gesture detector Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +23 −8 Original line number Original line Diff line number Diff line Loading @@ -3362,7 +3362,22 @@ public class NotificationStackScrollLayout extends ViewGroup if (!mIsExpanded) { if (!mIsExpanded) { setOwnScrollY(0); setOwnScrollY(0); mStatusBar.resetUserExpandedStates(); mStatusBar.resetUserExpandedStates(); clearTemporaryViews(); clearUserLockedViews(); } } private void clearUserLockedViews() { for (int i = 0; i < getChildCount(); i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setUserLocked(false); } } } private void clearTemporaryViews() { // lets make sure nothing is in the overlay / transient anymore // lets make sure nothing is in the overlay / transient anymore clearTemporaryViews(this); clearTemporaryViews(this); for (int i = 0; i < getChildCount(); i++) { for (int i = 0; i < getChildCount(); i++) { Loading @@ -3373,7 +3388,6 @@ public class NotificationStackScrollLayout extends ViewGroup } } } } } } } private void clearTemporaryViews(ViewGroup viewGroup) { private void clearTemporaryViews(ViewGroup viewGroup) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { Loading Loading @@ -3405,6 +3419,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (changed) { if (changed) { if (!mIsExpanded) { if (!mIsExpanded) { mGroupManager.collapseAllGroups(); mGroupManager.collapseAllGroups(); mExpandHelper.cancelImmediately(); } } updateNotificationAnimationStates(); updateNotificationAnimationStates(); updateChronometers(); updateChronometers(); Loading Loading
packages/SystemUI/src/com/android/systemui/ExpandHelper.java +24 −2 Original line number Original line Diff line number Diff line Loading @@ -545,6 +545,16 @@ public class ExpandHelper implements Gefingerpoken { */ */ @VisibleForTesting @VisibleForTesting void finishExpanding(boolean forceAbort, float velocity) { void finishExpanding(boolean forceAbort, float velocity) { finishExpanding(forceAbort, velocity, true /* allowAnimation */); } /** * Finish the current expand motion * @param forceAbort whether the expansion should be forcefully aborted and returned to the old * state * @param velocity the velocity this was expanded/ collapsed with */ private void finishExpanding(boolean forceAbort, float velocity, boolean allowAnimation) { if (!mExpanding) return; if (!mExpanding) return; if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mResizedView); if (DEBUG) Log.d(TAG, "scale in finishing on view: " + mResizedView); Loading @@ -568,7 +578,7 @@ public class ExpandHelper implements Gefingerpoken { mCallback.expansionStateChanged(false); mCallback.expansionStateChanged(false); int naturalHeight = mScaler.getNaturalHeight(); int naturalHeight = mScaler.getNaturalHeight(); float targetHeight = nowExpanded ? naturalHeight : mSmallSize; float targetHeight = nowExpanded ? naturalHeight : mSmallSize; if (targetHeight != currentHeight && mEnabled) { if (targetHeight != currentHeight && mEnabled && allowAnimation) { mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setFloatValues(targetHeight); mScaleAnimation.setupStartValues(); mScaleAnimation.setupStartValues(); final View scaledView = mResizedView; final View scaledView = mResizedView; Loading Loading @@ -621,11 +631,23 @@ public class ExpandHelper implements Gefingerpoken { mResizedView = null; mResizedView = null; } } /** * Use this to abort any pending expansions in progress and force that there will be no * animations. */ public void cancelImmediately() { cancel(false /* allowAnimation */); } /** /** * Use this to abort any pending expansions in progress. * Use this to abort any pending expansions in progress. */ */ public void cancel() { public void cancel() { finishExpanding(true /* forceAbort */, 0f /* velocity */); cancel(true /* allowAnimation */); } private void cancel(boolean allowAnimation) { finishExpanding(true /* forceAbort */, 0f /* velocity */, allowAnimation); clearView(); clearView(); // reset the gesture detector // reset the gesture detector Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +23 −8 Original line number Original line Diff line number Diff line Loading @@ -3362,7 +3362,22 @@ public class NotificationStackScrollLayout extends ViewGroup if (!mIsExpanded) { if (!mIsExpanded) { setOwnScrollY(0); setOwnScrollY(0); mStatusBar.resetUserExpandedStates(); mStatusBar.resetUserExpandedStates(); clearTemporaryViews(); clearUserLockedViews(); } } private void clearUserLockedViews() { for (int i = 0; i < getChildCount(); i++) { ExpandableView child = (ExpandableView) getChildAt(i); if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setUserLocked(false); } } } private void clearTemporaryViews() { // lets make sure nothing is in the overlay / transient anymore // lets make sure nothing is in the overlay / transient anymore clearTemporaryViews(this); clearTemporaryViews(this); for (int i = 0; i < getChildCount(); i++) { for (int i = 0; i < getChildCount(); i++) { Loading @@ -3373,7 +3388,6 @@ public class NotificationStackScrollLayout extends ViewGroup } } } } } } } private void clearTemporaryViews(ViewGroup viewGroup) { private void clearTemporaryViews(ViewGroup viewGroup) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { while (viewGroup != null && viewGroup.getTransientViewCount() != 0) { Loading Loading @@ -3405,6 +3419,7 @@ public class NotificationStackScrollLayout extends ViewGroup if (changed) { if (changed) { if (!mIsExpanded) { if (!mIsExpanded) { mGroupManager.collapseAllGroups(); mGroupManager.collapseAllGroups(); mExpandHelper.cancelImmediately(); } } updateNotificationAnimationStates(); updateNotificationAnimationStates(); updateChronometers(); updateChronometers(); Loading