{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ContentScale

public interface ContentScale

Known direct subclasses
FixedScale

ContentScale implementation that always scales the dimension by the provided fixed floating point value


Represents a rule to apply to scale a source rectangle to be inscribed into a destination

Summary

Nested types

public static class ContentScale.Companion

Companion object containing commonly used ContentScale implementations

Public methods

abstract @NonNull ScaleFactor
computeScaleFactor(@NonNull Size srcSize, @NonNull Size dstSize)

Computes the scale factor to apply to the horizontal and vertical axes independently of one another to fit the source appropriately with the given destination

Public methods

computeScaleFactor

abstract @NonNull ScaleFactor computeScaleFactor(@NonNull Size srcSize, @NonNull Size dstSize)

Computes the scale factor to apply to the horizontal and vertical axes independently of one another to fit the source appropriately with the given destination