Package coil.size

Types

Dimension
Link copied to clipboard
sealed class Dimension
Represents either the width or height of a Size.
Precision
Link copied to clipboard
enum Precision : Enum<Precision>
Represents the required precision for the size of an image in an image request.
Scale
Link copied to clipboard
enum Scale : Enum<Scale>
Represents a scaling policy.
Size
Link copied to clipboard
data class Size(width: Dimension, height: Dimension)
Represents the target size of an image request.
SizeResolver
Link copied to clipboard
fun fun interface SizeResolver
An interface for measuring the target size for an image request.
ViewSizeResolver
Link copied to clipboard
interface ViewSizeResolver<T : View> : SizeResolver
A SizeResolver that measures the size of a View.

Functions

Dimension
Link copied to clipboard
fun Dimension(@Px() px: Int): Dimension.Pixels
Create a Dimension.Pixels value with px number of pixels.
pxOrElse
Link copied to clipboard
inline fun Dimension.pxOrElse(block: () -> Int): Int
If this is a Dimension.Pixels value, return its pixel value.
Size
Link copied to clipboard
fun Size(width: Dimension, @Px() height: Int): Size
Create a Size with a pixel value for height.
fun Size(@Px() width: Int, height: Dimension): Size
Create a Size with a pixel value for width.
fun Size(@Px() width: Int, @Px() height: Int): Size
Create a Size with pixel values for both width and height.
SizeResolver
Link copied to clipboard
@JvmName(name = create)
fun SizeResolver(size: Size): SizeResolver
Create a SizeResolver with a fixed size.
ViewSizeResolver
Link copied to clipboard
@JvmName(name = create)
fun <T : View> ViewSizeResolver(view: T, subtractPadding: Boolean = true): ViewSizeResolver<T>
Create a ViewSizeResolver using the default View measurement implementation.

Properties

isOriginal
Link copied to clipboard
val Size.isOriginal: Boolean
Return true if this size is equal to Size.ORIGINAL.