AnimatedPage
Android
Component in Wear Material 3 Compose
Animates a page within a [Pager] with a scaling and scrim effect based on its position.
This composable applies a scaling animation and a scrim overlay to the page content, creating a visual cue for page transitions. The animation is responsive to the page's position within the [Pager] and adapts to the device's reduce motion settings and layout direction.
Last updated:
Installation
dependencies {
implementation("androidx.wear.compose:compose-material3:1.0.0-alpha34")
}
Overloads
@Composable
fun AnimatedPage(
page: Int,
pagerState: PagerState,
contentScrimColor: Color = MaterialTheme.colorScheme.background,
content: @Composable (() -> Unit)
)
Parameters
name | description |
---|---|
page | The index of the page being animated. |
pagerState | The [PagerState] of the [Pager]. |
contentScrimColor | The color of the scrim overlay applied during page transitions. Defaults to the background color of the [MaterialTheme]. Set this to transparent to have no scrim applied during page transitions. |
content | The composable content of the page. |