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

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

Issue 2116583002: Credit card editor for PaymentRequest UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments in personal_data_manager_android.h Created 4 years, 5 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/EditorLabelField.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorLabelField.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorLabelField.java
new file mode 100644
index 0000000000000000000000000000000000000000..7844d20802e2965c4c309b323510a88ab725608a
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorLabelField.java
@@ -0,0 +1,45 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.payments.ui;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import org.chromium.chrome.R;
+
+/**
+ * Helper class for creating a label view.
gone 2016/07/13 21:13:01 Describe what a label is because it's more than ju
please use gerrit instead 2016/07/14 17:21:44 Done.
+ */
+class EditorLabelField {
+ private final View mLayout;
+
+ /**
+ * Builds a label view.
+ *
+ * @param context The application context to use when creating widgets.
+ * @param fieldModel The data model of the icon list.
+ */
+ public EditorLabelField(Context context, EditorFieldModel fieldModel) {
+ assert fieldModel.getInputTypeHint() == EditorFieldModel.INPUT_TYPE_HINT_LABEL;
+
+ mLayout = LayoutInflater.from(context).inflate(
+ R.layout.payment_request_editor_label, null, false);
+
+ ((TextView) mLayout.findViewById(R.id.label)).setText(fieldModel.getLabel());
+ ((TextView) mLayout.findViewById(R.id.midlabel)).setText(fieldModel.getMidLabel());
+ ((TextView) mLayout.findViewById(R.id.sublabel)).setText(fieldModel.getSubLabel());
+
+ ((ImageView) mLayout.findViewById(R.id.icon)).setImageResource(
+ fieldModel.getLabelIconResourceId());
+ }
+
+ /** @return The View containing everything. */
+ public View getLayout() {
+ return mLayout;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698