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

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

Issue 1470613003: [Contextual Search] Fix positioning of RTL promo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/ContextualSearchPanelBase.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
index 3c80f13aa82bee2e2e1871dd00852e61ff32c8ac..4fccfb7232cde2c7a0aa0df6f389f30c8caaa3d1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
@@ -1410,7 +1410,12 @@ abstract class ContextualSearchPanelBase implements ContextualSearchPromoHost {
public void showPromoViewAtYPosition(float y) {
if (mPromoView == null || !isPromoVisible()) return;
- mPromoView.setTranslationX(getOffsetX() / mPxToDp);
+ float offsetX = getOffsetX() / mPxToDp;
+ if (LocalizationUtils.isLayoutRtl()) {
+ offsetX = -offsetX;
+ }
+
+ mPromoView.setTranslationX(offsetX);
mPromoView.setTranslationY(y);
mPromoView.setVisibility(View.VISIBLE);
« 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