Composable Function

rememberRemoteCreationDisplayInfo

Creates and remembers a RemoteCreationDisplayInfo instance from display metrics.

rememberRemoteCreationDisplayInfo

Source set: Android
@Composable
public fun rememberRemoteCreationDisplayInfo(
    @IntRange(from = 1) width: Int = LocalResources.current.displayMetrics.widthPixels,
    @IntRange(from = 1) height: Int = LocalResources.current.displayMetrics.heightPixels,
    @IntRange(from = 1) densityDpi: Int = LocalConfiguration.current.densityDpi,
    fontScale: Float = LocalConfiguration.current.fontScale,
    isInspectionMode: Boolean = LocalInspectionMode.current,
    densityBehavior: RemoteDensityBehavior = RemoteDensityBehavior.Legacy,
): RemoteCreationDisplayInfo

Creates and remembers a RemoteCreationDisplayInfo instance from display metrics.

This function is used to capture the essential display properties required for remote rendering. By default, it uses the system's current display metrics.

Parameters

width The width of the display in pixels. Defaults to the system display width.
height The height of the display in pixels. Defaults to the system display height.
densityDpi The logical densityDpi of the display. Defaults to the system display density.
fontScale The user preference for the scaling factor for fonts, relative to the base density scaling.
isInspectionMode Whether the capture is happening in inspection mode (e.g. for a preview).
densityBehavior The RemoteDensityBehavior to use. Defaults to RemoteDensityBehavior.Legacy.

Return

A RemoteCreationDisplayInfo object containing the specified display metrics.

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: