abstract class PagerState : PagerState


The state that can be used to control Wear Pagers.

This class extends the Compose Foundation's PagerState to provide specialized behavior tailored for Wear OS devices. This allows for future customizations and enhancements specific to Wear OS use cases.

Summary

Public constructors

PagerState(
    currentPage: @IntRange(from = 0) Int,
    currentPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float
)

Inherited functions

From androidx.compose.foundation.pager.PagerState
suspend Unit
animateScrollToPage(
    page: Int,
    pageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float,
    animationSpec: AnimationSpec<Float>
)
open Float
Float
Unit
requestScrollToPage(
    page: @IntRange(from = 0) Int,
    pageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float
)
open suspend Unit
scroll(scrollPriority: MutatePriority, block: suspend ScrollScope.() -> Unit)
suspend Unit
scrollToPage(
    page: Int,
    pageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float
)
Unit
@ExperimentalFoundationApi
ScrollScope.updateCurrentPage(
    page: Int,
    pageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float
)
Unit

Public constructors

PagerState

Added in 1.5.0-alpha03
PagerState(
    currentPage: @IntRange(from = 0) Int = 0,
    currentPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float = 0.0f
)
Parameters
currentPage: @IntRange(from = 0) Int = 0

The index of the currently active page.

currentPageOffsetFraction: @FloatRange(from = -0.5, to = 0.5) Float = 0.0f

The fractional offset from the start of the current page. Should be between -0.5 and 0.5, where 0 indicates the start of the current page.