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:
Jorim Jaggi
2015-06-30 16:19:17 -07:00
parent e4f1a202d8
commit e4b840d63d
2 changed files with 12 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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;