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..8698c053c9bc1771533cc137708781fcb4bd1b6f |
| --- /dev/null |
| +++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java |
| @@ -0,0 +1,46 @@ |
| +// 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. |
| + |
| + |
| +package org.chromium.ui.autofill; |
| + |
| +import android.graphics.Canvas; |
| +import android.graphics.ColorFilter; |
| +import android.graphics.Paint; |
| +import android.graphics.RectF; |
| +import android.graphics.drawable.Drawable; |
| + |
| +public class AutofillDividerDrawable extends Drawable { |
| + |
| + private Paint paint; |
|
newt (away)
2013/09/09 20:20:42
mPaint
keishi
2013/09/19 11:53:05
Done.
|
| + |
| + public AutofillDividerDrawable() { |
| + paint = new Paint(); |
| + } |
| + |
| + @Override |
| + public void draw(Canvas canvas) { |
| + int width = getBounds().width(); |
| + RectF rect = new RectF(0, 0, width, 1); |
|
newt (away)
2013/09/09 20:20:42
avoid allocating memory while drawing: store this
keishi
2013/09/19 11:53:05
Done.
|
| + canvas.drawRect(rect, paint); |
| + } |
| + |
| + public void setColor(int color) { |
| + paint.setColor(color); |
| + } |
| + |
| + @Override |
| + public void setAlpha(int alpha) { |
| + } |
| + |
| + @Override |
| + public void setColorFilter(ColorFilter cf) { |
| + } |
| + |
| + @Override |
| + public int getOpacity() { |
| + return 255; |
| + } |
| + |
| +} |