diff options
Diffstat (limited to 'src/com/android/gallery3d/filtershow/category')
-rw-r--r-- | src/com/android/gallery3d/filtershow/category/Action.java | 10 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/category/CategoryView.java | 14 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/filtershow/category/Action.java b/src/com/android/gallery3d/filtershow/category/Action.java index 667a897fe..4f2c12868 100644 --- a/src/com/android/gallery3d/filtershow/category/Action.java +++ b/src/com/android/gallery3d/filtershow/category/Action.java @@ -149,7 +149,15 @@ public class Action implements RenderingRequestCaller { mRepresentation.getOverlayId()); } if (mOverlayBitmap != null) { - drawCenteredImage(mOverlayBitmap, mImage, false); + if (getRepresentation().getPriority() == FilterRepresentation.TYPE_BORDER) { + Canvas canvas = new Canvas(mImage); + canvas.drawBitmap(mOverlayBitmap, new Rect(0, 0, mOverlayBitmap.getWidth(), mOverlayBitmap.getHeight()), + new Rect(0, 0, mImage.getWidth(), mImage.getHeight()), new Paint()); + } else { + Canvas canvas = new Canvas(mImage); + canvas.drawARGB(128, 0, 0, 0); + drawCenteredImage(mOverlayBitmap, mImage, false); + } } if (mAdapter != null) { mAdapter.notifyDataSetChanged(); 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()); } } |