Skip to content
This repository was archived by the owner on Apr 24, 2018. It is now read-only.

Commit 946b1e8

Browse files
committed
Merge branch 'master' into allow_to_add_the_showcase_view_to_a_custom_parent
Conflicts: library/src/main/java/com/github/amlcurran/showcaseview/ShowcaseView.java
2 parents 425bebc + f9556fe commit 946b1e8

25 files changed

+579
-111
lines changed

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
1-
ShowcaseView is deprecated
2-
====
3-
Currently, ShowcaseView is not under active development; issues cannot be opened and PRs will not be accepted.
4-
5-
I've decided to make this decision because I want to rewrite the project from scratch with a far better API. A lot of things Google keep introducing in Android break ShowcaseView and it is too difficult to make these changes with the project in it's current form.
6-
7-
The project is still available on Maven, see below for the instructions. Please see the new-scv branch for development of the new API.
8-
9-
10-
111
ShowcaseView
122
---
133

144
The ShowcaseView (SCV) library is designed to highlight and showcase specific parts of apps to the user with a distinctive and attractive overlay. This library is great for pointing out points of interest for users, gestures, or obscure but useful items.
155

16-
<img src='./example@2x.png' width='270' height='480' />
17-
<img src='./example2@2x.png' width='270' height='480' />
6+
| Holo | "New style" | Material |
7+
| --- | --- | --- |
8+
| ![Holo style showcaseview](./example2@2x.png) | ![new style showcaseview](./example@2x.png) | ![Material style showcaseview](./material.png) |
189

1910
The library is based on the "Cling" view found in the Launcher on Ice-Cream Sandwich and Jelly Bean.
2011

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
#
1616

17-
VERSION_CODE=50102
18-
VERSION_NAME=5.1.1-SNAPSHOT
17+
VERSION_CODE=50201
18+
VERSION_NAME=5.2.1-SNAPSHOT
1919
GROUP=com.github.amlcurran.showcaseview
2020

2121
POM_DESCRIPTION=Highlight the best bits of your app to users quickly, simply, and cool...ly
@@ -29,8 +29,8 @@ POM_LICENCE_DIST=repo
2929
POM_DEVELOPER_ID=amlcurran
3030
POM_DEVELOPER_NAME=Alex Curran
3131

32-
BUILD_TOOLS_VERSION=21.0.0
33-
COMPILE_SDK=21
32+
BUILD_TOOLS_VERSION=22.0.1
33+
COMPILE_SDK=23
3434
MIN_SDK_LIBRARY=9
3535
MIN_SDK_SAMPLE=11
36-
TARGET_SDK=21
36+
TARGET_SDK=23

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ buildscript {
2020
}
2121

2222
dependencies {
23-
classpath 'com.android.tools.build:gradle:1.0.0'
23+
classpath 'com.android.tools.build:gradle:1.3.0'
2424
}
2525
}
2626

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package com.github.amlcurran.showcaseview;
2+
3+
import android.content.res.Resources;
4+
import android.graphics.Bitmap;
5+
import android.graphics.Canvas;
6+
import android.graphics.Paint;
7+
import android.graphics.PorterDuff;
8+
import android.graphics.PorterDuffXfermode;
9+
10+
public class MaterialShowcaseDrawer implements ShowcaseDrawer {
11+
12+
private final float radius;
13+
private final Paint basicPaint;
14+
private final Paint eraserPaint;
15+
private int backgroundColor;
16+
17+
public MaterialShowcaseDrawer(Resources resources) {
18+
this.radius = resources.getDimension(R.dimen.showcase_radius_material);
19+
this.eraserPaint = new Paint();
20+
this.eraserPaint.setColor(0xFFFFFF);
21+
this.eraserPaint.setAlpha(0);
22+
this.eraserPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY));
23+
this.eraserPaint.setAntiAlias(true);
24+
this.basicPaint = new Paint();
25+
}
26+
27+
@Override
28+
public void setShowcaseColour(int color) {
29+
// no-op
30+
}
31+
32+
@Override
33+
public void drawShowcase(Bitmap buffer, float x, float y, float scaleMultiplier) {
34+
Canvas bufferCanvas = new Canvas(buffer);
35+
bufferCanvas.drawCircle(x, y, radius, eraserPaint);
36+
}
37+
38+
@Override
39+
public int getShowcaseWidth() {
40+
return (int) (radius * 2);
41+
}
42+
43+
@Override
44+
public int getShowcaseHeight() {
45+
return (int) (radius * 2);
46+
}
47+
48+
@Override
49+
public float getBlockedRadius() {
50+
return radius;
51+
}
52+
53+
@Override
54+
public void setBackgroundColour(int backgroundColor) {
55+
this.backgroundColor = backgroundColor;
56+
}
57+
58+
@Override
59+
public void erase(Bitmap bitmapBuffer) {
60+
bitmapBuffer.eraseColor(backgroundColor);
61+
}
62+
63+
@Override
64+
public void drawToCanvas(Canvas canvas, Bitmap bitmapBuffer) {
65+
canvas.drawBitmap(bitmapBuffer, 0, 0, basicPaint);
66+
}
67+
}

library/src/main/java/com/github/amlcurran/showcaseview/ShowcaseDrawer.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import android.graphics.Bitmap;
2020
import android.graphics.Canvas;
2121

22-
/**
23-
* Created by curraa01 on 13/10/2013.
24-
*/
25-
interface ShowcaseDrawer {
22+
public interface ShowcaseDrawer {
2623

2724
void setShowcaseColour(int color);
2825

0 commit comments

Comments
 (0)