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 |
Base implementation for Drawee controller builders.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | AbstractDraweeControllerBuilder.CacheLevel |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractDraweeControllerBuilder(Context context, Set<ControllerListener> boundControllerListeners, Set<ControllerListener2> boundControllerListeners2) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractDraweeController |
build()
Builds the specified controller.
| ||||||||||
boolean |
getAutoPlayAnimations()
Gets whether to auto play animations.
| ||||||||||
Object |
getCallerContext()
Gets the caller context.
| ||||||||||
String |
getContentDescription()
Gets the accessibility content description.
| ||||||||||
ControllerListener<? super INFO> |
getControllerListener()
Gets the controller listener
| ||||||||||
ControllerViewportVisibilityListener |
getControllerViewportVisibilityListener()
Gets the controller viewport visibility listener.
| ||||||||||
Supplier<DataSource<IMAGE>> |
getDataSourceSupplier()
Gets the data source supplier if set.
| ||||||||||
REQUEST[] |
getFirstAvailableImageRequests()
Gets the array of first-available image requests.
| ||||||||||
REQUEST |
getImageRequest()
Gets the image request.
| ||||||||||
LoggingListener | getLoggingListener() | ||||||||||
REQUEST |
getLowResImageRequest()
Gets the low-res image request.
| ||||||||||
DraweeController |
getOldController()
Gets the old controller to be reused.
| ||||||||||
boolean |
getRetainImageOnFailure()
Gets whether to retain image on failure.
| ||||||||||
boolean |
getTapToRetryEnabled()
Gets whether tap-to-retry is enabled.
| ||||||||||
BUILDER |
reset()
Resets this builder to its initial values making it reusable.
| ||||||||||
BUILDER |
setAutoPlayAnimations(boolean enabled)
Sets whether to auto play animations.
| ||||||||||
BUILDER |
setCallerContext(Object callerContext)
Sets the caller context.
| ||||||||||
BUILDER |
setContentDescription(String contentDescription)
Sets the accessibility content description.
| ||||||||||
BUILDER |
setControllerListener(ControllerListener<? super INFO> controllerListener)
Sets the controller listener.
| ||||||||||
BUILDER |
setControllerViewportVisibilityListener(ControllerViewportVisibilityListener controllerViewportVisibilityListener)
Sets the controller viewport visibility listener.
| ||||||||||
BUILDER |
setDataSourceSupplier(Supplier<DataSource<IMAGE>> dataSourceSupplier)
Sets the data source supplier to be used.
| ||||||||||
BUILDER |
setFirstAvailableImageRequests(REQUEST[] firstAvailableImageRequests)
Sets the array of first-available image requests that will be probed in order.
| ||||||||||
BUILDER |
setFirstAvailableImageRequests(REQUEST[] firstAvailableImageRequests, boolean tryCacheOnlyFirst)
Sets the array of first-available image requests that will be probed in order.
| ||||||||||
BUILDER |
setImageRequest(REQUEST imageRequest)
Sets the image request.
| ||||||||||
BUILDER | setLoggingListener(LoggingListener loggingListener) | ||||||||||
BUILDER |
setLowResImageRequest(REQUEST lowResImageRequest)
Sets the low-res image request.
| ||||||||||
BUILDER |
setOldController(DraweeController oldController)
Sets the old controller to be reused if possible.
| ||||||||||
BUILDER |
setRetainImageOnFailure(boolean enabled)
Sets whether to display last available image in case of failure.
| ||||||||||
BUILDER |
setTapToRetryEnabled(boolean enabled)
Sets whether tap-to-retry is enabled.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractDraweeController |
buildController()
Builds a regular controller.
| ||||||||||
static String |
generateUniqueControllerId()
Generates unique controller id.
| ||||||||||
Context | getContext() | ||||||||||
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.
| ||||||||||
Supplier<DataSource<IMAGE>> |
getDataSourceSupplierForRequest(DraweeController controller, String controllerId, REQUEST imageRequest)
Creates a data source supplier for the given image request.
| ||||||||||
Supplier<DataSource<IMAGE>> |
getDataSourceSupplierForRequest(DraweeController controller, String controllerId, REQUEST imageRequest, AbstractDraweeControllerBuilder.CacheLevel cacheLevel)
Creates a data source supplier for the given image request.
| ||||||||||
Supplier<DataSource<IMAGE>> | getFirstAvailableDataSourceSupplier(DraweeController controller, String controllerId, REQUEST[] imageRequests, boolean tryBitmapCacheOnlyFirst) | ||||||||||
final BUILDER | getThis() | ||||||||||
void |
maybeAttachListeners(AbstractDraweeController controller)
Attaches listeners (if specified) to the given controller.
| ||||||||||
void |
maybeBuildAndSetGestureDetector(AbstractDraweeController controller)
Installs a gesture detector to the given controller.
| ||||||||||
void |
maybeBuildAndSetRetryManager(AbstractDraweeController controller)
Installs a retry manager (if specified) to the given controller.
| ||||||||||
abstract AbstractDraweeController |
obtainController()
Concrete builder classes should override this method to return a new controller.
| ||||||||||
Supplier<DataSource<IMAGE>> |
obtainDataSourceSupplier(DraweeController controller, String controllerId)
Gets the top-level data source supplier to be used by a controller.
| ||||||||||
void |
validate()
Validates the parameters before building a controller.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.facebook.drawee.interfaces.SimpleDraweeControllerBuilder
|
Gets whether to auto play animations.
Gets the caller context.
Gets the accessibility content description.
Gets the controller viewport visibility listener.
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.
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.
Gets the image request.
Gets the low-res image request.
Gets whether to retain image on failure.
Gets whether tap-to-retry is enabled.
Resets this builder to its initial values making it reusable.
Sets whether to auto play animations.
Sets the caller context.
Sets the accessibility content description.
Sets the controller listener.
Sets the controller viewport visibility listener.
Sets the data source supplier to be used.
Note: This is mutually exclusive with other image request setters.
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.
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.
tryCacheOnlyFirst | if set, bitmap cache only requests will be tried in order before the supplied requests. |
---|
Sets the image request.
Sets the low-res image request.
Sets the old controller to be reused if possible.
Sets whether to display last available image in case of failure.
Sets whether tap-to-retry is enabled.
Generates unique controller id.
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).
Creates a data source supplier for the given image request.
Creates a data source supplier for the given image request.
Attaches listeners (if specified) to the given controller.
Installs a gesture detector to the given controller.
Installs a retry manager (if specified) to the given controller.
Concrete builder classes should override this method to return a new controller.
Gets the top-level data source supplier to be used by a controller.
Validates the parameters before building a controller.