material-calendarview icon indicating copy to clipboard operation
material-calendarview copied to clipboard

Enhancement - RTL - Missing support for viewpager reverse sliding

Open IslamKhSh opened this issue 6 years ago • 12 comments

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

IslamKhSh avatar Aug 15 '18 12:08 IslamKhSh

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.

quentin41500 avatar Aug 15 '18 17:08 quentin41500

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.

quentin41500 avatar Aug 15 '18 17:08 quentin41500

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

IslamKhSh avatar Aug 15 '18 18:08 IslamKhSh

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?

quentin41500 avatar Aug 15 '18 18:08 quentin41500

I usually use this library in my apps https://github.com/duolingo/rtl-viewpager

IslamKhSh avatar Aug 15 '18 18:08 IslamKhSh

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.

quentin41500 avatar Aug 15 '18 18:08 quentin41500

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

IslamKhSh avatar Aug 16 '18 14:08 IslamKhSh

I see, that sounds more like something I would recommend. Still not great so.

quentin41500 avatar Aug 16 '18 15:08 quentin41500

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

IslamKhSh avatar Aug 16 '18 15:08 IslamKhSh

I will try to find a solution before the release of 2.0.0. Stay tuned

quentin41500 avatar Aug 16 '18 15:08 quentin41500

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.

vlad-roid avatar Feb 11 '19 02:02 vlad-roid

Still not working well with me in version 2.0.1 Sometimes the direction is RTL and sometimes not while locale language is Arabic

islamarr avatar Jan 20 '21 17:01 islamarr