docs: @SuppressWarnings("deprecation")
      public void cleanup() {
          if (null == mImageView) {
              return; // cleanup already done
          }
  
          final ImageView imageView = mImageView.get();
  
          if (null != imageView) {
              // Remove this as a global layout listener
              ViewTreeObserver observer = imageView.getViewTreeObserver();
              if (null != observer && observer.isAlive()) {
                  observer.removeGlobalOnLayoutListener(this);
              }
  
              // Remove the ImageView's reference to this
              imageView.setOnTouchListener(null);
  
              // make sure a pending fling runnable won't be run
              cancelFling();
          }
  
          if (null != mGestureDetector) {
              mGestureDetector.setOnDoubleTapListener(null);
          }
  
          // Clear listeners too
          mMatrixChangeListener = null;
          mPhotoTapListener = null;
          mViewTapListener = null;
  
          // Finally, clear ImageView
          mImageView = null;
      }