forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for datalist to text input element on Android
We want to have a darker color divider between the datalist suggestions and autofill suggestions. The ListView instance is constructed inside ListPopupWindow so we can't override ListView.drawDivider(), so we draw the divider inside the list item view. BUG=242455 Review URL: https://codereview.chromium.org/23314003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234194 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
keishi@chromium.org
committed
Nov 11, 2013
1 parent
b4d0eb1
commit 9f03d8d
Showing
7 changed files
with
136 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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.Rect; | ||
import android.graphics.RectF; | ||
import android.graphics.drawable.Drawable; | ||
import android.graphics.PixelFormat; | ||
|
||
public class AutofillDividerDrawable extends Drawable { | ||
|
||
private Paint mPaint; | ||
private Rect mDividerRect; | ||
|
||
public AutofillDividerDrawable() { | ||
mPaint = new Paint(); | ||
mDividerRect = new Rect(); | ||
} | ||
|
||
@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, 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 PixelFormat.OPAQUE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters