diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/NonOverlappingStack.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/NonOverlappingStack.java index 2646b2d16432..74d8fdc2907a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/NonOverlappingStack.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/NonOverlappingStack.java @@ -89,9 +89,7 @@ protected boolean evenOutTabs(float amount, boolean allowReverseDirection) { return false; } - @Override - public void contextChanged(Context context) { - super.contextChanged(context); + private void updateScrollSnap() { mScroller.setFrictionMultiplier(FRICTION_MULTIPLIER); // This is what computeSpacing() returns when there are >= 2 tabs final int snapDistance = @@ -102,6 +100,18 @@ public void contextChanged(Context context) { mScroller.setYSnapDistance(snapDistance); } + @Override + public void contextChanged(Context context) { + super.contextChanged(context); + updateScrollSnap(); + } + + @Override + public void notifySizeChanged(float width, float height, int orientation) { + super.notifySizeChanged(width, height, orientation); + updateScrollSnap(); + } + @Override public void onPinch(long time, float x0, float y0, float x1, float y1, boolean firstEvent) { return;