Commit 01e32592 authored by gogerald's avatar gogerald Committed by Commit bot

Fix billing address dropdown error marker overlaps the downward triangle

BUG=679758

Review-Url: https://codereview.chromium.org/2620143002
Cr-Commit-Position: refs/heads/master@{#442909}
parent 072dc547
...@@ -10,5 +10,4 @@ ...@@ -10,5 +10,4 @@
android:singleLine="false" android:singleLine="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingEnd="24dp"
android:textAlignment="inherit" /> android:textAlignment="inherit" />
...@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.payments.ui; ...@@ -6,6 +6,7 @@ package org.chromium.chrome.browser.payments.ui;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -73,6 +74,19 @@ public class BillingAddressAdapter<T> extends ArrayAdapter<T> { ...@@ -73,6 +74,19 @@ public class BillingAddressAdapter<T> extends ArrayAdapter<T> {
return count > 0 ? count - 1 : count; return count > 0 ? count - 1 : count;
} }
@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 @Override
public View getDropDownView(int position, View convertView, ViewGroup parent) { public View getDropDownView(int position, View convertView, ViewGroup parent) {
TextView textView = convertView == null TextView textView = convertView == null
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment