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

Unified Diff: ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java

Issue 425333005: Use ApiCompatibilityUtils.setLayoutDirection() instead of View.setLayoutDirection(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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: ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
diff --git a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
index 33b4fc7199aa0bee2190eabe2b9dfdd0cfbed2c7..ae3d1c9106981729122162bacca8fef55c4239f1 100644
--- a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
+++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
@@ -4,10 +4,12 @@
package org.chromium.ui.autofill;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;
import android.widget.AdapterView;
+import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.ui.DropdownAdapter;
import org.chromium.ui.DropdownItem;
import org.chromium.ui.DropdownPopupWindow;
@@ -75,6 +77,7 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
* Filters the Autofill suggestions to the ones that we support and shows the popup.
* @param suggestions Autofill suggestion data.
*/
+ @SuppressLint("InlinedApi")
aurimas (slooooooooow) 2014/08/04 15:19:40 Why do we need to suppress lint here? What is caus
Sungmann Cho 2014/08/04 18:32:16 Because of View.LAYOUT_DIRECTION_[LTR|RTL]. These
aurimas (slooooooooow) 2014/08/05 00:07:20 Right, that means we will not work correctly for p
Sungmann Cho 2014/08/05 00:43:53 View.LAYOUT_DIRECTION_[LTR|RTL] are static final a
public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl) {
mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
// Remove the AutofillSuggestions with IDs that are not supported by Android
@@ -91,8 +94,8 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
}
setAdapter(new DropdownAdapter(mContext, cleanedData, separators));
show();
- getListView().setLayoutDirection(isRtl ? View.LAYOUT_DIRECTION_RTL :
- View.LAYOUT_DIRECTION_LTR);
+ ApiCompatibilityUtils.setLayoutDirection(getListView(),
+ isRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
}
/**
« 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