Skip to content

Instantly share code, notes, and snippets.

@PatrykAndroid
Created February 9, 2020 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrykAndroid/291802456bd80144e33296b1eb285833 to your computer and use it in GitHub Desktop.
Save PatrykAndroid/291802456bd80144e33296b1eb285833 to your computer and use it in GitHub Desktop.
class PageTransformer : ViewPager2.PageTransformer {
override fun transformPage(page: View, position: Float) {
val offset = position * -(2 * (page.width / 10))
page.translationX = offset
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment