kizitonwose / Calendar

A highly customizable calendar view and compose library for Android and Kotlin Multiplatform.
MIT License
4.67k stars 505 forks source link

WeekCaledar RTL swiping problems #466

Closed AttentiMobile closed 9 months ago

AttentiMobile commented 1 year ago

Library information:

Describe the bug

WeekCalendarView RTL swiping problems: the current week return to staring week instead of moving to next/previous one.

To Reproduce

Steps to reproduce the behavior: Change the device to RTL language, like: Hebrew Open the first example, change to week mode, try to swipe the week day

This is working well in compose sample

mohakapt commented 1 year ago

I can confirm that the CalendarPageSnapHelper does not behave as expected in RTL layouts. Even in LTR layouts, where it works, the scroll snapping feels a bit off. There is something different about it compared to the natural scroll snapping on (for example) a ViewPager.

kizitonwose commented 10 months ago

In version 2.2.0, I made major changes to the snap helper, can you see if your issue happens in version 2.1.1?

aMittelmanMonkey commented 10 months ago

i manage to overcome this issue by simply adding

android:layoutDirection="ltr"

to the WeekCalendarView

kizitonwose commented 9 months ago

I reverted the SnapHelper in 2.4.1, this should fix this RTL issue and the issue mentioned by @mohakapt above.