@Override public void scrollToIdx(int idx) { if (idx >= 0 && idx < getAdapter().getCount()) { setSelection(idx); if (mOnViewFlipListener != null) mOnViewFlipListener.onViewFlipped(null, idx); } }
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 } } }); } }
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(); // } } }); // } }
// add by hz public void flipToPageAgain() { if (onViewFlipListener != null) { onViewFlipListener.onViewFlipped(bufferedViews.get(bufferIndex), adapterIndex); if (playPauseCallBack != null) playPauseCallBack.onFliped(bufferedViews.get(bufferIndex)); } }