Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2792)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java

Issue 1839813003: [Contextual Search] Fixes Promo position after rotation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
index 859c771b80b534572381ed491112739cd22ec291..c01e4f544ade154f25f5925ea2ad20902660d2c1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
@@ -801,6 +801,11 @@ public class ContextualSearchPanel extends OverlayPanel
private boolean mIsAnimatingPromoAcceptance;
/**
+ * The Y position of the Search Promo.
+ */
+ private float mSearchPromoY;
+
+ /**
* Creates the Search Promo View.
*/
protected void createPromoView() {
@@ -861,9 +866,9 @@ public class ContextualSearchPanel extends OverlayPanel
*/
private void showPromoViewAtYPosition(float y) {
if (mPromoView == null
- || mIsSearchPromoViewVisible
|| mIsAnimatingMandatoryPromoAcceptance
- || !isPromoVisible()) return;
+ || !isPromoVisible()
+ || (mIsSearchPromoViewVisible && mSearchPromoY == y)) return;
float offsetX = getOffsetX() / mPxToDp;
if (LocalizationUtils.isLayoutRtl()) {
@@ -879,6 +884,7 @@ public class ContextualSearchPanel extends OverlayPanel
mPromoView.requestLayout();
mIsSearchPromoViewVisible = true;
+ mSearchPromoY = y;
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698