Commit 6ff7e4a5 authored by pedrosimonetti's avatar pedrosimonetti Committed by Commit bot

[Contextual Search] Fixes Promo position after rotation.

BUG=598506

Review URL: https://codereview.chromium.org/1839813003

Cr-Commit-Position: refs/heads/master@{#383814}
parent e6d2c0d7
...@@ -800,6 +800,11 @@ public class ContextualSearchPanel extends OverlayPanel ...@@ -800,6 +800,11 @@ public class ContextualSearchPanel extends OverlayPanel
*/ */
private boolean mIsAnimatingPromoAcceptance; private boolean mIsAnimatingPromoAcceptance;
/**
* The Y position of the Search Promo.
*/
private float mSearchPromoY;
/** /**
* Creates the Search Promo View. * Creates the Search Promo View.
*/ */
...@@ -861,9 +866,9 @@ public class ContextualSearchPanel extends OverlayPanel ...@@ -861,9 +866,9 @@ public class ContextualSearchPanel extends OverlayPanel
*/ */
private void showPromoViewAtYPosition(float y) { private void showPromoViewAtYPosition(float y) {
if (mPromoView == null if (mPromoView == null
|| mIsSearchPromoViewVisible
|| mIsAnimatingMandatoryPromoAcceptance || mIsAnimatingMandatoryPromoAcceptance
|| !isPromoVisible()) return; || !isPromoVisible()
|| (mIsSearchPromoViewVisible && mSearchPromoY == y)) return;
float offsetX = getOffsetX() / mPxToDp; float offsetX = getOffsetX() / mPxToDp;
if (LocalizationUtils.isLayoutRtl()) { if (LocalizationUtils.isLayoutRtl()) {
...@@ -879,6 +884,7 @@ public class ContextualSearchPanel extends OverlayPanel ...@@ -879,6 +884,7 @@ public class ContextualSearchPanel extends OverlayPanel
mPromoView.requestLayout(); mPromoView.requestLayout();
mIsSearchPromoViewVisible = true; mIsSearchPromoViewVisible = true;
mSearchPromoY = y;
} }
/** /**
......
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