Interface used to define custom rendering logic for Compose Previews in Android Studio.

Implementations of this interface allow developers to wrap the content of a Preview to provide specific environments, themes, or containers (such as a Remote Compose) without requiring repetitive code in every preview function.

Usage: Implementations are applied to previews using the PreviewWrapperProvider annotation.

Summary

Public functions

Unit
@Composable
Wrap(content: @Composable () -> Unit)

Wraps the provided content with custom UI logic or containers.

Cmn

Public functions

Wrap

@Composable
fun Wrap(content: @Composable () -> Unit): Unit

Wraps the provided content with custom UI logic or containers.

Example usage for applying a Theme:

@Composable
override
fun Wrap(content: @Composable () -> Unit) {
MyTheme {
content()
}
}
Parameters
content: @Composable () -> Unit

The original composable content of the function annotated with Preview.