Package-level declarations

Types

Link copied to clipboard
sealed interface Dimension

Represents either the width or height of a Size.

Link copied to clipboard

Represents the required precision for the size of an image in an image request.

Link copied to clipboard
enum Scale : Enum<Scale>

An ImageRequest's scale determines how the source image is scaled to fit into the Size returned by ImageRequest.sizeResolver.

Link copied to clipboard
class ScaleDrawable @JvmOverloads constructor(val child: Drawable, val scale: <Error class: unknown class> = Scale.FIT) : Drawable, Drawable.Callback, Animatable

A Drawable that centers and scales its child to fill its bounds.

Link copied to clipboard
data class Size(val width: Dimension, val height: Dimension)

Represents the target size of an image request.

Link copied to clipboard
fun interface SizeResolver

An interface for measuring the target size for an image request.

Link copied to clipboard
interface ViewSizeResolver<T : View>

A SizeResolver that measures the size of a View.

Properties

Link copied to clipboard

Return true if this size is equal to Size.ORIGINAL. Else, return false.

Functions

Link copied to clipboard

Create a Dimension.Pixels value with px number of pixels.

Link copied to clipboard
inline fun Dimension.pxOrElse(block: () -> Int): Int

If this is a Dimension.Pixels value, return its pixel value. Else, invoke and return the value from block.

Link copied to clipboard
fun Size(width: Dimension, height: Int): Size

Create a Size with a pixel value for height.

fun Size(width: Int, height: Dimension): Size

Create a Size with a pixel value for width.

fun Size(width: Int, height: Int): Size

Create a Size with pixel values for both width and height.

Link copied to clipboard

Create a SizeResolver with a fixed size.

Link copied to clipboard
fun <T : View> ViewSizeResolver(view: T, subtractPadding: Boolean = true): ViewSizeResolver<T>

Create a ViewSizeResolver using the default View measurement implementation.