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

Unified Diff: components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java

Issue 2616503002: Support all drawable types in DropdownItem. (Closed)
Patch Set: Fix AutofillKeyboardAccessory Created 3 years, 12 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 | components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java
index adb7e26b27586d639b409078e150393376bfc9d6..56475a385245b4eda771492457202070f1e3d3b9 100644
--- a/components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java
+++ b/components/autofill/android/java/src/org/chromium/components/autofill/AutofillKeyboardAccessory.java
@@ -7,7 +7,7 @@ package org.chromium.components.autofill;
import android.annotation.SuppressLint;
import android.graphics.Typeface;
import android.os.Build;
-import android.support.graphics.drawable.VectorDrawableCompat;
+import android.support.v7.content.res.AppCompatResources;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -72,15 +72,15 @@ public class AutofillKeyboardAccessory extends LinearLayout
assert !TextUtils.isEmpty(suggestion.getLabel());
View touchTarget;
- if (!suggestion.isFillable() && suggestion.getVectorDrawableIconId() != 0) {
+ if (!suggestion.isFillable() && suggestion.getIconId() != 0) {
touchTarget = LayoutInflater.from(getContext()).inflate(
R.layout.autofill_keyboard_accessory_icon, this, false);
if (separatorPosition == -1) separatorPosition = i;
ImageView icon = (ImageView) touchTarget;
- icon.setImageDrawable(VectorDrawableCompat.create(getResources(),
- suggestion.getVectorDrawableIconId(), getContext().getTheme()));
+ icon.setImageDrawable(
+ AppCompatResources.getDrawable(getContext(), suggestion.getIconId()));
icon.setContentDescription(suggestion.getLabel());
} else {
touchTarget = LayoutInflater.from(getContext()).inflate(
@@ -98,11 +98,11 @@ public class AutofillKeyboardAccessory extends LinearLayout
label.setTypeface(Typeface.DEFAULT_BOLD);
}
- if (suggestion.getVectorDrawableIconId() != 0) {
+ if (suggestion.getIconId() != 0) {
ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(
- label, VectorDrawableCompat.create(getResources(),
- suggestion.getVectorDrawableIconId(), getContext().getTheme()),
- null /* top */, null /* end */, null /* bottom */);
+ label,
+ AppCompatResources.getDrawable(getContext(), suggestion.getIconId()),
+ null /* top */, null /* end */, null /* bottom */);
}
if (!TextUtils.isEmpty(suggestion.getSublabel())) {
« no previous file with comments | « no previous file | components/autofill/android/java/src/org/chromium/components/autofill/AutofillSuggestion.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698