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);
    }
  }
 @Override
 protected void onDestroy() {
   // This is necessary to make the ZoomButtonsController unregister
   // its configuration change receiver.
   if (mZoomButtonsController != null) {
     mZoomButtonsController.setVisible(false);
   }
   super.onDestroy();
 }
 @Override
 public boolean onTouchEvent(MotionEvent ev) {
   super.onTouchEvent(ev);
   if (zoom_controll != null) {
     // Hide the controlls AFTER they where made visible by the default implementation.
     zoom_controll.setVisible(false);
   }
   return true;
 }
  public void show() {
    if (!getControls().isVisible() && !mZoomManager.isZoomScaleFixed()) {

      mZoomButtonsController.setVisible(true);

      if (mZoomManager.isDoubleTapEnabled()) {
        WebSettingsClassic settings = mWebView.getSettings();
        int count = settings.getDoubleTapToastCount();
        if (mZoomManager.isInZoomOverview() && count > 0) {
          settings.setDoubleTapToastCount(--count);
          Toast.makeText(
                  mWebView.getContext(),
                  com.android.internal.R.string.double_tap_toast,
                  Toast.LENGTH_LONG)
              .show();
        }
      }
    }
  }
  private void hideOnScreenControls() {
    if (mShowActionIcons && mActionIconPanel.getVisibility() == View.VISIBLE) {
      Animation animation = new AlphaAnimation(1, 0);
      animation.setDuration(500);
      mActionIconPanel.startAnimation(animation);
      mActionIconPanel.setVisibility(View.INVISIBLE);
    }

    if (mNextImageView.getVisibility() == View.VISIBLE) {
      Animation a = mHideNextImageViewAnimation;
      a.setDuration(500);
      mNextImageView.startAnimation(a);
      mNextImageView.setVisibility(View.INVISIBLE);
    }

    if (mPrevImageView.getVisibility() == View.VISIBLE) {
      Animation a = mHidePrevImageViewAnimation;
      a.setDuration(500);
      mPrevImageView.startAnimation(a);
      mPrevImageView.setVisibility(View.INVISIBLE);
    }

    mZoomButtonsController.setVisible(false);
  }
Exemple #6
0
 void dismissZoomPicker() {
   ZoomButtonsController zoomControls = getZoomControls();
   if (zoomControls != null && zoomControls.isVisible()) {
     zoomControls.setVisible(false);
   }
 }
Exemple #7
0
 void invokeZoomPicker() {
   ZoomButtonsController zoomControls = getZoomControls();
   if (zoomControls != null && !zoomControls.isVisible()) {
     zoomControls.setVisible(true);
   }
 }
 public void hide() {
   if (mZoomButtonsController != null) {
     mZoomButtonsController.setVisible(false);
   }
 }