Is there any way to force ViewPager2 RTL direction? I have set android:layoutDirection="rtl" to viewpager2 but because of android:supportsRtl="false" in manifest it is still LTR. How can i solve this?
Is there any way to force ViewPager2 RTL direction? I have set android:layoutDirection="rtl" to viewpager2 but because of android:supportsRtl="false" in manifest it is still LTR. How can i solve this?
I didn't find an official solution so I firt rotate viewpager with :
viewPager2.rotationY = (180).toFloat()
and overide onBindViewHolder() in FragmentStateAdapter like below :
override fun onBindViewHolder(
holder: FragmentViewHolder,
position: Int,
payloads: MutableList<Any>
) {
super.onBindViewHolder(holder, position, payloads)
holder.itemView.rotationY = 180.toFloat()
}
That's work for me