Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ TapTargetView.showFor(this, // `this` is an Activity
TapTarget.forView(findViewById(R.id.target), "This is a target", "We have the best targets, believe me")
// All options below are optional
.outerCircleColor(R.color.red) // Specify a color for the outer circle
.outerCircleAlpha(0.96f) // Specify the alpha amount for the outer circle
.outerCircleAlpha(0.96f) // Specify the alpha amount for the outer circle
.targetCircleColor(R.color.white) // Specify a color for the target circle
.titleTextSize(20) // Specify the size (in sp) of the title text
.titleTextColor(R.color.white) // Specify the color of the title text
.descriptionTextSize(10) // Specify the size (in sp) of the description text
.descriptionTextColor(R.color.red) // Specify the color of the description text
.textColor(R.color.blue) // Specify a color for both the title and description text
.textTypeface(Typeface.SANS_SERIF) // Specify a typeface for the text
.dimColor(R.color.black) // If set, will dim behind the view with 30% opacity of the given color
.dimColor(R.color.black) // If set, will dim behind the view with the given color
.dimColorOpacity(0.75f) // Specify the dim opacity for given color, 30% opacity if not set.
.drawShadow(true) // Whether to draw a drop shadow or not
.cancelable(false) // Whether tapping outside the outer circle dismisses the view
.tintTarget(true) // Whether to tint the target view's color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class TapTarget {
@Nullable
final CharSequence description;

float dimColorOpacity = 0.3f;
float outerCircleAlpha = 0.96f;
int targetRadius = 44;

Expand Down Expand Up @@ -371,6 +372,16 @@ public TapTarget dimColorInt(@ColorInt int color) {
return this;
}

/** **/ /**
* Specify the opacity for the dim color
* <p>
* <b>Note:</b> The specified opacity will range between 0 and 1 been the second 100% opacity
*/
public TapTarget dimColorOpacity(float opacity){
this.dimColorOpacity = opacity;
return this;
}

/** Specify whether or not to draw a drop shadow around the outer circle **/
public TapTarget drawShadow(boolean draw) {
this.drawShadow = draw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ public void getOutline(View view, Outline outline) {

final Integer targetDimColor = target.dimColorInt(context);
if (targetDimColor != null) {
dimColor = UiUtil.setAlpha(targetDimColor, 0.3f);
dimColor = UiUtil.setAlpha(targetDimColor, target.dimColorOpacity);
} else {
dimColor = -1;
}
Expand Down