Back to Fresco

AbstractDraweeController

docs/javadoc/reference/com/facebook/drawee/controller/AbstractDraweeController.html

3.6.031.0 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Packages | Classes

Summary: Fields | Ctors | Methods | Protected Methods | Inherited Methods | [Expand All]

public abstract class

AbstractDraweeController

extends Object
implements DeferredReleaser.ReleasableGestureDetector.ClickListenerDraweeController

| java.lang.Object | | ↳ | com.facebook.drawee.controller.AbstractDraweeController<T, INFO> |

| Known Direct Subclasses

PipelineDraweeController

| PipelineDraweeController | Drawee controller that bridges the image pipeline with SettableDraweeHierarchy. |

|

Class Overview

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.

Summary

Fields
protected ControllerListener<INFO>
protected ForwardingControllerListener2<INFO>
protected Drawable
protected LoggingListener
Public Constructors
Public Methods
void
Adds controller listener.
void
Animatable
For an animated image, returns an Animatable that lets clients control the animation.
Object
Gets the analytic tag & caller context
String
Gets accessibility content description.
DraweeHierarchy
Gets the hierarchy
String
Gets the controller id.
abstract Map<String, Object>
void
Called when the view containing the hierarchy is attached to a window (either temporarily or permanently).
boolean
void
Called when the view containing the hierarchy is detached from a window (either temporarily or permanently).
boolean
Called when the view containing the hierarchy receives a touch event.
void
An optional hint whether the view containing the hierarchy is currently within the visible viewport or not.
void
void
Removes controller listener.
void
void
Sets accessibility content description.
void
Sets the controller viewport visibility listener
void
Sets the hierarchy.
void
String
Protected Methods
abstract Drawable
T
ControllerListener<INFO>
Gets controller listener for internal use.
ControllerListener2<INFO>
Drawable
Gets the controller overlay
abstract DataSource<T>
GestureDetector
Gets gesture detector.
String
int
abstract INFO
LoggingListener
Uri
RetryManager
Gets retry manager.
void
Initializes this controller with the new id and caller context.
void
abstract void
abstract void
void
void
Sets the controller overlay
void
Sets gesture detector.
void
Sets whether to display last available image in case of failure.
boolean
Returns whether the gesture should be handled by the controller
void

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.drawee.components.DeferredReleaser.Releasable

| abstract void | release() |

| | From interface com.facebook.drawee.gestures.GestureDetector.ClickListener

| abstract boolean | onClick() |

| | From interface com.facebook.drawee.interfaces.DraweeController

| abstract Animatable | getAnimatable() For an animated image, returns an Animatable that lets clients control the animation. | | abstract String | getContentDescription() Gets the accessibility content description. | | abstract DraweeHierarchy | getHierarchy() Gets the hierarchy. | | abstract boolean | isSameImageRequest(DraweeController other) Returns whether other would fetch the same image as this. | | abstract void | onAttach() Called when the view containing the hierarchy is attached to a window (either temporarily or permanently). | | abstract void | onDetach() Called when the view containing the hierarchy is detached from a window (either temporarily or permanently). | | abstract boolean | onTouchEvent(MotionEvent event) Called when the view containing the hierarchy receives a touch event. | | abstract void | onViewportVisibilityHint(boolean isVisibleInViewportHint) An optional hint whether the view containing the hierarchy is currently within the visible viewport or not. | | abstract void | setContentDescription(String contentDescription) Sets the accessibility content description. | | abstract void | setHierarchy(DraweeHierarchy hierarchy) Sets a new hierarchy. |

|

Fields

protected ControllerListener<INFO> mControllerListener

protected ForwardingControllerListener2<INFO> mControllerListener2

protected Drawable mDrawable

protected LoggingListener mLoggingListener

Public Constructors

public AbstractDraweeController(DeferredReleaser deferredReleaser, Executor uiThreadImmediateExecutor, String id, Object callerContext)

Public Methods

public void addControllerListener(ControllerListener<? super INFO> controllerListener)

Adds controller listener.

public void addControllerListener2(ControllerListener2<INFO> controllerListener2)

public Animatable getAnimatable()

For an animated image, returns an Animatable that lets clients control the animation.

Returns
  • animatable, or null if the image is not animated or not loaded yet

public Object getCallerContext()

Gets the analytic tag & caller context

public String getContentDescription()

Gets accessibility content description.

Returns
  • content description, or null if the image has no content description

public DraweeHierarchy getHierarchy()

Gets the hierarchy

public String getId()

Gets the controller id.

public abstract Map<String, Object> obtainExtrasFromImage(INFO info)

public void onAttach()

Called when the view containing the hierarchy is attached to a window (either temporarily or permanently).

public boolean onClick()

public void onDetach()

Called when the view containing the hierarchy is detached from a window (either temporarily or permanently).

public boolean onTouchEvent(MotionEvent event)

Called when the view containing the hierarchy receives a touch event.

Returns
  • true if the event was handled by the controller, false otherwise

public void onViewportVisibilityHint(boolean isVisibleInViewportHint)

An optional hint whether the view containing the hierarchy is currently within the visible viewport or not.

public void release()

public void removeControllerListener(ControllerListener<? super INFO> controllerListener)

Removes controller listener.

public void removeControllerListener2(ControllerListener2<INFO> controllerListener2)

public void setContentDescription(String contentDescription)

Sets accessibility content description.

public void setControllerViewportVisibilityListener(ControllerViewportVisibilityListener controllerViewportVisibilityListener)

Sets the controller viewport visibility listener

public void setHierarchy(DraweeHierarchy hierarchy)

Sets the hierarchy.

The controller should be detached when this method is called.

Parameters

| hierarchy | This must be an instance of SettableDraweeHierarchy |

public void setLoggingListener(LoggingListener loggingListener)

public String toString()

Protected Methods

protected abstract Drawable createDrawable(T image)

protected T getCachedImage()

protected ControllerListener<INFO> getControllerListener()

Gets controller listener for internal use.

protected ControllerListener2<INFO> getControllerListener2()

protected Drawable getControllerOverlay()

Gets the controller overlay

protected abstract DataSource<T> getDataSource()

protected GestureDetector getGestureDetector()

Gets gesture detector.

protected String getImageClass(T image)

protected int getImageHash(T image)

protected abstract INFO getImageInfo(T image)

protected LoggingListener getLoggingListener()

protected Uri getMainUri()

protected RetryManager getRetryManager()

Gets retry manager.

protected void initialize(String id, Object callerContext)

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.

Parameters

| id | unique id for this controller | | callerContext | tag and context for this controller |

protected void onImageLoadedFromCacheImmediately(String id, T cachedImage)

protected abstract void releaseDrawable(Drawable drawable)

protected abstract void releaseImage(T image)

protected void reportSubmit(DataSource<T> dataSource, INFO info)

protected void setControllerOverlay(Drawable controllerOverlay)

Sets the controller overlay

protected void setGestureDetector(GestureDetector gestureDetector)

Sets gesture detector.

protected void setRetainImageOnFailure(boolean enabled)

Sets whether to display last available image in case of failure.

protected boolean shouldHandleGesture()

Returns whether the gesture should be handled by the controller

protected void submitRequest()

+Generated by Doclava. +