Package com.google.accompanist.pager

Types

ExperimentalPagerApi
Link copied to clipboard
annotation class ExperimentalPagerApi
PagerDefaults
Link copied to clipboard
object PagerDefaults
Contains the default values used by HorizontalPager and VerticalPager.
PagerScope
Link copied to clipboard
interface PagerScope
Scope for HorizontalPager content.
PagerState
Link copied to clipboard
class PagerState(@IntRange(from = 0.toLong()currentPage: Int) : ScrollableState
A state object that can be hoisted to control and observe scrolling for HorizontalPager.

Functions

calculateCurrentOffsetForPage
Link copied to clipboard
fun PagerScope.calculateCurrentOffsetForPage(page: Int): Float
Calculate the offset for the given page from the current scroll position.
HorizontalPager
Link copied to clipboard
fun HorizontalPager(count: Int, modifier: Modifier = Modifier, state: PagerState = rememberPagerState(), reverseLayout: Boolean = false, itemSpacing: Dp = 0.dp, flingBehavior: FlingBehavior = PagerDefaults.flingBehavior(state), verticalAlignment: Alignment.Vertical = Alignment.CenterVertically, key: (page: Int) -> Any? = null, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable() PagerScope.(page: Int) -> Unit)
A horizontally scrolling layout that allows users to flip between items to the left and right.
rememberPagerState
Link copied to clipboard
fun rememberPagerState(@IntRange(from = 0.toLong()initialPage: Int = 0): PagerState
Creates a PagerState that is remembered across compositions.
VerticalPager
Link copied to clipboard
fun VerticalPager(count: Int, modifier: Modifier = Modifier, state: PagerState = rememberPagerState(), reverseLayout: Boolean = false, itemSpacing: Dp = 0.dp, flingBehavior: FlingBehavior = PagerDefaults.flingBehavior(state), horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally, key: (page: Int) -> Any? = null, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable() PagerScope.(page: Int) -> Unit)
A vertically scrolling layout that allows users to flip between items to the top and bottom.