Function

toAndroidRect

Creates a new instance of android.graphics.Rect with the same bounds specified in the given Rect

toAndroidRect

Source set: Android
@Deprecated(
    "Converting Rect to android.graphics.Rect is lossy, and requires rounding. The " +
        "behavior of toAndroidRect() truncates to an integral Rect, but you should choose the " +
        "method of rounding most suitable for your use case.",
    replaceWith =
        ReplaceWith(
            "android.graphics.Rect(left.toInt(), top.toInt(), right.toInt(), bottom.toInt())"
        ),
)
public fun Rect.toAndroidRect(): android.graphics.Rect

Creates a new instance of android.graphics.Rect with the same bounds specified in the given Rect

toAndroidRect

Source set: Android
public fun IntRect.toAndroidRect(): android.graphics.Rect

Creates a new instance of android.graphics.Rect with the same bounds specified in the given IntRect

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: