Package-level declarations

Types

Link copied to clipboard

Default layouts for ScalingLazyColumnState, based on UX guidance.

Link copied to clipboard
class ScalingLazyColumnState(val initialScrollPosition: ScalingLazyColumnState.ScrollPosition = ScrollPosition(1, 0), val autoCentering: AutoCenteringParams? = AutoCenteringParams( initialScrollPosition.index, initialScrollPosition.offsetPx, ), val anchorType: ScalingLazyListAnchorType = ScalingLazyListAnchorType.ItemCenter, val contentPadding: PaddingValues = PaddingValues(horizontal = 10.dp), val rotaryMode: ScalingLazyColumnState.RotaryMode? = RotaryMode.Scroll, val reverseLayout: Boolean = false, val verticalArrangement: Arrangement.Vertical = Arrangement.spacedBy( space = 4.dp, alignment = if (!reverseLayout) Alignment.Top else Alignment.Bottom, ), val horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally, val flingBehavior: FlingBehavior? = null, val userScrollEnabled: Boolean = true, val scalingParams: ScalingParams = WearScalingLazyColumnDefaults.scalingParams(), val hapticsEnabled: Boolean = true) : ScrollableState

A Config and State object wrapping up all configuration for a ScalingLazyColumn. This allows defaults such as ScalingLazyColumnDefaults.responsive.

Functions

Link copied to clipboard
fun AppScaffold(modifier: Modifier = Modifier, timeText: @Composable () -> Unit = { ResponsiveTimeText() }, content: @Composable BoxScope.() -> Unit)

An app scaffold, to be used to wrap a SwipeDismissableNavHost. The TimeText will be shown here, but can be customised in either ScreenScaffold or PagerScaffold.

Link copied to clipboard

A Modifier for adding padding for round devices for rectangular content.

Link copied to clipboard
fun PagerScaffold(modifier: Modifier = Modifier, timeText: @Composable () -> Unit? = null, pagerState: PagerState? = null, content: @Composable BoxScope.() -> Unit)

Pager Scaffold to place above a HorizontalPager. The TimeText if set will override the AppScaffold timeText.

Link copied to clipboard
fun rememberColumnState(factory: ScalingLazyColumnState.Factory = ScalingLazyColumnDefaults.responsive()): ScalingLazyColumnState
Link copied to clipboard
fun rememberResponsiveColumnState(contentPadding: @Composable () -> PaddingValues = ScalingLazyColumnDefaults.padding( first = ScalingLazyColumnDefaults.ItemType.Unspecified, last = ScalingLazyColumnDefaults.ItemType.Unspecified, ), verticalArrangement: Arrangement.Vertical = Arrangement.spacedBy( space = 4.dp, alignment = Alignment.Top, ), rotaryMode: ScalingLazyColumnState.RotaryMode? = RotaryMode.Scroll, hapticsEnabled: Boolean = true, reverseLayout: Boolean = false, userScrollEnabled: Boolean = true): ScalingLazyColumnState
Link copied to clipboard
fun ResponsiveTimeText(modifier: Modifier = Modifier, timeSource: TimeSource = TimeTextDefaults.timeSource(timeFormat()), timeTextStyle: TextStyle = TimeTextDefaults.timeTextStyle(), contentPadding: PaddingValues = responsivePaddingDefaults(), startLinearContent: @Composable () -> Unit? = null, startCurvedContent: CurvedScope.() -> Unit? = null, endLinearContent: @Composable () -> Unit? = null, endCurvedContent: CurvedScope.() -> Unit? = null, textLinearSeparator: @Composable () -> Unit = { TextSeparator(textStyle = timeTextStyle) }, textCurvedSeparator: CurvedScope.() -> Unit = { CurvedTextSeparator(curvedTextStyle = CurvedTextStyle(timeTextStyle)) })

Provides a TimeText component with a responsive padding of 2.1%.

Link copied to clipboard
fun ScalingLazyColumn(columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, content: ScalingLazyListScope.() -> Unit)
Link copied to clipboard
fun ScreenScaffold(modifier: Modifier = Modifier, timeText: @Composable () -> Unit? = null, scrollState: ScrollableState? = null, positionIndicator: @Composable () -> Unit? = null, content: @Composable BoxScope.() -> Unit)

Navigation Route (Screen) Scaffold to place inside androidx.wear.compose.navigation.composable. The TimeText if set will override the AppScaffold timeText.

Link copied to clipboard
fun Modifier.scrollAway(scalingLazyColumnState: ScalingLazyColumnState): Modifier

Scroll an item vertically in/out of view based on a ScalingLazyListState. Typically used to scroll a TimeText item out of view as the user starts to scroll a ScalingLazyColumn of items upwards and bring additional items into view.

fun Modifier.scrollAway(scrollableState: () -> ScrollableState?): Modifier

Scroll an item vertically in/out of view based on a ScrollState. Typically used to scroll a TimeText item out of view as the user starts to scroll a vertically scrollable Column of items upwards and bring additional items into view.