Preview
Uses ScreenComposableFactory.Preview or ScreenViewFactory.Preview to draw the receiving Screen.
Note that this function can preview any kind of Screen, whether it's bound to UI code implemented via Compose or classic View code.
Use inside @Preview
Composable functions:
@Preview(heightDp = 150, showBackground = true)
@Composable
fun HelloPreview() {
HelloScreen(
"Hello!",
onClick = {}
).Preview()
}
Draws this ScreenComposableFactory using a special preview ScreenComposableFactoryFinder.
Use inside @Preview
Composable functions:
@Preview(heightDp = 150, showBackground = true)
@Composable
fun DrawHelloRenderingPreview() {
HelloBinding.Preview(HelloScreen("Hello!", onClick = {}))
}
Note: rendering must be the same type as this ScreenComposableFactory, even though the type system does not enforce this constraint. This is due to a Compose compiler bug tracked here.
Parameters
Modifier that will be applied to this ScreenComposableFactory.
Modifier that will be applied to any nested renderings this factory shows.
Function that configures the ViewEnvironment passed to this factory.
Like ScreenComposableFactory.Preview, but for non-Compose ScreenViewFactory instances. Yes, you can preview classic View code this way.
Use inside @Preview
Composable functions.
Note: rendering must be the same type as this ScreenViewFactory, even though the type system does not enforce this constraint. This is due to a Compose compiler bug tracked here.
Parameters
Modifier that will be applied to this ScreenViewFactory.
Modifier that will be applied to any nested renderings this factory shows.
Function that configures the ViewEnvironment passed to this factory.