You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We default UiConfiguration.viewInsets to Margin.zero when the host TreehouseUIView is not attached to the view hierarchy. When it is eventually attached, it takes a frame or two to render with the actual insets.
I’d like the ability for guest code to detect if these insets are invalid so it can choose to not render, rather than rendering with the incorrect value.
The text was updated successfully, but these errors were encountered:
/**
* Returns true if this model is attached to a view hierarchy in the host application.
*
* The safe area insets will be wrong until the view is attached, and we don't want to display
* the UI until we have correct values, otherwise it'll draw an ugly first frame.
*/
@Composable
private fun isAttachedToScreen(): Boolean =
(LocalUiConfiguration.current.viewportSize?.width?.value ?: 0.0) > 0.0
We default
UiConfiguration.viewInsets
toMargin.zero
when the hostTreehouseUIView
is not attached to the view hierarchy. When it is eventually attached, it takes a frame or two to render with the actual insets.I’d like the ability for guest code to detect if these insets are invalid so it can choose to not render, rather than rendering with the incorrect value.
The text was updated successfully, but these errors were encountered: