From 76e80986a0811f3989f54155f55635fce39168af Mon Sep 17 00:00:00 2001 From: Bahram Malaekeh Date: Thu, 29 Mar 2018 17:55:12 +0100 Subject: [PATCH] - Added hasNext() function to TourGuide. - Added info to Readme about disableClickThroughHole. --- README.md | 1 + .../src/main/java/tourguide/tourguide/ChainTourGuide.java | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e3a87a0..d78865f 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ Overlay overlay = new Overlay() .setStyle(Overlay.Style.Rectangle); ``` - `disableClick(true)` will make elements covered by the overlay to become unclickable. Refer to Overlay Customization Activity in the example. +- `disableClickThroughHole(true)` will make elements through the hole become unclickable. - `.setStyle()` Currently only 2 styles are available: `Overlay.Style.Rectangle` and `Overlay.Style.Circle` # Running TourGuide in Sequence diff --git a/tourguide/src/main/java/tourguide/tourguide/ChainTourGuide.java b/tourguide/src/main/java/tourguide/tourguide/ChainTourGuide.java index 1b55d13..347f4a5 100644 --- a/tourguide/src/main/java/tourguide/tourguide/ChainTourGuide.java +++ b/tourguide/src/main/java/tourguide/tourguide/ChainTourGuide.java @@ -60,7 +60,7 @@ public ChainTourGuide next(){ cleanUp(); } - if (mSequence.mCurrentSequence < mSequence.mTourGuideArray.length) { + if (hasNext()) { setToolTip(mSequence.getToolTip()); setPointer(mSequence.getPointer()); setOverlay(mSequence.getOverlay()); @@ -73,6 +73,10 @@ public ChainTourGuide next(){ return this; } + public boolean hasNext() { + return mSequence.mCurrentSequence < mSequence.mTourGuideArray.length; + } + /************************** * Sequence related method **************************/