Last active
February 18, 2020 20:52
-
-
Save PatrykAndroid/f2fa9d1c57c47447ac8edc56098c784b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PageTransformer : ViewPager2.PageTransformer { | |
override fun transformPage(page: View, position: Float) { | |
val offset = position * -(2 * (page.width / 10)) | |
page.translationX = offset | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewPager2.orientation = ViewPager2.ORIENTATION_HORIZONTAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment