public void Cleanup() { if (null == mImageView) { return; // cleanup already done } ImageView imageView = (ImageView)(((Reference)mImageView).Get()); if (null != imageView) { // Remove this as a global layout listener ViewTreeObserver observer = imageView.ViewTreeObserver; 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; }
public void Cleanup() { if (null != mImageView) { mImageView.TryGetTarget(out ImageView v); v.ViewTreeObserver.RemoveGlobalOnLayoutListener(this); } mViewTreeObserver = null; // Clear listeners too mMatrixChangeListener = null; mPhotoTapListener = null; mViewTapListener = null; // Finally, clear ImageView mImageView = null; }
public void SetOnMatrixChangeListener(IOnMatrixChangedListener listener) { mMatrixChangeListener = listener; }
public void SetOnMatrixChangeListener(IOnMatrixChangedListener listener) { mMatrixChangeListener = listener; }
public void Cleanup() { if (null == mImageView) { return; // cleanup already done } ImageView imageView = (ImageView)(((Reference)mImageView).Get()); if (null != imageView) { // Remove this as a global layout listener ViewTreeObserver observer = imageView.ViewTreeObserver; 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; }