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

Commit 1643f5b

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 853644a + f9556fe commit 1643f5b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public class ShowcaseView extends RelativeLayout
8383
private boolean isShowing;
8484
private int backgroundColor;
8585
private int showcaseColor;
86+
private boolean blockAllTouches;
8687

8788
protected ShowcaseView(Context context, boolean newStyle) {
8889
this(context, null, R.styleable.CustomTheme_showcaseViewStyle, newStyle);
@@ -340,6 +341,9 @@ public void onAnimationStart() {
340341

341342
@Override
342343
public boolean onTouch(View view, MotionEvent motionEvent) {
344+
if (blockAllTouches) {
345+
return true;
346+
}
343347

344348
float xDelta = Math.abs(motionEvent.getRawX() - showcaseX);
345349
float yDelta = Math.abs(motionEvent.getRawY() - showcaseY);
@@ -593,6 +597,15 @@ public Builder replaceEndButton(int buttonResourceId) {
593597
}
594598
return replaceEndButton((Button) view);
595599
}
600+
601+
/**
602+
* Block any touch made on the ShowcaseView, even inside the showcase
603+
*/
604+
public Builder blockAllTouches() {
605+
showcaseView.setBlockAllTouches(true);
606+
return this;
607+
}
608+
596609
}
597610

598611
private void setEndButton(Button button) {
@@ -700,6 +713,10 @@ public void setBlocksTouches(boolean blockTouches) {
700713
this.blockTouches = blockTouches;
701714
}
702715

716+
private void setBlockAllTouches(boolean blockAllTouches) {
717+
this.blockAllTouches = blockAllTouches;
718+
}
719+
703720
/**
704721
* @see com.github.amlcurran.showcaseview.ShowcaseView.Builder#setStyle(int)
705722
*/

0 commit comments

Comments
 (0)