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).
panel.resize(
1024,
768,
onResizeReady = PanelResizeReadinessHandler { rootView, onReady ->
myContent.awaitStableLayout { onReady.run() }
},
)
fun interface PanelResizeReadinessHandler
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: ViewonReady: Runnable |