diff options
author | nicolasroard <nicolasroard@google.com> | 2013-04-30 20:50:03 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-05-01 19:02:55 -0700 |
commit | 2ee98c8dc8bfba5e9820c14f348ee077c4a4236d (patch) | |
tree | e0b97aa3f0b4dceba8e63e3fa59bd28744690321 /src/com/android/gallery3d/filtershow/category | |
parent | e6a85fb5dc3148d8ef4d6cda30183a9ee33f7314 (diff) | |
download | android_packages_apps_Snap-2ee98c8dc8bfba5e9820c14f348ee077c4a4236d.tar.gz android_packages_apps_Snap-2ee98c8dc8bfba5e9820c14f348ee077c4a4236d.tar.bz2 android_packages_apps_Snap-2ee98c8dc8bfba5e9820c14f348ee077c4a4236d.zip |
Fix UI
bug:8664728
Change-Id: I90b903e8935b2b6c0dbd6590cff36865644c49b4
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()); } } |