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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java

Issue 2437223002: Revert of Make PaymentOption store a Drawable instead of id (Closed)
Patch Set: Created 4 years, 2 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
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
index f232018d18f930f52943935ac9a1d86d76099bf0..162ef5a60c294a37c50b6795c4d6c37cb2798d28 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
@@ -3,8 +3,6 @@
// found in the LICENSE file.
package org.chromium.chrome.browser.payments.ui;
-
-import android.graphics.drawable.Drawable;
import javax.annotation.Nullable;
@@ -13,15 +11,17 @@
* method.
*/
public class PaymentOption implements Completable {
+ /** The placeholder value that indicates the absence of an icon for this option. */
+ public static final int NO_ICON = 0;
+
protected boolean mIsComplete;
private String mId;
- private Drawable mIcon;
+ private int mIcon;
private String[] mLabels = {null, null, null};
private boolean mIsValid = true;
/** See {@link #PaymentOption(String, String, String, String, int)}. */
- public PaymentOption(String id, @Nullable String label, @Nullable String sublabel,
- @Nullable Drawable icon) {
+ public PaymentOption(String id, @Nullable String label, @Nullable String sublabel, int icon) {
this(id, label, sublabel, null, icon);
}
@@ -32,10 +32,10 @@
* @param label The label.
* @param sublabel The optional sublabel.
* @param tertiarylabel The optional tertiary label.
- * @param icon The drawable icon identifier or null.
+ * @param icon The drawable icon identifier or NO_ICON.
*/
public PaymentOption(String id, @Nullable String label, @Nullable String sublabel,
- @Nullable String tertiarylabel, @Nullable Drawable icon) {
+ @Nullable String tertiarylabel, int icon) {
updateIdentifierLabelsAndIcon(id, label, sublabel, tertiarylabel, icon);
}
@@ -95,17 +95,20 @@
* @param label The new label to use. Should not be null.
* @param sublabel The new sublabel to use. Can be null.
* @param tertiarylabel The new tertiary label to use. Can be null.
- * @param icon The drawable icon identifier or null.
+ * @param icon The drawable icon identifier or NO_ICON.
*/
protected void updateIdentifierLabelsAndIcon(
String id, String label, @Nullable String sublabel, @Nullable String tertiarylabel,
- @Nullable Drawable icon) {
+ int icon) {
updateIdentifierAndLabels(id, label, sublabel, tertiarylabel);
mIcon = icon;
}
- /** * The drawable icon for this payment option. */
- public Drawable getDrawableIcon() {
+ /**
+ * The identifier for the drawable icon for this payment option. For example, R.drawable.pr_visa
+ * or NO_ICON.
+ */
+ public int getDrawableIconId() {
return mIcon;
}

Powered by Google App Engine
This is Rietveld 408576698