Exemplo 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();
 }
Exemplo 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;
 }
Exemplo n.º 3
0
 void setShowcasePosition(int x, int y) {
   if (shotStateStore.hasShot()) {
     return;
   }
   showcaseX = x;
   showcaseY = y;
   // init();
   invalidate();
 }
Exemplo 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);
  }
Exemplo n.º 5
0
 /** @see com.github.amlcurran.showcaseview.ShowcaseView.Builder#setSingleShot(long) */
 private void setSingleShot(long shotId) {
   shotStateStore.setSingleShot(shotId);
 }
Exemplo n.º 6
0
 @Override
 public void onGlobalLayout() {
   if (!shotStateStore.hasShot()) {
     updateBitmap();
   }
 }
Exemplo n.º 7
0
 private boolean hasShot() {
   return shotStateStore.hasShot();
 }