API reference

PanelResizeReadinessHandler Interface

Hook that lets an app decide when a panel's resized content is ready to present, overriding the SDK's default readiness gate. Supply one to PanelSceneObject.resize when the default heuristic — wait for the root view to lay out at its new size, then a committed frame — doesn't suit your content (for example content that finishes laying out asynchronously).
The SDK calls PanelResizeReadinessHandler.awaitReady after it has resized the display and requested a relayout; call onReady once your content is laid out and ready, and the panel swaps to the new surface.
panel.resize(
    1024,
    768,
    onResizeReady = PanelResizeReadinessHandler { rootView, onReady ->
      myContent.awaitStableLayout { onReady.run() }
    },
)

Signature

fun interface PanelResizeReadinessHandler

Methods

awaitReady ( rootView , onReady )
Invoke PanelResizeReadinessHandler.awaitReady once the resized PanelResizeReadinessHandler.awaitReady's content is laid out and ready to present.
Signature
abstract fun awaitReady(rootView: View, onReady: Runnable)
Parameters
rootView: View
onReady: Runnable