Chromium Code Reviews| Index: ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java |
| diff --git a/ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java b/ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc4a766e7349655f9cf804a4b2c5d34aed6caa36 |
| --- /dev/null |
| +++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java |
| @@ -0,0 +1,56 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| + |
|
Miguel Garcia
2013/11/06 17:33:56
nit: extra blank line
keishi
2013/11/07 04:19:18
Done.
|
| +package org.chromium.ui.autofill; |
| + |
| +import android.graphics.Canvas; |
| +import android.graphics.ColorFilter; |
| +import android.graphics.Paint; |
| +import android.graphics.Rect; |
| +import android.graphics.RectF; |
| +import android.graphics.drawable.Drawable; |
| + |
| +public class AutofillDividerDrawable extends Drawable { |
| + |
| + private Paint mPaint; |
| + private RectF mDividerRect; |
|
newt (away)
2013/10/03 16:34:51
mDividerRect always has integer coordinates, so I'
keishi
2013/10/04 05:52:28
Done.
|
| + |
| + public AutofillDividerDrawable() { |
| + mPaint = new Paint(); |
| + mDividerRect = new RectF(); |
| + } |
| + |
| + @Override |
| + public void draw(Canvas canvas) { |
| + canvas.drawRect(mDividerRect, mPaint); |
| + } |
| + |
| + @Override |
| + public void onBoundsChange(Rect bounds) { |
| + mDividerRect.set(0, 0, bounds.width(), mDividerRect.height()); |
| + } |
| + |
| + public void setHeight(int height) { |
| + mDividerRect.set(0, 0, mDividerRect.right, (float) height); |
| + } |
| + |
| + public void setColor(int color) { |
| + mPaint.setColor(color); |
| + } |
| + |
| + @Override |
| + public void setAlpha(int alpha) { |
| + } |
| + |
| + @Override |
| + public void setColorFilter(ColorFilter cf) { |
| + } |
| + |
| + @Override |
| + public int getOpacity() { |
| + return 255; |
|
Miguel Garcia
2013/11/06 17:33:56
can you add comment or perhaps use a constant for
keishi
2013/11/07 04:19:18
I found a constant already defined android.graphic
|
| + } |
| + |
|
Miguel Garcia
2013/11/06 17:33:56
nit: extra line
keishi
2013/11/07 04:19:18
Done.
|
| +} |