Fix overexpand panel motion
Expanding was already set to false when we decided which QS overscroll animation to run. We can't change the order of expanding finished/tracking finished because of another bug. Instead, let the stack scroller know about tracking state and combine both of them. Bug: 21705230 Change-Id: I041ff1fabc6c939c233528f9d08d804ead64bbab
This commit is contained in:
@@ -1818,6 +1818,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED) {
|
||||
mAfforanceHelper.animateHideLeftRightIcon();
|
||||
}
|
||||
mNotificationStackScroller.onPanelTrackingStarted();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1827,6 +1828,7 @@ public class NotificationPanelView extends PanelView implements
|
||||
mNotificationStackScroller.setOverScrolledPixels(
|
||||
0.0f, true /* onTop */, true /* animate */);
|
||||
}
|
||||
mNotificationStackScroller.onPanelTrackingStopped();
|
||||
if (expand && (mStatusBar.getBarState() == StatusBarState.KEYGUARD
|
||||
|| mStatusBar.getBarState() == StatusBarState.SHADE_LOCKED)) {
|
||||
if (!mHintAnimationRunning) {
|
||||
|
||||
@@ -163,6 +163,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
private boolean mChildrenUpdateRequested;
|
||||
private SpeedBumpView mSpeedBumpView;
|
||||
private boolean mIsExpansionChanging;
|
||||
private boolean mPanelTracking;
|
||||
private boolean mExpandingNotification;
|
||||
private boolean mExpandedInThisMotion;
|
||||
private boolean mScrollingEnabled;
|
||||
@@ -1513,7 +1514,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
}
|
||||
if (mExpandedInThisMotion) {
|
||||
return RUBBER_BAND_FACTOR_AFTER_EXPAND;
|
||||
} else if (mIsExpansionChanging) {
|
||||
} else if (mIsExpansionChanging || mPanelTracking) {
|
||||
return RUBBER_BAND_FACTOR_ON_PANEL_EXPAND;
|
||||
} else if (mScrolledToTopOnFirstDown) {
|
||||
return 1.0f;
|
||||
@@ -1527,7 +1528,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
* overscroll view (e.g. expand QS).
|
||||
*/
|
||||
private boolean isRubberbanded(boolean onTop) {
|
||||
return !onTop || mExpandedInThisMotion || mIsExpansionChanging
|
||||
return !onTop || mExpandedInThisMotion || mIsExpansionChanging || mPanelTracking
|
||||
|| !mScrolledToTopOnFirstDown;
|
||||
}
|
||||
|
||||
@@ -2249,6 +2250,13 @@ public class NotificationStackScrollLayout extends ViewGroup
|
||||
}
|
||||
}
|
||||
|
||||
public void onPanelTrackingStarted() {
|
||||
mPanelTracking = true;
|
||||
}
|
||||
public void onPanelTrackingStopped() {
|
||||
mPanelTracking = false;
|
||||
}
|
||||
|
||||
public void resetScrollPosition() {
|
||||
mScroller.abortAnimation();
|
||||
mOwnScrollY = 0;
|
||||
|
||||
Reference in New Issue
Block a user