Back to Fresco

GenericDraweeHierarchyBuilder

docs/javadoc/reference/com/facebook/drawee/generic/GenericDraweeHierarchyBuilder.html

3.6.042.6 KB
Original Source

Fresco

|

|

Packages | Classes

Classes

Enums

Packages | Classes

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

public class

GenericDraweeHierarchyBuilder

extends Object

| java.lang.Object | | ↳ | com.facebook.drawee.generic.GenericDraweeHierarchyBuilder |

Class Overview

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.

Summary

Constants
int
Fields
public static final ScalingUtils.ScaleType
public static final ScalingUtils.ScaleType
Public Constructors
Public Methods
GenericDraweeHierarchy
Builds the hierarchy.
ColorFilter
Gets the color filter for the actual image.
PointF
Gets the focus point for the actual image.
ScalingUtils.ScaleType
Gets the scale type for the actual image.
Drawable
Gets the background.
float
Gets the desired aspect ratio.
int
Gets the duration of the fade animation.
Drawable
Gets the failure image.
ScalingUtils.ScaleType
Gets the failure image scale type.
List<Drawable>
Gets the overlays.
Drawable
Gets the placeholder image.
ScalingUtils.ScaleType
Gets the placeholder image scale type.
Drawable
Gets the overlay for pressed state.
Drawable
Gets the progress bar image.
ScalingUtils.ScaleType
Gets the progress bar image scale type.
Resources
Gets resources.
Drawable
Gets the retry image.
ScalingUtils.ScaleType
Gets the retry image scale type.
RoundingParams
Gets the rounding params.
static GenericDraweeHierarchyBuilder
GenericDraweeHierarchyBuilder
Resets this builder to its initial values making it reusable.
GenericDraweeHierarchyBuilder
Sets the color filter for the actual image.
GenericDraweeHierarchyBuilder
Sets the focus point for the actual image.
GenericDraweeHierarchyBuilder
Sets the scale type for the actual image.
GenericDraweeHierarchyBuilder
Sets a background.
GenericDraweeHierarchyBuilder
Sets the desired aspect ratio.
GenericDraweeHierarchyBuilder
Sets the duration of the fade animation.
GenericDraweeHierarchyBuilder
Sets the failure image and its scale type.
GenericDraweeHierarchyBuilder
Sets the failure image.
GenericDraweeHierarchyBuilder
Sets the failure image and its scale type.
GenericDraweeHierarchyBuilder
Sets the failure image.
GenericDraweeHierarchyBuilder
Sets the failure image scale type.
GenericDraweeHierarchyBuilder
Sets a single overlay.
GenericDraweeHierarchyBuilder
Sets the overlays.
GenericDraweeHierarchyBuilder
Sets the placeholder image and its scale type.
GenericDraweeHierarchyBuilder
Sets the placeholder image and its scale type.
GenericDraweeHierarchyBuilder
Sets the placeholder image.
GenericDraweeHierarchyBuilder
Sets the placeholder image.
GenericDraweeHierarchyBuilder
Sets the placeholder image scale type.
GenericDraweeHierarchyBuilder
Sets the overlay for pressed state.
GenericDraweeHierarchyBuilder
Sets the progress bar image.
GenericDraweeHierarchyBuilder
Sets the progress bar image.
GenericDraweeHierarchyBuilder
Sets the progress bar image and its scale type.
GenericDraweeHierarchyBuilder
Sets the progress bar image and its scale type.
GenericDraweeHierarchyBuilder
Sets the progress bar image scale type.
GenericDraweeHierarchyBuilder
Sets the retry image and its scale type.
GenericDraweeHierarchyBuilder
Sets the retry image.
GenericDraweeHierarchyBuilder
Sets the retry image.
GenericDraweeHierarchyBuilder
Sets the retry image and its scale type.
GenericDraweeHierarchyBuilder
Sets the retry image scale type.
GenericDraweeHierarchyBuilder
Sets the rounding params.

| [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() |

|

Constants

public static final int DEFAULT_FADE_DURATION

Constant Value: 300 (0x0000012c)

Fields

public static final ScalingUtils.ScaleType DEFAULT_ACTUAL_IMAGE_SCALE_TYPE

public static final ScalingUtils.ScaleType DEFAULT_SCALE_TYPE

Public Constructors

public GenericDraweeHierarchyBuilder(Resources resources)

Public Methods

public GenericDraweeHierarchy build()

Builds the hierarchy.

public ColorFilter getActualImageColorFilter()

Gets the color filter for the actual image.

public PointF getActualImageFocusPoint()

Gets the focus point for the actual image.

public ScalingUtils.ScaleType getActualImageScaleType()

Gets the scale type for the actual image.

public Drawable getBackground()

Gets the background.

public float getDesiredAspectRatio()

Gets the desired aspect ratio.

public int getFadeDuration()

Gets the duration of the fade animation.

public Drawable getFailureImage()

Gets the failure image.

public ScalingUtils.ScaleType getFailureImageScaleType()

Gets the failure image scale type.

public List<Drawable> getOverlays()

Gets the overlays.

public Drawable getPlaceholderImage()

Gets the placeholder image.

public ScalingUtils.ScaleType getPlaceholderImageScaleType()

Gets the placeholder image scale type.

public Drawable getPressedStateOverlay()

Gets the overlay for pressed state.

public Drawable getProgressBarImage()

Gets the progress bar image.

public ScalingUtils.ScaleType getProgressBarImageScaleType()

Gets the progress bar image scale type.

public Resources getResources()

Gets resources.

Returns
  • resources

public Drawable getRetryImage()

Gets the retry image.

public ScalingUtils.ScaleType getRetryImageScaleType()

Gets the retry image scale type.

public RoundingParams getRoundingParams()

Gets the rounding params.

public static GenericDraweeHierarchyBuilder newInstance(Resources resources)

public GenericDraweeHierarchyBuilder reset()

Resets this builder to its initial values making it reusable.

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setActualImageColorFilter(ColorFilter colorFilter)

Sets the color filter for the actual image.

Parameters

| colorFilter | color filter to be set |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setActualImageFocusPoint(PointF focusPoint)

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).

Parameters

| focusPoint | focus point of the image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setActualImageScaleType(ScalingUtils.ScaleType actualImageScaleType)

Sets the scale type for the actual image.

If not set, the default value CENTER_CROP will be used.

Parameters

| actualImageScaleType | scale type for the actual image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setBackground(Drawable background)

Sets a background.

Parameters

| background | background drawable |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setDesiredAspectRatio(float desiredAspectRatio)

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.

Parameters

| desiredAspectRatio | the desired aspect ratio |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFadeDuration(int fadeDuration)

Sets the duration of the fade animation.

If not set, the default value of 300ms will be used.

Parameters

| fadeDuration | duration in milliseconds |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFailureImage(Drawable failureDrawable, ScalingUtils.ScaleType failureImageScaleType)

Sets the failure image and its scale type.

Parameters

| failureDrawable | drawable to be used as failure image | | failureImageScaleType | scale type for the failure image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFailureImage(Drawable failureDrawable)

Sets the failure image.

Parameters

| failureDrawable | drawable to be used as failure image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFailureImage(int resourceId, ScalingUtils.ScaleType failureImageScaleType)

Sets the failure image and its scale type.

Parameters

| resourceId | an identifier of an Android drawable or color resource | | failureImageScaleType | scale type for the failure image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFailureImage(int resourceId)

Sets the failure image.

Parameters

| resourceId | an identifier of an Android drawable or color resource |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setFailureImageScaleType(ScalingUtils.ScaleType failureImageScaleType)

Sets the failure image scale type.

If not set, the default value CENTER_INSIDE will be used.

Parameters

| failureImageScaleType | scale type for the failure image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setOverlay(Drawable overlay)

Sets a single overlay.

Parameters

| overlay | overlay drawable |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setOverlays(List<Drawable> overlays)

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.

Parameters

| overlays | overlay drawables |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPlaceholderImage(int resourceId, ScalingUtils.ScaleType placeholderImageScaleType)

Sets the placeholder image and its scale type.

Parameters

| resourceId | an identifier of an Android drawable or color resource | | placeholderImageScaleType | scale type for the placeholder image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPlaceholderImage(Drawable placeholderDrawable, ScalingUtils.ScaleType placeholderImageScaleType)

Sets the placeholder image and its scale type.

Parameters

| placeholderDrawable | drawable to be used as placeholder image | | placeholderImageScaleType | scale type for the placeholder image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPlaceholderImage(int resourceId)

Sets the placeholder image.

Parameters

| resourceId | an identifier of an Android drawable or color resource |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPlaceholderImage(Drawable placeholderDrawable)

Sets the placeholder image.

Parameters

| placeholderDrawable | drawable to be used as placeholder image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPlaceholderImageScaleType(ScalingUtils.ScaleType placeholderImageScaleType)

Sets the placeholder image scale type.

If not set, the default value CENTER_INSIDE will be used.

Parameters

| placeholderImageScaleType | scale type for the placeholder image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setPressedStateOverlay(Drawable drawable)

Sets the overlay for pressed state.

Parameters

| drawable | for pressed state |

public GenericDraweeHierarchyBuilder setProgressBarImage(Drawable progressBarDrawable)

Sets the progress bar image.

Parameters

| progressBarDrawable | drawable to be used as progress bar image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setProgressBarImage(int resourceId)

Sets the progress bar image.

Parameters

| resourceId | an identifier of an Android drawable or color resource |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setProgressBarImage(int resourceId, ScalingUtils.ScaleType progressBarImageScaleType)

Sets the progress bar image and its scale type.

Parameters

| resourceId | an identifier of an Android drawable or color resource | | progressBarImageScaleType | scale type for the progress bar image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setProgressBarImage(Drawable progressBarDrawable, ScalingUtils.ScaleType progressBarImageScaleType)

Sets the progress bar image and its scale type.

Parameters

| progressBarDrawable | drawable to be used as progress bar image | | progressBarImageScaleType | scale type for the progress bar image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setProgressBarImageScaleType(ScalingUtils.ScaleType progressBarImageScaleType)

Sets the progress bar image scale type.

If not set, the default value CENTER_INSIDE will be used.

Parameters

| progressBarImageScaleType | scale type for the progress bar image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRetryImage(int resourceId, ScalingUtils.ScaleType retryImageScaleType)

Sets the retry image and its scale type.

Parameters

| resourceId | an identifier of an Android drawable or color resource | | retryImageScaleType | scale type for the retry image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRetryImage(int resourceId)

Sets the retry image.

Parameters

| resourceId | an identifier of an Android drawable or color resource |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRetryImage(Drawable retryDrawable)

Sets the retry image.

Parameters

| retryDrawable | drawable to be used as retry image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRetryImage(Drawable retryDrawable, ScalingUtils.ScaleType retryImageScaleType)

Sets the retry image and its scale type.

Parameters

| retryDrawable | drawable to be used as retry image | | retryImageScaleType | scale type for the retry image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRetryImageScaleType(ScalingUtils.ScaleType retryImageScaleType)

Sets the retry image scale type.

If not set, the default value CENTER_INSIDE will be used.

Parameters

| retryImageScaleType | scale type for the retry image |

Returns
  • modified instance of this builder

public GenericDraweeHierarchyBuilder setRoundingParams(RoundingParams roundingParams)

Sets the rounding params.

Parameters

| roundingParams | rounding params to be set |

Returns
  • modified instance of this builder

+Generated by Doclava. +