java.lang.Object | |
↳ | com.facebook.drawee.controller.AbstractDraweeController<T, INFO> |
Known Direct Subclasses |
Abstract Drawee controller that implements common functionality regardless of the backend used to fetch the image.
All methods should be called on the main UI thread.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected ControllerListener<INFO> | mControllerListener | ||||||||||
protected ForwardingControllerListener2<INFO> | mControllerListener2 | ||||||||||
protected Drawable | mDrawable | ||||||||||
protected LoggingListener | mLoggingListener |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractDraweeController(DeferredReleaser deferredReleaser, Executor uiThreadImmediateExecutor, String id, Object callerContext) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addControllerListener(ControllerListener<? super INFO> controllerListener)
Adds controller listener.
| ||||||||||
void | addControllerListener2(ControllerListener2<INFO> controllerListener2) | ||||||||||
Animatable |
getAnimatable()
For an animated image, returns an Animatable that lets clients control the animation.
| ||||||||||
Object |
getCallerContext()
Gets the analytic tag & caller context
| ||||||||||
String |
getContentDescription()
Gets accessibility content description.
| ||||||||||
DraweeHierarchy |
getHierarchy()
Gets the hierarchy
| ||||||||||
String |
getId()
Gets the controller id.
| ||||||||||
abstract Map<String, Object> | obtainExtrasFromImage(INFO info) | ||||||||||
void |
onAttach()
Called when the view containing the hierarchy is attached to a window (either temporarily or
permanently).
| ||||||||||
boolean | onClick() | ||||||||||
void |
onDetach()
Called when the view containing the hierarchy is detached from a window (either temporarily or
permanently).
| ||||||||||
boolean |
onTouchEvent(MotionEvent event)
Called when the view containing the hierarchy receives a touch event.
| ||||||||||
void |
onViewportVisibilityHint(boolean isVisibleInViewportHint)
An optional hint whether the view containing the hierarchy is currently within the visible
viewport or not.
| ||||||||||
void | release() | ||||||||||
void |
removeControllerListener(ControllerListener<? super INFO> controllerListener)
Removes controller listener.
| ||||||||||
void | removeControllerListener2(ControllerListener2<INFO> controllerListener2) | ||||||||||
void |
setContentDescription(String contentDescription)
Sets accessibility content description.
| ||||||||||
void |
setControllerViewportVisibilityListener(ControllerViewportVisibilityListener controllerViewportVisibilityListener)
Sets the controller viewport visibility listener
| ||||||||||
void |
setHierarchy(DraweeHierarchy hierarchy)
Sets the hierarchy.
| ||||||||||
void | setLoggingListener(LoggingListener loggingListener) | ||||||||||
String | toString() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract Drawable | createDrawable(T image) | ||||||||||
T | getCachedImage() | ||||||||||
ControllerListener<INFO> |
getControllerListener()
Gets controller listener for internal use.
| ||||||||||
ControllerListener2<INFO> | getControllerListener2() | ||||||||||
Drawable |
getControllerOverlay()
Gets the controller overlay
| ||||||||||
abstract DataSource<T> | getDataSource() | ||||||||||
GestureDetector |
getGestureDetector()
Gets gesture detector.
| ||||||||||
String | getImageClass(T image) | ||||||||||
int | getImageHash(T image) | ||||||||||
abstract INFO | getImageInfo(T image) | ||||||||||
LoggingListener | getLoggingListener() | ||||||||||
Uri | getMainUri() | ||||||||||
RetryManager |
getRetryManager()
Gets retry manager.
| ||||||||||
void |
initialize(String id, Object callerContext)
Initializes this controller with the new id and caller context.
| ||||||||||
void | onImageLoadedFromCacheImmediately(String id, T cachedImage) | ||||||||||
abstract void | releaseDrawable(Drawable drawable) | ||||||||||
abstract void | releaseImage(T image) | ||||||||||
void | reportSubmit(DataSource<T> dataSource, INFO info) | ||||||||||
void |
setControllerOverlay(Drawable controllerOverlay)
Sets the controller overlay
| ||||||||||
void |
setGestureDetector(GestureDetector gestureDetector)
Sets gesture detector.
| ||||||||||
void |
setRetainImageOnFailure(boolean enabled)
Sets whether to display last available image in case of failure.
| ||||||||||
boolean |
shouldHandleGesture()
Returns whether the gesture should be handled by the controller
| ||||||||||
void | submitRequest() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.drawee.components.DeferredReleaser.Releasable
| |||||||||||
From interface
com.facebook.drawee.gestures.GestureDetector.ClickListener
| |||||||||||
From interface
com.facebook.drawee.interfaces.DraweeController
|
Adds controller listener.
For an animated image, returns an Animatable that lets clients control the animation.
Gets the analytic tag & caller context
Gets accessibility content description.
Gets the controller id.
Called when the view containing the hierarchy is attached to a window (either temporarily or permanently).
Called when the view containing the hierarchy is detached from a window (either temporarily or permanently).
Called when the view containing the hierarchy receives a touch event.
An optional hint whether the view containing the hierarchy is currently within the visible viewport or not.
Removes controller listener.
Sets accessibility content description.
Sets the controller viewport visibility listener
Sets the hierarchy.
The controller should be detached when this method is called.
hierarchy | This must be an instance of SettableDraweeHierarchy
|
---|
Gets controller listener for internal use.
Gets the controller overlay
Initializes this controller with the new id and caller context. This allows for reusing of the existing controller instead of instantiating a new one. This method should be called when the controller is in detached state.
id | unique id for this controller |
---|---|
callerContext | tag and context for this controller |
Sets the controller overlay
Sets whether to display last available image in case of failure.
Returns whether the gesture should be handled by the controller