コード例 #1
0
 @Override
 public void scrollToIdx(int idx) {
   if (idx >= 0 && idx < getAdapter().getCount()) {
     setSelection(idx);
     if (mOnViewFlipListener != null) mOnViewFlipListener.onViewFlipped(null, idx);
   }
 }
コード例 #2
0
  private void hideFlipAnimation() {
    if (inFlipAnimation) {
      inFlipAnimation = false;

      updateVisibleView(bufferIndex);

      if (onViewFlipListener != null) {
        onViewFlipListener.onViewFlipped(bufferedViews.get(bufferIndex), adapterIndex);
        if (playPauseCallBack != null) playPauseCallBack.onFliped(bufferedViews.get(bufferIndex));
      }

      handler.post(
          new Runnable() {
            public void run() {
              if (!inFlipAnimation) {
                cards.setVisible(false);
                surfaceView.requestRender(); // ask OpenGL to clear its display
              }
            }
          });
    }
  }
コード例 #3
0
  private void hideFlipAnimation() {
    blockTouch = true;
    // if (inFlipAnimation) {
    inFlipAnimation = false;

    updateVisibleView(bufferIndex);

    if (onViewFlipListener != null) {
      onViewFlipListener.onViewFlipped(bufferedViews.get(bufferIndex), adapterIndex);
    }

    handler.post(
        new Runnable() {
          public void run() {
            // if (!inFlipAnimation) {

            new Thread() {
              public void run() {
                try {
                  Thread.sleep(100);
                } catch (InterruptedException e) {
                }
                ((Activity) FlipViewController.this.getContext())
                    .runOnUiThread(
                        new Runnable() {
                          public void run() {
                            surfaceView.requestRender(); // ask OpenGL to clear its display
                            cards.setVisible(false);
                            surfaceView.requestRender(); // ask OpenGL to clear its display
                          }
                        });
                blockTouch = false;
              };
            }.start();
            // }
          }
        });
    // }
  }
コード例 #4
0
 // add by hz
 public void flipToPageAgain() {
   if (onViewFlipListener != null) {
     onViewFlipListener.onViewFlipped(bufferedViews.get(bufferIndex), adapterIndex);
     if (playPauseCallBack != null) playPauseCallBack.onFliped(bufferedViews.get(bufferIndex));
   }
 }