Esempio n. 1
0
 public void hide() {
   clearBitmap();
   // If the type is set to one-shot, store that it has shot
   shotStateStore.storeShot();
   mEventListener.onShowcaseViewHide(this);
   fadeOutShowcase();
 }
Esempio n. 2
0
 /**
  * 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;
 }
Esempio n. 3
0
 void setShowcasePosition(int x, int y) {
   if (shotStateStore.hasShot()) {
     return;
   }
   showcaseX = x;
   showcaseY = y;
   // init();
   invalidate();
 }
Esempio n. 4
0
  @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);
  }
Esempio n. 5
0
 /** @see com.github.amlcurran.showcaseview.ShowcaseView.Builder#setSingleShot(long) */
 private void setSingleShot(long shotId) {
   shotStateStore.setSingleShot(shotId);
 }
Esempio n. 6
0
 @Override
 public void onGlobalLayout() {
   if (!shotStateStore.hasShot()) {
     updateBitmap();
   }
 }
Esempio n. 7
0
 private boolean hasShot() {
   return shotStateStore.hasShot();
 }