Android ViewPager2 Page Margin - setPageMargin with MarginPageTransformer (Kotlin)

June 18, 2019
val margin = 64.dpToPx(resources.displayMetrics)
viewPager.setPageTransformer(MarginPageTransformer(margin))

NOTE: Refer dpToPx.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.