mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 886576 - Fix scrolling cancelling locked dynamic toolbar animations. r=kats
Move the margin animation-cancelling call into the margins-pinned check block in LayerMarginsAnimator to make sure margin animations aren't cancelled by scrolling when margins are locked.
This commit is contained in:
parent
2da4132fa4
commit
76305364f5
@ -1209,8 +1209,8 @@ abstract public class BrowserApp extends GeckoApp
|
||||
// toolbar.
|
||||
if (mLayerView != null && isDynamicToolbarEnabled()) {
|
||||
if (width > 0 && height > 0) {
|
||||
mLayerView.getLayerMarginsAnimator().showMargins(false);
|
||||
mLayerView.getLayerMarginsAnimator().setMarginsPinned(true);
|
||||
mLayerView.getLayerMarginsAnimator().showMargins(false);
|
||||
} else {
|
||||
mLayerView.getLayerMarginsAnimator().setMarginsPinned(false);
|
||||
}
|
||||
|
@ -226,17 +226,17 @@ public class LayerMarginsAnimator implements TouchEventInterceptor {
|
||||
* viewport origin and returns the modified metrics.
|
||||
*/
|
||||
ImmutableViewportMetrics scrollBy(ImmutableViewportMetrics aMetrics, float aDx, float aDy) {
|
||||
// Make sure to cancel any margin animations when scrolling begins
|
||||
if (mAnimationTimer != null) {
|
||||
mAnimationTimer.cancel();
|
||||
mAnimationTimer = null;
|
||||
}
|
||||
|
||||
float[] newMarginsX = { aMetrics.marginLeft, aMetrics.marginRight };
|
||||
float[] newMarginsY = { aMetrics.marginTop, aMetrics.marginBottom };
|
||||
|
||||
// Only alter margins if the toolbar isn't pinned
|
||||
if (!mMarginsPinned) {
|
||||
// Make sure to cancel any margin animations when margin-scrolling begins
|
||||
if (mAnimationTimer != null) {
|
||||
mAnimationTimer.cancel();
|
||||
mAnimationTimer = null;
|
||||
}
|
||||
|
||||
// Reset the touch travel when changing direction
|
||||
if ((aDx >= 0) != (mTouchTravelDistance.x >= 0)) {
|
||||
mTouchTravelDistance.x = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user