Bug 1361880 - Prevent toolbar from animating when drag threshold has not been reached r=botond

MozReview-Commit-ID: 14WKMWdjjsf
This commit is contained in:
Randall Barker 2017-05-03 10:48:41 -07:00
Родитель 26b3324682
Коммит 6d5d6f7603
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

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