Back to Fresco

AbstractDraweeControllerBuilder

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

3.6.035.5 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Enums

Packages | Classes

Summary: Nested Classes | Protected Ctors | Methods | Protected Methods | Inherited Methods | [Expand All]

public abstract class

AbstractDraweeControllerBuilder

extends Object
implements SimpleDraweeControllerBuilder

| java.lang.Object | | ↳ | com.facebook.drawee.controller.AbstractDraweeControllerBuilder<BUILDER extends com.facebook.drawee.controller.AbstractDraweeControllerBuilder<BUILDER, REQUEST, IMAGE, INFO>, REQUEST, IMAGE, INFO> |

| Known Direct Subclasses

PipelineDraweeControllerBuilder

| PipelineDraweeControllerBuilder | Concrete implementation of ImagePipeline Drawee controller builder. |

|

Class Overview

Base implementation for Drawee controller builders.

Summary

Nested Classes
enum
Protected Constructors
Public Methods
AbstractDraweeController
Builds the specified controller.
boolean
Gets whether to auto play animations.
Object
Gets the caller context.
String
Gets the accessibility content description.
ControllerListener<? super INFO>
Gets the controller listener
ControllerViewportVisibilityListener
Gets the controller viewport visibility listener.
Supplier<DataSource<IMAGE>>
Gets the data source supplier if set.
REQUEST[]
Gets the array of first-available image requests.
REQUEST
Gets the image request.
LoggingListener
REQUEST
Gets the low-res image request.
DraweeController
Gets the old controller to be reused.
boolean
Gets whether to retain image on failure.
boolean
Gets whether tap-to-retry is enabled.
BUILDER
Resets this builder to its initial values making it reusable.
BUILDER
Sets whether to auto play animations.
BUILDER
Sets the caller context.
BUILDER
Sets the accessibility content description.
BUILDER
Sets the controller listener.
BUILDER
Sets the controller viewport visibility listener.
BUILDER
Sets the data source supplier to be used.
BUILDER
Sets the array of first-available image requests that will be probed in order.
BUILDER
Sets the array of first-available image requests that will be probed in order.
BUILDER
Sets the image request.
BUILDER
BUILDER
Sets the low-res image request.
BUILDER
Sets the old controller to be reused if possible.
BUILDER
Sets whether to display last available image in case of failure.
BUILDER
Sets whether tap-to-retry is enabled.
Protected Methods
AbstractDraweeController
Builds a regular controller.
static String
Generates unique controller id.
Context
abstract DataSource<IMAGE>
Concrete builder classes should override this method to return a data source for the request.
Supplier<DataSource<IMAGE>>
Creates a data source supplier for the given image request.
Supplier<DataSource<IMAGE>>
Creates a data source supplier for the given image request.
Supplier<DataSource<IMAGE>>
final BUILDER
void
Attaches listeners (if specified) to the given controller.
void
Installs a gesture detector to the given controller.
void
Installs a retry manager (if specified) to the given controller.
abstract AbstractDraweeController
Concrete builder classes should override this method to return a new controller.
Supplier<DataSource<IMAGE>>
Gets the top-level data source supplier to be used by a controller.
void
Validates the parameters before building a controller.

| [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.interfaces.SimpleDraweeControllerBuilder

| abstract DraweeController | build() Builds the specified controller. | | abstract SimpleDraweeControllerBuilder | setCallerContext(Object callerContext) Sets the caller context. | | abstract SimpleDraweeControllerBuilder | setOldController(DraweeController oldController) Sets the old controller to be reused if possible. | | abstract SimpleDraweeControllerBuilder | setUri(String uriString) Sets the uri from a string. | | abstract SimpleDraweeControllerBuilder | setUri(Uri uri) Sets the uri. |

|

Protected Constructors

protected AbstractDraweeControllerBuilder(Context context, Set<ControllerListener> boundControllerListeners, Set<ControllerListener2> boundControllerListeners2)

Public Methods

public AbstractDraweeController build()

Builds the specified controller.

public boolean getAutoPlayAnimations()

Gets whether to auto play animations.

public Object getCallerContext()

Gets the caller context.

public String getContentDescription()

Gets the accessibility content description.

public ControllerListener<? super INFO> getControllerListener()

Gets the controller listener

public ControllerViewportVisibilityListener getControllerViewportVisibilityListener()

Gets the controller viewport visibility listener.

public Supplier<DataSource<IMAGE>> getDataSourceSupplier()

Gets the data source supplier if set.

Important: this only returns the externally set data source (if any). Subclasses should use {#code obtainDataSourceSupplier()} to obtain a data source to be passed to the controller.

public REQUEST[] getFirstAvailableImageRequests()

Gets the array of first-available image requests.

For performance reasons, the array is not deep-copied, but only stored by reference. Please don't modify.

public REQUEST getImageRequest()

Gets the image request.

public LoggingListener getLoggingListener()

public REQUEST getLowResImageRequest()

Gets the low-res image request.

public DraweeController getOldController()

Gets the old controller to be reused.

public boolean getRetainImageOnFailure()

Gets whether to retain image on failure.

public boolean getTapToRetryEnabled()

Gets whether tap-to-retry is enabled.

public BUILDER reset()

Resets this builder to its initial values making it reusable.

public BUILDER setAutoPlayAnimations(boolean enabled)

Sets whether to auto play animations.

public BUILDER setCallerContext(Object callerContext)

Sets the caller context.

public BUILDER setContentDescription(String contentDescription)

Sets the accessibility content description.

public BUILDER setControllerListener(ControllerListener<? super INFO> controllerListener)

Sets the controller listener.

public BUILDER setControllerViewportVisibilityListener(ControllerViewportVisibilityListener controllerViewportVisibilityListener)

Sets the controller viewport visibility listener.

public BUILDER setDataSourceSupplier(Supplier<DataSource<IMAGE>> dataSourceSupplier)

Sets the data source supplier to be used.

Note: This is mutually exclusive with other image request setters.

public BUILDER setFirstAvailableImageRequests(REQUEST[] firstAvailableImageRequests)

Sets the array of first-available image requests that will be probed in order.

For performance reasons, the array is not deep-copied, but only stored by reference. Please don't modify once submitted.

public BUILDER setFirstAvailableImageRequests(REQUEST[] firstAvailableImageRequests, boolean tryCacheOnlyFirst)

Sets the array of first-available image requests that will be probed in order.

For performance reasons, the array is not deep-copied, but only stored by reference. Please don't modify once submitted.

Parameters

| tryCacheOnlyFirst | if set, bitmap cache only requests will be tried in order before the supplied requests. |

public BUILDER setImageRequest(REQUEST imageRequest)

Sets the image request.

public BUILDER setLoggingListener(LoggingListener loggingListener)

public BUILDER setLowResImageRequest(REQUEST lowResImageRequest)

Sets the low-res image request.

public BUILDER setOldController(DraweeController oldController)

Sets the old controller to be reused if possible.

public BUILDER setRetainImageOnFailure(boolean enabled)

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

public BUILDER setTapToRetryEnabled(boolean enabled)

Sets whether tap-to-retry is enabled.

Protected Methods

protected AbstractDraweeController buildController()

Builds a regular controller.

protected static String generateUniqueControllerId()

Generates unique controller id.

protected Context getContext()

protected abstract DataSource<IMAGE> getDataSourceForRequest(DraweeController controller, String controllerId, REQUEST imageRequest, Object callerContext, AbstractDraweeControllerBuilder.CacheLevel cacheLevel)

Concrete builder classes should override this method to return a data source for the request.

IMPORTANT: Do NOT ever call this method directly. This method is only to be called from a supplier created in {#code getDataSourceSupplierForRequest(REQUEST, boolean)}.

IMPORTANT: Make sure that you do NOT use any non-final field from this method, as the field may change if the instance of this builder gets reused. If any such field is required, override {#code getDataSourceSupplierForRequest(REQUEST, boolean)}, and store the field in a final variable (same as it is done for callerContext).

protected Supplier<DataSource<IMAGE>> getDataSourceSupplierForRequest(DraweeController controller, String controllerId, REQUEST imageRequest)

Creates a data source supplier for the given image request.

protected Supplier<DataSource<IMAGE>> getDataSourceSupplierForRequest(DraweeController controller, String controllerId, REQUEST imageRequest, AbstractDraweeControllerBuilder.CacheLevel cacheLevel)

Creates a data source supplier for the given image request.

protected Supplier<DataSource<IMAGE>> getFirstAvailableDataSourceSupplier(DraweeController controller, String controllerId, REQUEST[] imageRequests, boolean tryBitmapCacheOnlyFirst)

protected final BUILDER getThis()

protected void maybeAttachListeners(AbstractDraweeController controller)

Attaches listeners (if specified) to the given controller.

protected void maybeBuildAndSetGestureDetector(AbstractDraweeController controller)

Installs a gesture detector to the given controller.

protected void maybeBuildAndSetRetryManager(AbstractDraweeController controller)

Installs a retry manager (if specified) to the given controller.

protected abstract AbstractDraweeController obtainController()

Concrete builder classes should override this method to return a new controller.

protected Supplier<DataSource<IMAGE>> obtainDataSourceSupplier(DraweeController controller, String controllerId)

Gets the top-level data source supplier to be used by a controller.

protected void validate()

Validates the parameters before building a controller.

+Generated by Doclava. +