Interface

SceneCoreEntitySizeAdapter

The sizing strategy used by SceneCoreEntity to control and read the size of an entity.

SceneCoreEntitySizeAdapterSample

@Composable
@Sampled
fun SceneCoreEntitySizeAdapterSample() {
    val panelSizeAdapter =
        object : SceneCoreEntitySizeAdapter<PanelEntity> {
            override fun onLayoutSizeChanged(entity: PanelEntity, size: IntVolumeSize) {
                entity.sizeInPixels = IntSize2d(size.width, size.height)
            }

            override fun currentSize(entity: PanelEntity): IntVolumeSize {
                return IntVolumeSize(
                    width = entity.sizeInPixels.width,
                    height = entity.sizeInPixels.height,
                    depth = 0,
                )
            }
        }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: