fermoya / SwiftUIPager

Native Pager in SwiftUI
MIT License
1.3k stars 172 forks source link

[FEAT] Support Right-to-Left scroll in Hebrew locale #280

Closed sdavidliu closed 2 years ago

sdavidliu commented 2 years ago

Is your feature request related to a problem? Please describe. After adding Hebrew to Supported Localization, I noticed that the scrolling will scroll in the opposite direction of where I am swiping. So if I try to swipe to the card on the left, it actually scrolls to the right. If I swipe to the card on the right, it scrolls to the left. It's nice that it correctly places the items with the first item at the very right. 2nd item to its left. etc. However, the dragging animation is flipped around and may be counter-intuitive for users.

Describe the solution you'd like Support scrolling in the correct direction for right-to-left locales.

Describe alternatives you've considered N/A

Additional context

Screen Shot 2022-05-18 at 11 42 21 AM
fermoya commented 2 years ago

should be done in 2.5.0-beta.1, do you mind giving me some feedback @sdavidliu please?

sdavidliu commented 2 years ago

Hi @fermoya , thanks for the quick turnaround! It is mainly working as expected; however, on some of my swipes (especially when I reach the end) it still scrolls to the opposite direction. Not sure if it's happening when I scroll fast enough, but it seems a bit random. I attached a video in Arabic locale:

2.5.0-beta.1-arabic.mov.zip