| Index: ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java
|
| diff --git a/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java b/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java
|
| index 014192a55761ddf6912c2fca3641c807671bbfde..1b45064f710b9e167531c965b564f8692edec3f5 100644
|
| --- a/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java
|
| +++ b/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java
|
| @@ -13,16 +13,24 @@ import android.graphics.drawable.Drawable;
|
|
|
| class DropdownDividerDrawable extends Drawable {
|
|
|
| - private Paint mPaint;
|
| - private Rect mDividerRect;
|
| -
|
| - public DropdownDividerDrawable() {
|
| + private final Paint mPaint;
|
| + private final Rect mDividerRect;
|
| + private final Integer mBackgroundColor;
|
| +
|
| + /**
|
| + * Creates a drawable to draw a divider line that separates the list of {@link DropdownItem}
|
| + * and, optionally, paints the rectangular canvas.
|
| + * @param backgroundColor Popup background color. If {@code null}, does not paint the canvas.
|
| + */
|
| + public DropdownDividerDrawable(Integer backgroundColor) {
|
| mPaint = new Paint();
|
| mDividerRect = new Rect();
|
| + mBackgroundColor = backgroundColor;
|
| }
|
|
|
| @Override
|
| public void draw(Canvas canvas) {
|
| + if (mBackgroundColor != null) canvas.drawColor(mBackgroundColor);
|
| canvas.drawRect(mDividerRect, mPaint);
|
| }
|
|
|
| @@ -35,7 +43,7 @@ class DropdownDividerDrawable extends Drawable {
|
| mDividerRect.set(0, 0, mDividerRect.right, height);
|
| }
|
|
|
| - public void setColor(int color) {
|
| + public void setDividerColor(int color) {
|
| mPaint.setColor(color);
|
| }
|
|
|
|
|