Commit ac72e474 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

weblayer: Set top control offset on init

When TopControlContainerView is destroyed and recreated on when weblayer
fragment is retained across activities, there is a mismatch between the
content offset in native code and the new top controls, causing a
mismatch that leads to touch events being offset incorrectly until new
scroll causes a sync again.

Set content offset on init, which also sets it on re-init that fixes
this bug.

Bug: 1057625
Change-Id: I477e2efb648028c0204091a33f16d17e61248efc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081841Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746473}
parent 794831df
...@@ -265,6 +265,7 @@ class TopControlsContainerView extends FrameLayout { ...@@ -265,6 +265,7 @@ class TopControlsContainerView extends FrameLayout {
mLastHeight = getHeight(); mLastHeight = getHeight();
TopControlsContainerViewJni.get().setTopControlsSize(mNativeTopControlsContainerView, TopControlsContainerViewJni.get().setTopControlsSize(mNativeTopControlsContainerView,
TopControlsContainerView.this, mLastWidth, mLastHeight); TopControlsContainerView.this, mLastWidth, mLastHeight);
setTopControlsOffset(0, mLastHeight);
} }
private void finishTopControlsScroll(int topContentOffsetY) { private void finishTopControlsScroll(int topContentOffsetY) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment