Bug 1296887 - Prevent a second call to shiftLayerView with the same destination as the first from clearing the resize state prematurely. r=rbarker

MozReview-Commit-ID: 4iMfJ8tsweR

--HG--
extra : rebase_source : 054cb98cddf279f38a4fbea034f8643f3f53e417
This commit is contained in:
Kartikaya Gupta 2016-09-01 17:27:15 -04:00
parent a49ef7731d
commit 32379a1d17

View File

@ -238,6 +238,11 @@ public class DynamicToolbarAnimator {
float layerViewTranslationNeeded = desiredTranslation - mLayerViewTranslation;
mLayerViewTranslation = desiredTranslation;
synchronized (mTarget.getLock()) {
if (layerViewTranslationNeeded == 0 && isResizing()) {
// We're already in the middle of a snap, so this new call is
// redundant as it's snapping to the same place. Ignore it.
return;
}
mHeightDuringResize = new Integer(mTarget.getViewportMetrics().viewportRectHeight);
mSnapRequired = mTarget.setViewportSize(
mTarget.getView().getWidth(),