зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1361880 - Prevent toolbar from animating when drag threshold has not been reached r=botond
MozReview-Commit-ID: 14WKMWdjjsf
This commit is contained in:
Родитель
26b3324682
Коммит
6d5d6f7603
|
@ -579,6 +579,7 @@ AndroidDynamicToolbarAnimator::HandleTouchEnd(StaticToolbarState aCurrentToolbar
|
|||
mControllerStartTouch = 0;
|
||||
mControllerPreviousTouch = 0;
|
||||
mControllerTotalDistance = 0;
|
||||
bool dragThresholdReached = mControllerDragThresholdReached;
|
||||
mControllerDragThresholdReached = false;
|
||||
mControllerLastEventTimeStamp = 0;
|
||||
bool cancelTouchTracking = mControllerCancelTouchTracking;
|
||||
|
@ -595,6 +596,12 @@ AndroidDynamicToolbarAnimator::HandleTouchEnd(StaticToolbarState aCurrentToolbar
|
|||
return;
|
||||
}
|
||||
|
||||
// The drag threshold has not been reach and the toolbar is either completely visible or completely hidden.
|
||||
if (!dragThresholdReached && ((mControllerToolbarHeight == mControllerMaxToolbarHeight) || (mControllerToolbarHeight == 0))) {
|
||||
ShowToolbarIfNotVisible(aCurrentToolbarState);
|
||||
return;
|
||||
}
|
||||
|
||||
// The toolbar is already where it needs to be so just return.
|
||||
if (((direction == MOVE_TOOLBAR_DOWN) && (mControllerToolbarHeight == mControllerMaxToolbarHeight)) ||
|
||||
((direction == MOVE_TOOLBAR_UP) && (mControllerToolbarHeight == 0))) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче