Function

coerceIn

Ensures that this value lies in the specified range minimumValue..maximumValue.

coerceIn

Source set: Common
public inline fun Dp.coerceIn(minimumValue: Dp, maximumValue: Dp): Dp

Ensures that this value lies in the specified range minimumValue..maximumValue.

Return

this value if it's in the range, or minimumValue if this value is less than minimumValue, or maximumValue if this value is greater than maximumValue.

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: