/** Installs a gesture detector to the given controller. */ protected void maybeBuildAndSetGestureDetector(AbstractDraweeController controller) { GestureDetector gestureDetector = controller.getGestureDetector(); if (gestureDetector == null) { gestureDetector = GestureDetector.newInstance(mContext); controller.setGestureDetector(gestureDetector); } }
/** Installs a retry manager (if specified) to the given controller. */ protected void maybeBuildAndSetRetryManager(AbstractDraweeController controller) { if (!mTapToRetryEnabled) { return; } RetryManager retryManager = controller.getRetryManager(); if (retryManager == null) { retryManager = new RetryManager(); controller.setRetryManager(retryManager); } retryManager.setTapToRetryEnabled(mTapToRetryEnabled); maybeBuildAndSetGestureDetector(controller); }
/** Attaches listeners (if specified) to the given controller. */ protected void maybeAttachListeners(AbstractDraweeController controller) { if (mBoundControllerListeners != null) { for (ControllerListener<? super INFO> listener : mBoundControllerListeners) { controller.addControllerListener(listener); } } if (mControllerListener != null) { controller.addControllerListener(mControllerListener); } if (mAutoPlayAnimations) { controller.addControllerListener(sAutoPlayAnimationsListener); } }