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 @@
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")
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);
}
/**
......
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