Function

coerceAtMost

Ensures that this value is not greater than the specified maximumValue.

coerceAtMost

Source set: Common
public inline fun Dp.coerceAtMost(maximumValue: Dp): Dp

Ensures that this value is not greater than the specified maximumValue.

Return

this value if it's less than or equal to the maximumValue or the maximumValue otherwise.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: