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

Unified Diff: ui/android/java/src/org/chromium/ui/DropdownDividerDrawable.java

Issue 2531223003: Expanded Autofill Credit Card Popup Layout Experiment in Android. (Closed)
Patch Set: Adds clarifying comments for DropdownAdapter parameters. Moves checking whether icon should be at s… Created 4 years 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: 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);
}

Powered by Google App Engine
This is Rietveld 408576698