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

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

Issue 2620143002: [Payments] Fix billing address dropdown error marker overlaps the downward triangle (Closed)
Patch Set: simplify Created 3 years, 11 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 | « chrome/android/java/res/layout/multiline_spinner_item.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java
index 084e197d7de8590d85aefa3e71b919b32f920707..be4797f74769ed3f5ada2e679eb2df869fa18428 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/BillingAddressAdapter.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.payments.ui;
import android.content.Context;
import android.content.res.Resources;
+import android.graphics.Rect;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
@@ -74,6 +75,19 @@ public class BillingAddressAdapter<T> extends ArrayAdapter<T> {
}
@Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View view = super.getView(position, convertView, parent);
+
+ // Add the left and right padding of the parent's background to the selected item view to
+ // avoid overlaping the downward triangle.
+ Rect rect = new Rect();
+ parent.getBackground().getPadding(rect);
+ view.setPadding(view.getPaddingLeft() + rect.left, view.getPaddingTop(),
+ view.getPaddingRight() + rect.right, view.getPaddingBottom());
+ return view;
+ }
+
+ @Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
TextView textView = convertView == null
? null
« no previous file with comments | « chrome/android/java/res/layout/multiline_spinner_item.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698