Object

OneHandedGestureDefaults

Source set: Android
public object OneHandedGestureDefaults

Properties

indicatorSize

Source set: Android
public val indicatorSize: OneHandedGestureIndicatorSize = OneHandedGestureIndicatorSize.Medium

The default size constraints for the gesture indicator icon.

ShowIndicatorDelayMillis

Source set: Android
public const val ShowIndicatorDelayMillis: Long = 1000L

The default delay, in milliseconds, before the gesture indicator is shown, i.e. before the onGestureAvailable callback is invoked.

ScrollFraction

Source set: Android
public const val ScrollFraction: Float = 0.5f

The default fraction of the viewport height that scrollDown scrolls by on each gesture.

indicatorTint

Source set: Android
public val indicatorTint: Color

The tint color used for the gesture animation.

scrollIndicatorTint

Source set: Android
public val scrollIndicatorTint: Color

The tint color used for the scroll gesture animation icons.

scrollIndicatorBackgroundColor

Source set: Android
public val scrollIndicatorBackgroundColor: Color

The background color used behind the scroll gesture animations.

pageIndicatorTint

Source set: Android
public val pageIndicatorTint: Color

The tint color used for the pager gesture animation icons.

pageIndicatorBackgroundColor

Source set: Android
public val pageIndicatorBackgroundColor: Color

The background color used behind the pager gesture animations.

Functions

scrollDown

Source set: Android
public suspend fun scrollDown(
        scrollState: TransformingLazyColumnState,
        @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) scrollFraction: Float,
        wrapAround: Boolean = true,
    )

A scroll implementation tailored for use with TransformingLazyColumnState.

This logic handles one-handed gesture by first attempting to scroll the list by scrollFraction of the viewport height. If the list cannot scroll further forward and wrapAround is enabled, it scrolls back to the start.

Sample demonstrating gesture handling with TransformingLazyColumnState and a custom scrollFraction:

Parameters

scrollState The scroll state associated with a transforming lazy column.
scrollFraction The fraction of the viewport height to scroll by on each gesture. Must be greater than 0 and at most 1.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollDown

Source set: Android
public suspend fun scrollDown(
        scrollState: TransformingLazyColumnState,
        wrapAround: Boolean = true,
    ): Unit

A scroll implementation tailored for use with TransformingLazyColumnState.

This logic handles one-handed gesture by first attempting to scroll the list by ScrollFraction of the viewport height, i.e. half of it. Use the overload with the scrollFraction parameter to customize this. If the list cannot scroll further forward and wrapAround is enabled, it scrolls back to the start.

Sample demonstrating gesture handling with TransformingLazyColumnState:

Parameters

scrollState The scroll state associated with a transforming lazy column.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollDown

Source set: Android
public suspend fun scrollDown(
        scrollState: ScalingLazyListState,
        @FloatRange(from = 0.0, to = 1.0, fromInclusive = false) scrollFraction: Float,
        wrapAround: Boolean = true,
    )

A scroll implementation tailored for use with ScalingLazyListState.

This logic handles one-handed gesture by first attempting to scroll the list by scrollFraction of the viewport height. If the list cannot scroll further forward and wrapAround is enabled, it scrolls back to the start.

Sample demonstrating gesture handling with ScalingLazyListState:

Parameters

scrollState The scroll state associated with a scaling lazy column.
scrollFraction The fraction of the viewport height to scroll by on each gesture. Must be greater than 0 and at most 1.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollDown

Source set: Android
public suspend fun scrollDown(
        scrollState: ScalingLazyListState,
        wrapAround: Boolean = true,
    ): Unit

A scroll implementation tailored for use with ScalingLazyListState.

This logic handles one-handed gesture by first attempting to scroll the list by ScrollFraction of the viewport height, i.e. half of it. Use the overload with the scrollFraction parameter to customize this. If the list cannot scroll further forward and wrapAround is enabled, it scrolls back to the start.

Sample demonstrating gesture handling with ScalingLazyListState:

Parameters

scrollState The scroll state associated with a scaling lazy column.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollDownToNextItem

Source set: Android
public suspend fun scrollDownToNextItem(
        scrollState: TransformingLazyColumnState,
        wrapAround: Boolean = true,
    )

A scroll implementation tailored for use with TransformingLazyColumnState.

This logic handles one-handed gesture by first attempting to scroll to the next item in the list (or scrolling through the current item if it exceeds the viewport size). If the list cannot scroll further forward, it scrolls back to the start.

Sample demonstrating gesture handling with TransformingLazyColumnState:

Parameters

scrollState The scroll state associated with a transforming lazy column.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollDownToNextItem

Source set: Android
public suspend fun scrollDownToNextItem(
        scrollState: ScalingLazyListState,
        wrapAround: Boolean = true,
    )

A scroll implementation tailored for use with ScalingLazyListState.

This logic handles one-handed gesture by first attempting to scroll to the next item in the list (or scrolling through the current item if it exceeds the viewport size). If the list cannot scroll further forward, it scrolls back to the start.

Sample demonstrating gesture handling with ScalingLazyListState:

Parameters

scrollState The scroll state associated with a scaling lazy column.
wrapAround Whether to automatically scroll back to the first item when reaching the end of the content.

scrollToNextPage

Source set: Android
public suspend fun scrollToNextPage(pagerState: PagerState, wrapAround: Boolean = true)

Automatically animates the pagerState to the next available page.

This function triggers a smooth scroll transition to the next page index. If the current page is the last page in the pager, the animation will wrap around to the first page (index 0).

Samples demonstrating gesture handling with horizontal and vertical pagers:

Parameters

pagerState The state of the pager to be animated.
wrapAround Determines whether the pager should wrap around to the first page (index 0) after reaching the last page.
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: