As shown in the picture above, I want to darken the previous & next items in the ViewPager2.
setPageTransformer(object : ViewPager2.PageTransformer {
override fun transformPage(page: View, position: Float) {
page.translationX = -pageTranslationX * position
page.scaleY = 1 - (0.15f * abs(position))
}
})
I'm showing the preview with the above snippet, but I couldn't find a way to darken it.
Is there a good solution?

