-
- All Implemented Interfaces:
public final class AvatarA data transfer model for transferring image data to AvatarFetcher. This model will be fetched by AvatarFetcher when we request image loading by using this type to Coil.
The default supported data types are:
-
-
Field Summary
Fields Modifier and Type Field Description private final List<Object>dataprivate final IntegermaxSectionSizeprivate final IntegeravatarBorderWidthprivate final DrawableerrorPlaceholderprivate final Function2<ImageRequest, ImageResult.Metadata, Unit>onSuccessprivate final Function2<ImageRequest, Throwable, Unit>onError
-
Method Summary
Modifier and Type Method Description final List<Object>getData()A list of data to be requested. final IntegergetMaxSectionSize()The maximum size of the sections. final IntegergetAvatarBorderWidth()The border width of AvatarView. final DrawablegetErrorPlaceholder()An error placeholder that should be shown when request failed. final Function2<ImageRequest, ImageResult.Metadata, Unit>getOnSuccess()A lambda function will be executed when loading succeeds. final Function2<ImageRequest, Throwable, Unit>getOnError()A lambda function will be executed when loading failed. final <T extends Any> UnitsetTagIfAbsent(String key, T newValue)Sets a tag associated with this avatar and a key. final <T extends Any> TgetTag(String key)Returns the tag associated with this avatar using the given key. -
-
Method Detail
-
getMaxSectionSize
final Integer getMaxSectionSize()
The maximum size of the sections.
-
getAvatarBorderWidth
final Integer getAvatarBorderWidth()
The border width of AvatarView.
-
getErrorPlaceholder
final Drawable getErrorPlaceholder()
An error placeholder that should be shown when request failed.
-
getOnSuccess
final Function2<ImageRequest, ImageResult.Metadata, Unit> getOnSuccess()
A lambda function will be executed when loading succeeds.
-
getOnError
final Function2<ImageRequest, Throwable, Unit> getOnError()
A lambda function will be executed when loading failed.
-
setTagIfAbsent
final <T extends Any> Unit setTagIfAbsent(String key, T newValue)
Sets a tag associated with this avatar and a key. If the given newValue was already set for the given key, this calls do nothing, the given newValue would be ignored.
- Parameters:
key- A new key to set a tag associated with this avatar.newValue- A new value to be set on the bag.
-
-
-
-