1*fa44fe6aSInna Palant# Pager layouts 2*fa44fe6aSInna Palant 3*fa44fe6aSInna Palant[](https://search.maven.org/search?q=g:com.google.accompanist) 4*fa44fe6aSInna Palant 5*fa44fe6aSInna PalantA library which provides paging layouts for Jetpack Compose. If you've used Android's [`ViewPager`](https://developer.android.com/reference/kotlin/androidx/viewpager/widget/ViewPager) before, it has similar properties. 6*fa44fe6aSInna Palant 7*fa44fe6aSInna Palant!!! warning 8*fa44fe6aSInna Palant **This library is deprecated, with official pager support in [androidx.compose.foundation.pager](https://developer.android.com/reference/kotlin/androidx/compose/foundation/pager/package-summary).** The original documentation is below the migration guide. 9*fa44fe6aSInna Palant 10*fa44fe6aSInna Palant## Migration 11*fa44fe6aSInna Palant 12*fa44fe6aSInna Palant1. Make sure you are using Compose 1.4.0+ before attempting to migrate to `androidx.compose.foundation.pager`. 13*fa44fe6aSInna Palant2. Change `com.google.accompanist.pager.HorizontalPager` to `androidx.compose.foundation.pager.HorizontalPager`, and the same for `com.google.accompanist.pager.VerticalPager` to change to `androidx.compose.foundation.pager.VerticalPager` 14*fa44fe6aSInna Palant3. Change `count` variable to `pageCount`. 15*fa44fe6aSInna Palant4. Change `itemSpacing` parameter to `pageSpacing`. 16*fa44fe6aSInna Palant5. Change any usages of `rememberPagerState()` to `androidx.compose.foundation.pager.rememberPagerState()` 17*fa44fe6aSInna Palant6. For more mappings - see the migration table below. 18*fa44fe6aSInna Palant7. Run your changes on device and check to see if there are any differences. 19*fa44fe6aSInna Palant 20*fa44fe6aSInna PalantOne thing to note is that there is a new parameter on `androidx.compose.foundation.Pager`, for `pageSize`, by default this 21*fa44fe6aSInna Palantuses a `PageSize.Fill`, but can also be changed to use a fixed size, like `PageSize.Fixed(200.dp)` for a fixed size paging. 22*fa44fe6aSInna Palant 23*fa44fe6aSInna Palant 24*fa44fe6aSInna Palant## Migration Table 25*fa44fe6aSInna Palant 26*fa44fe6aSInna PalantThe following is a mapping of the pager classes from accompanist to androidx.compose: 27*fa44fe6aSInna Palant 28*fa44fe6aSInna Palant| accompanist/pager | androidx.compose.foundation | 29*fa44fe6aSInna Palant|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| 30*fa44fe6aSInna Palant| `HorizontalPager` | `androidx.compose.foundation.pager.HorizontalPager` | 31*fa44fe6aSInna Palant| `VerticalPager` | `androidx.compose.foundation.pager.VerticalPager` | 32*fa44fe6aSInna Palant| `rememberPagerState` | `androidx.compose.foundation.pager.rememberPagerState` | 33*fa44fe6aSInna Palant| `PagerState#pageCount` | Use `canScrollForward` or `canScrollBackward` | 34*fa44fe6aSInna Palant| `calculateCurrentOffsetForPage` | Use `(pagerState.currentPage - page) + pagerState.currentPageOffsetFraction` | 35*fa44fe6aSInna Palant| `PagerState#currentPageOffset` | `PagerState#currentPageOffsetFraction` | 36*fa44fe6aSInna Palant| `Modifier.pagerTabIndicatorOffset()` | Implement it yourself, or still include and use `accompanist-pager-indicators`, it now supports `androidx.compose.foundation.pager.PagerState` | 37*fa44fe6aSInna Palant| `HorizontalPagerIndicator` | Implement it yourself, or fork `accompanist-pager-indicators` implementation | 38*fa44fe6aSInna Palant| `VerticalPagerIndicator` | Implement it yourself, or fork `accompanist-pager-indicators` implementation | 39*fa44fe6aSInna Palant| `PagerDefaults.flingBehavior()` | `androidx.compose.foundation.pager.PagerDefaults.flingBehavior()` | 40*fa44fe6aSInna Palant 41*fa44fe6aSInna PalantThe biggest change is that `HorizontalPager` and `VerticalPager`'s number of pages is now called `pageCount` instead of `count`. 42*fa44fe6aSInna Palant 43*fa44fe6aSInna Palant# Deprecated Guidance for Accompanist Pager 44*fa44fe6aSInna PalantThe following is the deprecated guide for using Pager in Accompanist. Please see above migration section for how to use the `androidx.compose` Pager. 45*fa44fe6aSInna Palant 46*fa44fe6aSInna Palant## HorizontalPager 47*fa44fe6aSInna Palant 48*fa44fe6aSInna Palant[`HorizontalPager`][api-horizpager] is a layout which lays out items in a horizontal row, and allows the user to horizontally swipe between pages. 49*fa44fe6aSInna Palant 50*fa44fe6aSInna Palant<figure> 51*fa44fe6aSInna Palant <video width="300" controls loop> 52*fa44fe6aSInna Palant <source src="horiz_demo.mp4" type="video/mp4"> 53*fa44fe6aSInna Palant Your browser does not support the video tag. 54*fa44fe6aSInna Palant </video> 55*fa44fe6aSInna Palant <figcaption>HorizontalPager demo</figcaption> 56*fa44fe6aSInna Palant</figure> 57*fa44fe6aSInna Palant 58*fa44fe6aSInna PalantThe simplest usage looks like the following: 59*fa44fe6aSInna Palant 60*fa44fe6aSInna Palant``` kotlin 61*fa44fe6aSInna Palant// Display 10 items 62*fa44fe6aSInna PalantHorizontalPager(count = 10) { page -> 63*fa44fe6aSInna Palant // Our page content 64*fa44fe6aSInna Palant Text( 65*fa44fe6aSInna Palant text = "Page: $page", 66*fa44fe6aSInna Palant modifier = Modifier.fillMaxWidth() 67*fa44fe6aSInna Palant ) 68*fa44fe6aSInna Palant} 69*fa44fe6aSInna Palant``` 70*fa44fe6aSInna Palant 71*fa44fe6aSInna PalantIf you want to jump to a specific page, you either call call `pagerState.scrollToPage(index)` or `pagerState.animateScrollToPage(index)` method in a `CoroutineScope`. 72*fa44fe6aSInna Palant 73*fa44fe6aSInna Palant``` kotlin 74*fa44fe6aSInna Palantval pagerState = rememberPagerState() 75*fa44fe6aSInna Palant 76*fa44fe6aSInna PalantHorizontalPager(count = 10, state = pagerState) { page -> 77*fa44fe6aSInna Palant // ...page content 78*fa44fe6aSInna Palant} 79*fa44fe6aSInna Palant 80*fa44fe6aSInna Palant// Later, scroll to page 2 81*fa44fe6aSInna Palantscope.launch { 82*fa44fe6aSInna Palant pagerState.scrollToPage(2) 83*fa44fe6aSInna Palant} 84*fa44fe6aSInna Palant``` 85*fa44fe6aSInna Palant 86*fa44fe6aSInna Palant## VerticalPager 87*fa44fe6aSInna Palant 88*fa44fe6aSInna Palant[`VerticalPager`][api-vertpager] is very similar to [`HorizontalPager`][api-horizpager] but items are laid out vertically, and react to vertical swipes: 89*fa44fe6aSInna Palant 90*fa44fe6aSInna Palant<figure> 91*fa44fe6aSInna Palant <video width="300" controls loop> 92*fa44fe6aSInna Palant <source src="vert_demo.mp4" type="video/mp4"> 93*fa44fe6aSInna Palant Your browser does not support the video tag. 94*fa44fe6aSInna Palant </video> 95*fa44fe6aSInna Palant <figcaption>VerticalPager demo</figcaption> 96*fa44fe6aSInna Palant</figure> 97*fa44fe6aSInna Palant 98*fa44fe6aSInna Palant``` kotlin 99*fa44fe6aSInna Palant// Display 10 items 100*fa44fe6aSInna PalantVerticalPager(count = 10) { page -> 101*fa44fe6aSInna Palant // Our page content 102*fa44fe6aSInna Palant Text( 103*fa44fe6aSInna Palant text = "Page: $page", 104*fa44fe6aSInna Palant modifier = Modifier.fillMaxWidth() 105*fa44fe6aSInna Palant ) 106*fa44fe6aSInna Palant} 107*fa44fe6aSInna Palant``` 108*fa44fe6aSInna Palant 109*fa44fe6aSInna Palant## Lazy creation 110*fa44fe6aSInna Palant 111*fa44fe6aSInna PalantPages in both [`HorizontalPager`][api-horizpager] and [`VerticalPager`][api-vertpager] are lazily composed and laid-out as required by the layout. As the user scrolls through pages, any pages which are no longer required are removed from the content. 112*fa44fe6aSInna Palant 113*fa44fe6aSInna PalantUnder the covers, `HorizontalPager` use [`LazyRow`](https://developer.android.com/jetpack/compose/lists#lazy), and `VerticalPager` uses [`LazyColumn`](https://developer.android.com/jetpack/compose/lists#lazy). 114*fa44fe6aSInna Palant 115*fa44fe6aSInna Palant 116*fa44fe6aSInna Palant## Content Padding 117*fa44fe6aSInna Palant 118*fa44fe6aSInna Palant`HorizontalPager` and `VerticalPager` both support the setting of content padding, which allows you to influence the maximum size and alignment of pages. 119*fa44fe6aSInna Palant 120*fa44fe6aSInna PalantYou can see how different content padding values affect a `HorizontalPager` below: 121*fa44fe6aSInna Palant 122*fa44fe6aSInna Palant=== "start = 64.dp" 123*fa44fe6aSInna Palant 124*fa44fe6aSInna Palant Setting the start padding has the effect of aligning the pages towards the end. 125*fa44fe6aSInna Palant 126*fa44fe6aSInna Palant {: loading=lazy width=70% align=center } 127*fa44fe6aSInna Palant 128*fa44fe6aSInna Palant ``` kotlin 129*fa44fe6aSInna Palant HorizontalPager( 130*fa44fe6aSInna Palant count = 4, 131*fa44fe6aSInna Palant contentPadding = PaddingValues(start = 64.dp), 132*fa44fe6aSInna Palant ) { page -> 133*fa44fe6aSInna Palant // page content 134*fa44fe6aSInna Palant } 135*fa44fe6aSInna Palant ``` 136*fa44fe6aSInna Palant 137*fa44fe6aSInna Palant=== "horizontal = 32.dp" 138*fa44fe6aSInna Palant 139*fa44fe6aSInna Palant Setting both the start and end padding to the same value has the effect of centering the item horizontally. 140*fa44fe6aSInna Palant 141*fa44fe6aSInna Palant {: loading=lazy width=70% align=center } 142*fa44fe6aSInna Palant 143*fa44fe6aSInna Palant ``` kotlin 144*fa44fe6aSInna Palant HorizontalPager( 145*fa44fe6aSInna Palant count = 4, 146*fa44fe6aSInna Palant contentPadding = PaddingValues(horizontal = 32.dp), 147*fa44fe6aSInna Palant ) { page -> 148*fa44fe6aSInna Palant // page content 149*fa44fe6aSInna Palant } 150*fa44fe6aSInna Palant ``` 151*fa44fe6aSInna Palant 152*fa44fe6aSInna Palant=== "end = 64.dp" 153*fa44fe6aSInna Palant 154*fa44fe6aSInna Palant Setting the end padding has the effect of aligning the pages towards the start. 155*fa44fe6aSInna Palant 156*fa44fe6aSInna Palant {: loading=lazy width=70% align=center } 157*fa44fe6aSInna Palant 158*fa44fe6aSInna Palant ``` kotlin 159*fa44fe6aSInna Palant HorizontalPager( 160*fa44fe6aSInna Palant count = 4, 161*fa44fe6aSInna Palant contentPadding = PaddingValues(end = 64.dp), 162*fa44fe6aSInna Palant ) { page -> 163*fa44fe6aSInna Palant // page content 164*fa44fe6aSInna Palant } 165*fa44fe6aSInna Palant ``` 166*fa44fe6aSInna Palant 167*fa44fe6aSInna PalantSimilar effects for `VerticalPager` can be achieved by setting the `top` and `bottom` values. The value `32.dp` is only used 168*fa44fe6aSInna Palanthere as an example, you can set each of the padding dimensions to whatever value you wish. 169*fa44fe6aSInna Palant 170*fa44fe6aSInna Palant## Item scroll effects 171*fa44fe6aSInna Palant 172*fa44fe6aSInna PalantA common use-case is to apply effects to your pager items, using the scroll position to drive those effects. 173*fa44fe6aSInna Palant 174*fa44fe6aSInna PalantThe [HorizontalPagerTransitionSample](https://github.com/google/accompanist/blob/main/sample/src/main/java/com/google/accompanist/sample/pager/HorizontalPagerTransitionSample.kt) demonstrates how this can be done: 175*fa44fe6aSInna Palant 176*fa44fe6aSInna Palant<figure> 177*fa44fe6aSInna Palant <video width="300" controls loop> 178*fa44fe6aSInna Palant <source src="transition_demo.mp4" type="video/mp4"> 179*fa44fe6aSInna Palant Your browser does not support the video tag. 180*fa44fe6aSInna Palant </video> 181*fa44fe6aSInna Palant <figcaption>Item effects demo</figcaption> 182*fa44fe6aSInna Palant</figure> 183*fa44fe6aSInna Palant 184*fa44fe6aSInna Palant 185*fa44fe6aSInna PalantThe scope provided to your pager content allows apps to easily reference the [`currentPage`][currentpage-api] and [`currentPageOffset`][currentpageoffset-api]. The effects can then be calculated using those values. We provide the [`calculateCurrentOffsetForPage()`][calcoffsetpage] extension functions to support calculation of the 'offset' for a given page: 186*fa44fe6aSInna Palant 187*fa44fe6aSInna Palant``` kotlin 188*fa44fe6aSInna Palantimport com.google.accompanist.pager.calculateCurrentOffsetForPage 189*fa44fe6aSInna Palant 190*fa44fe6aSInna PalantHorizontalPager(count = 4) { page -> 191*fa44fe6aSInna Palant Card( 192*fa44fe6aSInna Palant Modifier 193*fa44fe6aSInna Palant .graphicsLayer { 194*fa44fe6aSInna Palant // Calculate the absolute offset for the current page from the 195*fa44fe6aSInna Palant // scroll position. We use the absolute value which allows us to mirror 196*fa44fe6aSInna Palant // any effects for both directions 197*fa44fe6aSInna Palant val pageOffset = calculateCurrentOffsetForPage(page).absoluteValue 198*fa44fe6aSInna Palant 199*fa44fe6aSInna Palant // We animate the scaleX + scaleY, between 85% and 100% 200*fa44fe6aSInna Palant lerp( 201*fa44fe6aSInna Palant start = 0.85f, 202*fa44fe6aSInna Palant stop = 1f, 203*fa44fe6aSInna Palant fraction = 1f - pageOffset.coerceIn(0f, 1f) 204*fa44fe6aSInna Palant ).also { scale -> 205*fa44fe6aSInna Palant scaleX = scale 206*fa44fe6aSInna Palant scaleY = scale 207*fa44fe6aSInna Palant } 208*fa44fe6aSInna Palant 209*fa44fe6aSInna Palant // We animate the alpha, between 50% and 100% 210*fa44fe6aSInna Palant alpha = lerp( 211*fa44fe6aSInna Palant start = 0.5f, 212*fa44fe6aSInna Palant stop = 1f, 213*fa44fe6aSInna Palant fraction = 1f - pageOffset.coerceIn(0f, 1f) 214*fa44fe6aSInna Palant ) 215*fa44fe6aSInna Palant } 216*fa44fe6aSInna Palant ) { 217*fa44fe6aSInna Palant // Card content 218*fa44fe6aSInna Palant } 219*fa44fe6aSInna Palant} 220*fa44fe6aSInna Palant``` 221*fa44fe6aSInna Palant 222*fa44fe6aSInna Palant## Reacting to page changes 223*fa44fe6aSInna Palant 224*fa44fe6aSInna PalantThe [`PagerState.currentPage`][currentpage-api] property is updated whenever the selected page changes. You can use the `snapshotFlow` function to observe changes in a flow: 225*fa44fe6aSInna Palant 226*fa44fe6aSInna Palant``` kotlin 227*fa44fe6aSInna Palantval pagerState = rememberPagerState() 228*fa44fe6aSInna Palant 229*fa44fe6aSInna PalantLaunchedEffect(pagerState) { 230*fa44fe6aSInna Palant // Collect from the pager state a snapshotFlow reading the currentPage 231*fa44fe6aSInna Palant snapshotFlow { pagerState.currentPage }.collect { page -> 232*fa44fe6aSInna Palant AnalyticsService.sendPageSelectedEvent(page) 233*fa44fe6aSInna Palant } 234*fa44fe6aSInna Palant} 235*fa44fe6aSInna Palant 236*fa44fe6aSInna PalantVerticalPager( 237*fa44fe6aSInna Palant count = 10, 238*fa44fe6aSInna Palant state = pagerState, 239*fa44fe6aSInna Palant) { page -> 240*fa44fe6aSInna Palant Text(text = "Page: $page") 241*fa44fe6aSInna Palant} 242*fa44fe6aSInna Palant``` 243*fa44fe6aSInna Palant 244*fa44fe6aSInna Palant## Indicators 245*fa44fe6aSInna Palant 246*fa44fe6aSInna PalantWe also publish a sibling library called `pager-indicators` which provides some simple indicator composables for use with [`HorizontalPager`][api-horizpager] and [`VerticalPager`][api-vertpager]. 247*fa44fe6aSInna Palant 248*fa44fe6aSInna Palant<figure> 249*fa44fe6aSInna Palant <video width="300" controls loop> 250*fa44fe6aSInna Palant <source src="indicators_demo.mp4" type="video/mp4"> 251*fa44fe6aSInna Palant Your browser does not support the video tag. 252*fa44fe6aSInna Palant </video> 253*fa44fe6aSInna Palant <figcaption>Pager indicators demo</figcaption> 254*fa44fe6aSInna Palant</figure> 255*fa44fe6aSInna Palant 256*fa44fe6aSInna PalantThe [HorizontalPagerWithIndicatorSample](https://github.com/google/accompanist/blob/main/sample/src/main/java/com/google/accompanist/sample/pager/HorizontalPagerWithIndicatorSample.kt) and [VerticalPagerWithIndicatorSample](https://github.com/google/accompanist/blob/snapshot/sample/src/main/java/com/google/accompanist/sample/pager/VerticalPagerWithIndicatorSample.kt) show you how to use these. 257*fa44fe6aSInna Palant 258*fa44fe6aSInna Palant 259*fa44fe6aSInna Palant### Integration with Tabs 260*fa44fe6aSInna Palant 261*fa44fe6aSInna PalantA common use-case for [`HorizontalPager`][api-horizpager] is to be used in conjunction with a [`TabRow`](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#tabrow) or [`ScrollableTabRow`](https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#scrollabletabrow). 262*fa44fe6aSInna Palant 263*fa44fe6aSInna Palant<figure> 264*fa44fe6aSInna Palant <video width="300" controls loop> 265*fa44fe6aSInna Palant <source src="tabs_demo.mp4" type="video/mp4"> 266*fa44fe6aSInna Palant Your browser does not support the video tag. 267*fa44fe6aSInna Palant </video> 268*fa44fe6aSInna Palant <figcaption>HorizontalPager + TabRow</figcaption> 269*fa44fe6aSInna Palant</figure> 270*fa44fe6aSInna Palant 271*fa44fe6aSInna Palant 272*fa44fe6aSInna PalantProvided in the `pager-indicators` library is a modifier which can be used on a tab indicator like so: 273*fa44fe6aSInna Palant 274*fa44fe6aSInna Palant``` kotlin 275*fa44fe6aSInna Palantval pagerState = rememberPagerState() 276*fa44fe6aSInna Palant 277*fa44fe6aSInna PalantTabRow( 278*fa44fe6aSInna Palant // Our selected tab is our current page 279*fa44fe6aSInna Palant selectedTabIndex = pagerState.currentPage, 280*fa44fe6aSInna Palant // Override the indicator, using the provided pagerTabIndicatorOffset modifier 281*fa44fe6aSInna Palant indicator = { tabPositions -> 282*fa44fe6aSInna Palant TabRowDefaults.Indicator( 283*fa44fe6aSInna Palant Modifier.pagerTabIndicatorOffset(pagerState, tabPositions) 284*fa44fe6aSInna Palant ) 285*fa44fe6aSInna Palant } 286*fa44fe6aSInna Palant) { 287*fa44fe6aSInna Palant // Add tabs for all of our pages 288*fa44fe6aSInna Palant pages.forEachIndexed { index, title -> 289*fa44fe6aSInna Palant Tab( 290*fa44fe6aSInna Palant text = { Text(title) }, 291*fa44fe6aSInna Palant selected = pagerState.currentPage == index, 292*fa44fe6aSInna Palant onClick = { /* TODO */ }, 293*fa44fe6aSInna Palant ) 294*fa44fe6aSInna Palant } 295*fa44fe6aSInna Palant} 296*fa44fe6aSInna Palant 297*fa44fe6aSInna PalantHorizontalPager( 298*fa44fe6aSInna Palant count = pages.size, 299*fa44fe6aSInna Palant state = pagerState, 300*fa44fe6aSInna Palant) { page -> 301*fa44fe6aSInna Palant // TODO: page content 302*fa44fe6aSInna Palant} 303*fa44fe6aSInna Palant``` 304*fa44fe6aSInna Palant 305*fa44fe6aSInna Palant## Changes in v0.19.0 306*fa44fe6aSInna Palant 307*fa44fe6aSInna PalantIn v0.19.0 both `HorizontalPager` and `VerticalPager` were re-written to be based on `LazyRow` and `LazyColumn` respectively. As part of this change, a number of feature and API changes were made: 308*fa44fe6aSInna Palant 309*fa44fe6aSInna Palant### PagerState 310*fa44fe6aSInna Palant 311*fa44fe6aSInna Palant- The `pageCount` parameter on `rememberPagerState()` has been removed, replaced with the `count` parameter on `HorizontalPager()` and `VerticalPager()`. 312*fa44fe6aSInna Palant- The `animationSpec`, `initialVelocity` and `skipPages` parameters on `animateScrollToPage()` have been removed. The lazy components handle this automatically. 313*fa44fe6aSInna Palant 314*fa44fe6aSInna Palant### HorizontalPager & VerticalPager 315*fa44fe6aSInna Palant 316*fa44fe6aSInna Palant- Ability to set `contentPadding` (see [above](#content-padding)). 317*fa44fe6aSInna Palant- Ability to specify a `key` for each page. 318*fa44fe6aSInna Palant- The `horizontalAlignment` parameter on `HorizontalPager`, and the `verticalAlignment` parameter on `VerticalPager` have been removed. A similar effect can be implemented with an appropriate content padding (see [above](#content-padding)). 319*fa44fe6aSInna Palant- The `infiniteLooping` parameter and feature have been removed. A sample demonstrating how to achieve this effect can be found [here][looping-sample]. 320*fa44fe6aSInna Palant- The `offscreenLimit` parameter has been removed. We no longer have control of what items are laid out 'off screen'. 321*fa44fe6aSInna Palant- The `dragEnabled` parameter has removed. 322*fa44fe6aSInna Palant- `PagerScope` (the page item scope) no longer implements `BoxScope`. 323*fa44fe6aSInna Palant 324*fa44fe6aSInna Palant--- 325*fa44fe6aSInna Palant 326*fa44fe6aSInna Palant## Usage 327*fa44fe6aSInna Palant 328*fa44fe6aSInna Palant``` groovy 329*fa44fe6aSInna Palantrepositories { 330*fa44fe6aSInna Palant mavenCentral() 331*fa44fe6aSInna Palant} 332*fa44fe6aSInna Palant 333*fa44fe6aSInna Palantdependencies { 334*fa44fe6aSInna Palant implementation "com.google.accompanist:accompanist-pager:<version>" 335*fa44fe6aSInna Palant 336*fa44fe6aSInna Palant // If using indicators, also depend on 337*fa44fe6aSInna Palant implementation "com.google.accompanist:accompanist-pager-indicators:<version>" 338*fa44fe6aSInna Palant} 339*fa44fe6aSInna Palant``` 340*fa44fe6aSInna Palant 341*fa44fe6aSInna Palant### Library Snapshots 342*fa44fe6aSInna Palant 343*fa44fe6aSInna PalantSnapshots of the current development version of this library are available, which track the latest commit. See [here](../using-snapshot-version) for more information on how to use them. 344*fa44fe6aSInna Palant 345*fa44fe6aSInna Palant--- 346*fa44fe6aSInna Palant 347*fa44fe6aSInna Palant## Contributions 348*fa44fe6aSInna Palant 349*fa44fe6aSInna PalantPlease contribute! We will gladly review any pull requests. 350*fa44fe6aSInna PalantMake sure to read the [Contributing](../contributing) page first though. 351*fa44fe6aSInna Palant 352*fa44fe6aSInna Palant## License 353*fa44fe6aSInna Palant 354*fa44fe6aSInna Palant``` 355*fa44fe6aSInna PalantCopyright 2021 The Android Open Source Project 356*fa44fe6aSInna Palant 357*fa44fe6aSInna PalantLicensed under the Apache License, Version 2.0 (the "License"); 358*fa44fe6aSInna Palantyou may not use this file except in compliance with the License. 359*fa44fe6aSInna PalantYou may obtain a copy of the License at 360*fa44fe6aSInna Palant 361*fa44fe6aSInna Palant https://www.apache.org/licenses/LICENSE-2.0 362*fa44fe6aSInna Palant 363*fa44fe6aSInna PalantUnless required by applicable law or agreed to in writing, software 364*fa44fe6aSInna Palantdistributed under the License is distributed on an "AS IS" BASIS, 365*fa44fe6aSInna PalantWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 366*fa44fe6aSInna PalantSee the License for the specific language governing permissions and 367*fa44fe6aSInna Palantlimitations under the License. 368*fa44fe6aSInna Palant``` 369*fa44fe6aSInna Palant 370*fa44fe6aSInna Palant [api-vertpager]: ../api/pager/pager/com.google.accompanist.pager/-vertical-pager.html 371*fa44fe6aSInna Palant [api-horizpager]: ../api/pager/pager/com.google.accompanist.pager/-horizontal-pager.html 372*fa44fe6aSInna Palant [currentpage-api]: ../api/pager/pager/com.google.accompanist.pager/-pager-state/current-page.html 373*fa44fe6aSInna Palant [currentpageoffset-api]: ../api/pager/pager/com.google.accompanist.pager/-pager-state/current-page-offset.html 374*fa44fe6aSInna Palant [calcoffsetpage]: ../api/pager/pager/com.google.accompanist.pager/calculate-current-offset-for-page.html 375*fa44fe6aSInna Palant [pagerstate-api]: ../api/pager/pager/com.google.accompanist.pager/remember-pager-state.html 376*fa44fe6aSInna Palant [looping-sample]: https://github.com/google/accompanist/blob/main/sample/src/main/java/com/google/accompanist/sample/pager/HorizontalPagerLoopingSample.kt 377