setRotationY(180) on recyclerview or viewpager creating scroll issue in Android 9(API 28)

后端 未结 4 523
你的背包
你的背包 2021-01-15 09:08

I am managing RTL contents by implementing setRotationY for recyclerview and viewpagers but it seems that it is creating scroll/swipe issues in only devices with API 28 othe

4条回答
  •  猫巷女王i
    2021-01-15 09:12

    I had this issue with ViewPager on API 28 because of ViewPager.setRotatingY(180) so that i can support RTL, I've tried replacing rotation with layoutDirection="locale", but it didn't work. I found a library for supporting RTL ViewPager here's a link https://github.com/duolingo/rtl-viewpager.

    Add it to dependencies and just make sure you add layoutDirection="locale" to the RtlViewPager

    
    

    Update

    ViewPager2 is locale friendly so it's automatically will change swipe direction according to the current device locale.

    Some helpful links on the implementation of ViewPager2:

    Android docs

    Sample

提交回复
热议问题