public void hide() { clearBitmap(); // If the type is set to one-shot, store that it has shot shotStateStore.storeShot(); mEventListener.onShowcaseViewHide(this); fadeOutShowcase(); }
/** * Override the standard button click event * * @param listener Listener to listen to on click events */ public void overrideButtonClick(OnClickListener listener) { if (shotStateStore.hasShot()) { return; } if (mEndButton != null) { mEndButton.setOnClickListener(listener != null ? listener : this); } hasCustomClickListener = true; }
void setShowcasePosition(int x, int y) { if (shotStateStore.hasShot()) { return; } showcaseX = x; showcaseY = y; // init(); invalidate(); }
@Override protected void dispatchDraw(Canvas canvas) { if (showcaseX < 0 || showcaseY < 0 || shotStateStore.hasShot()) { super.dispatchDraw(canvas); return; } // Draw background color showcaseDrawer.erase(bitmapBuffer); // Draw the showcase drawable if (!hasNoTarget) { showcaseDrawer.drawShowcase(bitmapBuffer, showcaseX, showcaseY, scaleMultiplier); showcaseDrawer.drawToCanvas(canvas, bitmapBuffer); } // Draw the text on the screen, recalculating its position if necessary textDrawer.draw(canvas); super.dispatchDraw(canvas); }
/** @see com.github.amlcurran.showcaseview.ShowcaseView.Builder#setSingleShot(long) */ private void setSingleShot(long shotId) { shotStateStore.setSingleShot(shotId); }
@Override public void onGlobalLayout() { if (!shotStateStore.hasShot()) { updateBitmap(); } }
private boolean hasShot() { return shotStateStore.hasShot(); }