private void showOnScreenControls() {
    if (mPaused) return;
    // If the view has not been attached to the window yet, the
    // zoomButtonControls will not able to show up. So delay it until the
    // view has attached to window.
    if (mActionIconPanel.getWindowToken() == null) {
      mHandler.postGetterCallback(
          new Runnable() {
            public void run() {
              showOnScreenControls();
            }
          });
      return;
    }
    updateNextPrevControls();

    IImage image = mAllImages.getImageAt(mCurrentPosition);
    if (image instanceof VideoObject) {
      mZoomButtonsController.setVisible(false);
    } else {
      updateZoomButtonsEnabled();
      mZoomButtonsController.setVisible(true);
    }

    if (mShowActionIcons && mActionIconPanel.getVisibility() != View.VISIBLE) {
      Animation animation = new AlphaAnimation(0, 1);
      animation.setDuration(500);
      mActionIconPanel.startAnimation(animation);
      mActionIconPanel.setVisibility(View.VISIBLE);
    }
  }
Exemplo n.º 2
0
    private void showOnScreenControls() {

        // If the view has not been attached to the window yet, the
        // zoomButtonControls will not able to show up. So delay it until the
        // view has attached to window.
        if (mRootView.getWindowToken() == null) {
            mHandler.postGetterCallback(new Runnable() {
                public void run() {
                    showOnScreenControls();
                }
            });
            return;
        }

        // we may need to update the next/prev button due to index changing
        updateNextPrevControls();

        if (ImageManager.isImage(mAllImages.getImageAt(mCurrentPosition))) {
            updateZoomButtonsEnabled();
            mZoomButtonsController.setVisible(true);
        } else {
            mZoomButtonsController.setVisible(false);
        }
    }