Chromium Code Reviews| 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..cdfb0b1baab405e1900fa48da9c000a8ba5617d1 100644 |
| --- a/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| +++ b/ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java |
| @@ -15,14 +15,23 @@ class DropdownDividerDrawable extends Drawable { |
| private Paint mPaint; |
| private Rect mDividerRect; |
| - |
| - public DropdownDividerDrawable() { |
| + private int mBackgroundColor; |
| + |
| + /** |
| + * Creates a drawable to draw a divider line that separate the list of {@code DropdownItem} and, |
|
Theresa
2016/12/08 21:38:17
s/separate/separates
{@link DropdownItem}
csashi
2016/12/08 23:03:30
Done.
|
| + * optionally, paints the rectangular canvas. |
| + * @param backgroundColor Popup background color. Skips painting the canvas if |
| + * {@code Color.TRANSPARENT}. |
| + */ |
| + public DropdownDividerDrawable(int backgroundColor) { |
| mPaint = new Paint(); |
| mDividerRect = new Rect(); |
| + mBackgroundColor = backgroundColor; |
| } |
| @Override |
| public void draw(Canvas canvas) { |
| + if (mBackgroundColor != 0) canvas.drawColor(mBackgroundColor); |
| canvas.drawRect(mDividerRect, mPaint); |
| } |
| @@ -35,7 +44,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); |
| } |