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

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

Issue 2579623003: [Autofill] Update credit card icons to match payments. (Closed)
Patch Set: Created 4 years 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
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 5a3d6cd9ac1f58a622e23e1f6550d431d1b895d2..adb7e26b27586d639b409078e150393376bfc9d6 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,6 +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.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -71,14 +72,15 @@ public class AutofillKeyboardAccessory extends LinearLayout
assert !TextUtils.isEmpty(suggestion.getLabel());
View touchTarget;
- if (!suggestion.isFillable() && suggestion.getIconId() != 0) {
+ if (!suggestion.isFillable() && suggestion.getVectorDrawableIconId() != 0) {
touchTarget = LayoutInflater.from(getContext()).inflate(
R.layout.autofill_keyboard_accessory_icon, this, false);
if (separatorPosition == -1) separatorPosition = i;
ImageView icon = (ImageView) touchTarget;
- icon.setImageResource(suggestion.getIconId());
+ icon.setImageDrawable(VectorDrawableCompat.create(getResources(),
+ suggestion.getVectorDrawableIconId(), getContext().getTheme()));
icon.setContentDescription(suggestion.getLabel());
} else {
touchTarget = LayoutInflater.from(getContext()).inflate(
@@ -96,9 +98,11 @@ public class AutofillKeyboardAccessory extends LinearLayout
label.setTypeface(Typeface.DEFAULT_BOLD);
}
- if (suggestion.getIconId() != 0) {
+ if (suggestion.getVectorDrawableIconId() != 0) {
ApiCompatibilityUtils.setCompoundDrawablesRelativeWithIntrinsicBounds(
- label, suggestion.getIconId(), 0, 0, 0);
+ label, VectorDrawableCompat.create(getResources(),
+ suggestion.getVectorDrawableIconId(), getContext().getTheme()),
+ null /* top */, null /* end */, null /* bottom */);
}
if (!TextUtils.isEmpty(suggestion.getSublabel())) {

Powered by Google App Engine
This is Rietveld 408576698