Compose Unstyled 2.0 is out! Check the official announcement blog ->
Function

createCreationDisplayInfo

Creates a RemoteCreationDisplayInfo instance from the provided Context.

createCreationDisplayInfo

Source set: Android
public fun createCreationDisplayInfo(
    context: Context,
    size: Size =
        Size(
            width = context.resources.displayMetrics.widthPixels.toFloat(),
            height = context.resources.displayMetrics.heightPixels.toFloat(),
        ),
): RemoteCreationDisplayInfo

Creates a RemoteCreationDisplayInfo instance from the provided Context.

This function extracts the display metrics (width, height, and density) from the Context's resources.

Parameters

context The Context used to access display metrics.

Returns

A RemoteCreationDisplayInfo object containing the display metrics from the context.

Last updated: