Build apps faster with our new App builder! Check it out →

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

namedescription
pageThe index of the page being animated.
pagerStateThe [PagerState] of the [Pager].
contentScrimColorThe 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.
contentThe composable content of the page.
by @alexstyl