ContentScale.Companion

object ContentScale.Companion


Companion object containing commonly used ContentScale implementations

Summary

Public properties

ContentScale

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or larger than the corresponding dimension of the destination.

ContentScale

Scale horizontal and vertically non-uniformly to fill the destination bounds.

ContentScale

Scale the source maintaining the aspect ratio so that the bounds match the destination height.

ContentScale

Scale the source maintaining the aspect ratio so that the bounds match the destination width.

ContentScale

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or less than the corresponding dimension of the destination

ContentScale

Scale the source to maintain the aspect ratio to be inside the destination bounds if the source is larger than the destination.

FixedScale

Do not apply any scaling to the source

Public properties

Crop

val CropContentScale

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or larger than the corresponding dimension of the destination.

This ContentScale implementation in combination with usage of Alignment.Center provides similar behavior to android.widget.ImageView.ScaleType.CENTER_CROP

FillBounds

val FillBoundsContentScale

Scale horizontal and vertically non-uniformly to fill the destination bounds.

FillHeight

val FillHeightContentScale

Scale the source maintaining the aspect ratio so that the bounds match the destination height. This can cover a larger area than the destination if the height is larger than the width.

FillWidth

val FillWidthContentScale

Scale the source maintaining the aspect ratio so that the bounds match the destination width. This can cover a larger area than the destination if the width is larger than the height.

Fit

val FitContentScale

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or less than the corresponding dimension of the destination

This ContentScale implementation in combination with usage of Alignment.Center provides similar behavior to android.widget.ImageView.ScaleType.FIT_CENTER

Inside

val InsideContentScale

Scale the source to maintain the aspect ratio to be inside the destination bounds if the source is larger than the destination. If the source is smaller than or equal to the destination in both dimensions, this behaves similarly to None. This will always be contained within the bounds of the destination.

This ContentScale implementation in combination with usage of Alignment.Center provides similar behavior to android.widget.ImageView.ScaleType.CENTER_INSIDE

None

val NoneFixedScale

Do not apply any scaling to the source