java.lang.Object | |
↳ | com.facebook.drawee.generic.GenericDraweeHierarchyBuilder |
Class to construct a GenericDraweeHierarchy
.
Drawables must not be reused by multiple hierarchies. Each hierarchy needs to have its own drawable instances. Since this builder does not do deep copies of the input parameters, it is the caller's responsibility to pass a different drawable instances for each hierarchy built. Likewise, hierarchies must not be reused by multiple views. Each view needs to have its own instance of a hierarchy. The caller is responsible for building a new hierarchy for each view.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_FADE_DURATION |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final ScalingUtils.ScaleType | DEFAULT_ACTUAL_IMAGE_SCALE_TYPE | ||||||||||
public static final ScalingUtils.ScaleType | DEFAULT_SCALE_TYPE |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GenericDraweeHierarchyBuilder(Resources resources) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GenericDraweeHierarchy |
build()
Builds the hierarchy.
| ||||||||||
ColorFilter |
getActualImageColorFilter()
Gets the color filter for the actual image.
| ||||||||||
PointF |
getActualImageFocusPoint()
Gets the focus point for the actual image.
| ||||||||||
ScalingUtils.ScaleType |
getActualImageScaleType()
Gets the scale type for the actual image.
| ||||||||||
Drawable |
getBackground()
Gets the background.
| ||||||||||
float |
getDesiredAspectRatio()
Gets the desired aspect ratio.
| ||||||||||
int |
getFadeDuration()
Gets the duration of the fade animation.
| ||||||||||
Drawable |
getFailureImage()
Gets the failure image.
| ||||||||||
ScalingUtils.ScaleType |
getFailureImageScaleType()
Gets the failure image scale type.
| ||||||||||
List<Drawable> |
getOverlays()
Gets the overlays.
| ||||||||||
Drawable |
getPlaceholderImage()
Gets the placeholder image.
| ||||||||||
ScalingUtils.ScaleType |
getPlaceholderImageScaleType()
Gets the placeholder image scale type.
| ||||||||||
Drawable |
getPressedStateOverlay()
Gets the overlay for pressed state.
| ||||||||||
Drawable |
getProgressBarImage()
Gets the progress bar image.
| ||||||||||
ScalingUtils.ScaleType |
getProgressBarImageScaleType()
Gets the progress bar image scale type.
| ||||||||||
Resources |
getResources()
Gets resources.
| ||||||||||
Drawable |
getRetryImage()
Gets the retry image.
| ||||||||||
ScalingUtils.ScaleType |
getRetryImageScaleType()
Gets the retry image scale type.
| ||||||||||
RoundingParams |
getRoundingParams()
Gets the rounding params.
| ||||||||||
static GenericDraweeHierarchyBuilder | newInstance(Resources resources) | ||||||||||
GenericDraweeHierarchyBuilder |
reset()
Resets this builder to its initial values making it reusable.
| ||||||||||
GenericDraweeHierarchyBuilder |
setActualImageColorFilter(ColorFilter colorFilter)
Sets the color filter for the actual image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setActualImageFocusPoint(PointF focusPoint)
Sets the focus point for the actual image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setActualImageScaleType(ScalingUtils.ScaleType actualImageScaleType)
Sets the scale type for the actual image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setBackground(Drawable background)
Sets a background.
| ||||||||||
GenericDraweeHierarchyBuilder |
setDesiredAspectRatio(float desiredAspectRatio)
Sets the desired aspect ratio.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFadeDuration(int fadeDuration)
Sets the duration of the fade animation.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFailureImage(Drawable failureDrawable, ScalingUtils.ScaleType failureImageScaleType)
Sets the failure image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFailureImage(Drawable failureDrawable)
Sets the failure image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFailureImage(int resourceId, ScalingUtils.ScaleType failureImageScaleType)
Sets the failure image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFailureImage(int resourceId)
Sets the failure image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setFailureImageScaleType(ScalingUtils.ScaleType failureImageScaleType)
Sets the failure image scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setOverlay(Drawable overlay)
Sets a single overlay.
| ||||||||||
GenericDraweeHierarchyBuilder |
setOverlays(List<Drawable> overlays)
Sets the overlays.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPlaceholderImage(int resourceId, ScalingUtils.ScaleType placeholderImageScaleType)
Sets the placeholder image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPlaceholderImage(Drawable placeholderDrawable, ScalingUtils.ScaleType placeholderImageScaleType)
Sets the placeholder image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPlaceholderImage(int resourceId)
Sets the placeholder image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPlaceholderImage(Drawable placeholderDrawable)
Sets the placeholder image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPlaceholderImageScaleType(ScalingUtils.ScaleType placeholderImageScaleType)
Sets the placeholder image scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setPressedStateOverlay(Drawable drawable)
Sets the overlay for pressed state.
| ||||||||||
GenericDraweeHierarchyBuilder |
setProgressBarImage(Drawable progressBarDrawable)
Sets the progress bar image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setProgressBarImage(int resourceId)
Sets the progress bar image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setProgressBarImage(int resourceId, ScalingUtils.ScaleType progressBarImageScaleType)
Sets the progress bar image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setProgressBarImage(Drawable progressBarDrawable, ScalingUtils.ScaleType progressBarImageScaleType)
Sets the progress bar image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setProgressBarImageScaleType(ScalingUtils.ScaleType progressBarImageScaleType)
Sets the progress bar image scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRetryImage(int resourceId, ScalingUtils.ScaleType retryImageScaleType)
Sets the retry image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRetryImage(int resourceId)
Sets the retry image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRetryImage(Drawable retryDrawable)
Sets the retry image.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRetryImage(Drawable retryDrawable, ScalingUtils.ScaleType retryImageScaleType)
Sets the retry image and its scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRetryImageScaleType(ScalingUtils.ScaleType retryImageScaleType)
Sets the retry image scale type.
| ||||||||||
GenericDraweeHierarchyBuilder |
setRoundingParams(RoundingParams roundingParams)
Sets the rounding params.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the color filter for the actual image.
Gets the focus point for the actual image.
Gets the background.
Gets the desired aspect ratio.
Gets the duration of the fade animation.
Gets the failure image.
Gets the overlays.
Gets the placeholder image.
Gets the placeholder image scale type.
Gets the overlay for pressed state.
Gets the progress bar image.
Gets the progress bar image scale type.
Gets resources.
Gets the retry image.
Resets this builder to its initial values making it reusable.
Sets the color filter for the actual image.
colorFilter | color filter to be set |
---|
Sets the focus point for the actual image.
If a focus point aware scale type is used (e.g. FOCUS_CROP), the focus point of the image will be attempted to be centered within a view. Each coordinate is a real number in [0, 1] range, in the coordinate system where top-left corner of the image corresponds to (0, 0) and the bottom-right corner corresponds to (1, 1).
focusPoint | focus point of the image |
---|
Sets the scale type for the actual image.
If not set, the default value CENTER_CROP will be used.
actualImageScaleType | scale type for the actual image |
---|
Sets a background.
background | background drawable |
---|
Sets the desired aspect ratio.
Note, the hierarchy itself cannot enforce the aspect ratio. This is merely a suggestion to the view if it supports it.
desiredAspectRatio | the desired aspect ratio |
---|
Sets the duration of the fade animation.
If not set, the default value of 300ms will be used.
fadeDuration | duration in milliseconds |
---|
Sets the failure image and its scale type.
failureDrawable | drawable to be used as failure image |
---|---|
failureImageScaleType | scale type for the failure image |
Sets the failure image.
failureDrawable | drawable to be used as failure image |
---|
Sets the failure image and its scale type.
resourceId | an identifier of an Android drawable or color resource |
---|---|
failureImageScaleType | scale type for the failure image |
Sets the failure image.
resourceId | an identifier of an Android drawable or color resource |
---|
Sets the failure image scale type.
If not set, the default value CENTER_INSIDE will be used.
failureImageScaleType | scale type for the failure image |
---|
Sets a single overlay.
overlay | overlay drawable |
---|
Sets the overlays.
Overlays are drawn in list order after the backgrounds and the rest of the hierarchy. The last overlay will be drawn at the top.
overlays | overlay drawables |
---|
Sets the placeholder image and its scale type.
resourceId | an identifier of an Android drawable or color resource |
---|---|
placeholderImageScaleType | scale type for the placeholder image |
Sets the placeholder image and its scale type.
placeholderDrawable | drawable to be used as placeholder image |
---|---|
placeholderImageScaleType | scale type for the placeholder image |
Sets the placeholder image.
resourceId | an identifier of an Android drawable or color resource |
---|
Sets the placeholder image.
placeholderDrawable | drawable to be used as placeholder image |
---|
Sets the placeholder image scale type.
If not set, the default value CENTER_INSIDE will be used.
placeholderImageScaleType | scale type for the placeholder image |
---|
Sets the overlay for pressed state.
drawable | for pressed state |
---|
Sets the progress bar image.
progressBarDrawable | drawable to be used as progress bar image |
---|
Sets the progress bar image.
resourceId | an identifier of an Android drawable or color resource |
---|
Sets the progress bar image and its scale type.
resourceId | an identifier of an Android drawable or color resource |
---|---|
progressBarImageScaleType | scale type for the progress bar image |
Sets the progress bar image and its scale type.
progressBarDrawable | drawable to be used as progress bar image |
---|---|
progressBarImageScaleType | scale type for the progress bar image |
Sets the progress bar image scale type.
If not set, the default value CENTER_INSIDE will be used.
progressBarImageScaleType | scale type for the progress bar image |
---|
Sets the retry image and its scale type.
resourceId | an identifier of an Android drawable or color resource |
---|---|
retryImageScaleType | scale type for the retry image |
Sets the retry image.
resourceId | an identifier of an Android drawable or color resource |
---|
Sets the retry image.
retryDrawable | drawable to be used as retry image |
---|
Sets the retry image and its scale type.
retryDrawable | drawable to be used as retry image |
---|---|
retryImageScaleType | scale type for the retry image |
Sets the retry image scale type.
If not set, the default value CENTER_INSIDE will be used.
retryImageScaleType | scale type for the retry image |
---|
Sets the rounding params.
roundingParams | rounding params to be set |
---|