Skip to content

Commit

Permalink
- Fixed black rendering on Android 2.x devices
Browse files Browse the repository at this point in the history
- Fixes issue amlcurran#115
  • Loading branch information
ilueckel committed Dec 2, 2013
1 parent 0c4f221 commit 428fce0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion library/src/com/espian/showcaseview/ShowcaseView.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,13 @@ protected void dispatchDraw(Canvas canvas) {
boolean recalculateText = recalculatedCling || mAlteredText;
mAlteredText = false;

// Draw the semi-transparent background
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.HONEYCOMB && !mHasNoTarget) {
Path path = new Path();
path.addCircle(showcaseX, showcaseY, showcaseRadius, Path.Direction.CW);
canvas.clipPath(path, Op.DIFFERENCE);
}

//Draw background color
canvas.drawColor(mBackgroundColor);

// Draw the showcase drawable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ public void drawShowcase(Canvas canvas, float x, float y, float scaleMultiplier,
mm.postScale(scaleMultiplier, scaleMultiplier, x, y);
canvas.setMatrix(mm);

canvas.drawCircle(x, y, radius, mEraser);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
canvas.drawCircle(x, y, radius, mEraser);
}

mShowcaseDrawable.setBounds(mShowcaseRect);
mShowcaseDrawable.draw(canvas);
Expand Down

0 comments on commit 428fce0

Please sign in to comment.