Use ApiCompatibilityUtils.setLayoutDirection() instead of View.setLayoutDirection().

BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287490 0039d316-1c4b-4281-b951-d872f2087c98
parent c3865e34
...@@ -4,10 +4,12 @@ ...@@ -4,10 +4,12 @@
package org.chromium.ui.autofill; package org.chromium.ui.autofill;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.ui.DropdownAdapter; import org.chromium.ui.DropdownAdapter;
import org.chromium.ui.DropdownItem; import org.chromium.ui.DropdownItem;
import org.chromium.ui.DropdownPopupWindow; import org.chromium.ui.DropdownPopupWindow;
...@@ -75,6 +77,7 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On ...@@ -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. * Filters the Autofill suggestions to the ones that we support and shows the popup.
* @param suggestions Autofill suggestion data. * @param suggestions Autofill suggestion data.
*/ */
@SuppressLint("InlinedApi")
public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl) { public void filterAndShow(AutofillSuggestion[] suggestions, boolean isRtl) {
mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions)); mSuggestions = new ArrayList<AutofillSuggestion>(Arrays.asList(suggestions));
// Remove the AutofillSuggestions with IDs that are not supported by Android // Remove the AutofillSuggestions with IDs that are not supported by Android
...@@ -91,8 +94,8 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On ...@@ -91,8 +94,8 @@ public class AutofillPopup extends DropdownPopupWindow implements AdapterView.On
} }
setAdapter(new DropdownAdapter(mContext, cleanedData, separators)); setAdapter(new DropdownAdapter(mContext, cleanedData, separators));
show(); show();
getListView().setLayoutDirection(isRtl ? View.LAYOUT_DIRECTION_RTL : ApiCompatibilityUtils.setLayoutDirection(getListView(),
View.LAYOUT_DIRECTION_LTR); isRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
} }
/** /**
......
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