material-calendarview
material-calendarview copied to clipboard
Enhancement - RTL - Missing support for viewpager reverse sliding
I tried to use it in RTL layout but it's not supported and find these bugs :
-
arrows (left & right) must be auto mirrored and their functionality must reversed : right arrow go to previous month or week and left arrow go to next month or week
-
in RTL languages first day of week must be in right and second day must be in second column from right and so on
-
remove rotation Y by 180 that added in version 2.0.0-RC1
Hey, did you try the latest of https://github.com/prolificinteractive/material-calendarview/tree/feature/2.0?
All of those should be in there. I'm planning a RC2 with those changes later today or tomorrow. It would be nice to validate for me as I'm not a RTL reader.
I actually just released RC2 just now, if you want to test the RTL support there and confirm that everything is OK. I compared to the default calendar from android to expect similar thing. The only thing I didn't get to is the paging animation. The rest should be as expected.
Now it's perfect .. there is only one thing to edit to be completely support RTL view pager sliding is not as arrows for example right arrow go to next month but sliding right go to previous one
yep exactly! I think I'm happy about it for now, I would need to investigate more on how to make pager slide opposite direction. I'm surprised that the pager does not support RTL by default 🤔. Do you know how that would be implemented?
I usually use this library in my apps https://github.com/duolingo/rtl-viewpager
I would not rely on another library for ours for RTL support. I would rather find a more basic/native way of doing it. Probably something similar to how the default calendar is doing it.
I found a solution but I don't try it yet
setRotationY(180) for the view pager
and also (very important) setRotationY(180) to all fragment container which is child of ViewPager
I see, that sounds more like something I would recommend. Still not great so.
I strongly agree with you
And for now I suggest u to make arrows works in the same direction of view pager until find a root solution.. I found that my default calendar app has a fixed sliding and arrows direction in both RTL and LTR
I will try to find a solution before the release of 2.0.0. Stay tuned
Been using the setRotationY(180)
solution for ages, works just fine.
FYI, for now until this is properly fixed by this library I'm overwriting drawable-ldrtl-v17/mcv_action_next.xml
and mcv_action_previous.xml
to the LTR versions from the drawable
folder and calling findViewById(R.id.header).setLayoutDirection(View.LAYOUT_DIRECTION_LTR)
in order to fix the arrows.
Still not working well with me in version 2.0.1 Sometimes the direction is RTL and sometimes not while locale language is Arabic