Package com.tomtom.tools.android.api.resourceresolution.drawable

Types

Link copied to clipboard
data class AttrDrawableResolver(@AttrRes attrId: Int) : DrawableResolver

A DrawableResolver that resolves a Drawable from a theme based on attrId.

Link copied to clipboard
data class BitmapDrawableResolver(bitmap: Bitmap) : DrawableResolver

A DrawableResolver that creates a Drawable from a Bitmap and target density based on the display metrics of the Context.

Link copied to clipboard
data class ColorArrayAttrGradientDrawableResolver(@AttrRes gradientColorArrayAttrId: Int, orientation: GradientDrawable.Orientation) : DrawableResolver

A DrawableResolver that retrieves a color array from a theme using gradientColorArrayAttrId and creates a GradientDrawable from it. The gradient will have a linear shape with the given orientation.

Link copied to clipboard
interface DrawableResolver : Parcelable

An interface for classes that resolve a Drawable based on a Context. This is useful to separate business logic from presentation, where a service or ViewModel can refer to a resource or other types of data that depend on the Locale or display without needing a Context to resolve its value.

Link copied to clipboard
data class IconDrawableResolver(icon: Icon) : DrawableResolver

A DrawableResolver that retrieves a Drawable from an Icon.

Link copied to clipboard
data class LayerDrawableResolver(layers: List<DrawableResolver>) : DrawableResolver

A DrawableResolver that creates a Drawable from a list of DrawableResolvers by layering them.

Link copied to clipboard
data class ResourceDrawableResolver(@DrawableRes resourceId: Int) : DrawableResolver

A DrawableResolver that resolves a Drawable from a Context.