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

Side by Side Diff: ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java

Issue 23314003: Add support for datalist to text input element on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created custom drawable Created 7 years, 3 months 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 package org.chromium.ui.autofill;
7
8 import android.graphics.Canvas;
9 import android.graphics.ColorFilter;
10 import android.graphics.Paint;
11 import android.graphics.RectF;
12 import android.graphics.drawable.Drawable;
13
14 public class AutofillDividerDrawable extends Drawable {
15
16 private Paint paint;
newt (away) 2013/09/09 20:20:42 mPaint
keishi 2013/09/19 11:53:05 Done.
17
18 public AutofillDividerDrawable() {
19 paint = new Paint();
20 }
21
22 @Override
23 public void draw(Canvas canvas) {
24 int width = getBounds().width();
25 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.
26 canvas.drawRect(rect, paint);
27 }
28
29 public void setColor(int color) {
30 paint.setColor(color);
31 }
32
33 @Override
34 public void setAlpha(int alpha) {
35 }
36
37 @Override
38 public void setColorFilter(ColorFilter cf) {
39 }
40
41 @Override
42 public int getOpacity() {
43 return 255;
44 }
45
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698