Commit 8a4de1d2 authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Remove initialization of Y offset in BottomContainer

In the BottomContainer, in order to handle sitting on top of multiple
different UIs, the setTranslationY function is overridden to apply
offsets independently of the view's original translation. This was
broken because the initialization logic also attempted to apply this
offset. This patch updates the incorrect call in the init function
and updates the math in setTranslationY.

Bug: 851182
Change-Id: Id4955aed45b91cd55a3baf4c70f8087a65123f24
Reviewed-on: https://chromium-review.googlesource.com/1099772Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567044}
parent ba32a92f
......@@ -40,7 +40,7 @@ public class BottomContainer extends FrameLayout implements FullscreenListener {
public void initialize(ChromeFullscreenManager fullscreenManager) {
mFullscreenManager = fullscreenManager;
mFullscreenManager.addListener(this);
setTranslationY(-fullscreenManager.getBottomControlsHeight());
setTranslationY(mBaseYOffset);
}
/**
......@@ -77,8 +77,7 @@ public class BottomContainer extends FrameLayout implements FullscreenListener {
// Sit on top of either the bottom sheet or the bottom toolbar depending on which is larger
// (offsets are negative).
super.setTranslationY(
Math.min(offsetFromControls - mBaseYOffset, mOffsetFromSheet - mBaseYOffset));
super.setTranslationY(mBaseYOffset + Math.min(offsetFromControls, mOffsetFromSheet));
}
@Override
......
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