From 2ee98c8dc8bfba5e9820c14f348ee077c4a4236d Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Tue, 30 Apr 2013 20:50:03 -0700 Subject: Fix UI bug:8664728 Change-Id: I90b903e8935b2b6c0dbd6590cff36865644c49b4 --- .../gallery3d/filtershow/category/CategoryView.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/com/android/gallery3d/filtershow/category/CategoryView.java') diff --git a/src/com/android/gallery3d/filtershow/category/CategoryView.java b/src/com/android/gallery3d/filtershow/category/CategoryView.java index 5467841c4..c101f983f 100644 --- a/src/com/android/gallery3d/filtershow/category/CategoryView.java +++ b/src/com/android/gallery3d/filtershow/category/CategoryView.java @@ -62,11 +62,8 @@ public class CategoryView extends View implements View.OnClickListener { return; } text = text.toUpperCase(); - mPaint.reset(); - mPaint.setColor(mTextColor); mPaint.setTextSize(sTextSize); mPaint.setTypeface(Typeface.DEFAULT_BOLD); - mPaint.setAntiAlias(true); float textWidth = mPaint.measureText(text); mPaint.getTextBounds(text, 0, text.length(), mTextBounds); int x = (int) (canvas.getWidth() - textWidth - sMargin); @@ -77,13 +74,22 @@ public class CategoryView extends View implements View.OnClickListener { public void onDraw(Canvas canvas) { canvas.drawColor(mBackgroundColor); if (mAction != null) { - drawText(canvas, mAction.getName()); + mPaint.reset(); + mPaint.setAntiAlias(true); if (mAction.getImage() == null) { mAction.setImageFrame(new Rect(0, 0, canvas.getWidth(), canvas.getHeight())); } else { Bitmap bitmap = mAction.getImage(); canvas.drawBitmap(bitmap, 0, 0, mPaint); } + mPaint.setColor(mBackgroundColor); + mPaint.setStyle(Paint.Style.STROKE); + mPaint.setStrokeWidth(3); + drawText(canvas, mAction.getName()); + mPaint.setColor(mTextColor); + mPaint.setStyle(Paint.Style.FILL); + mPaint.setStrokeWidth(1); + drawText(canvas, mAction.getName()); } } -- cgit v1.2.3