prolificinteractive / material-calendarview

A Material design back port of Android's CalendarView
https://prolificinteractive.github.io/material-calendarview/
MIT License
5.91k stars 1.32k forks source link

Enhancement - RTL - Missing support for viewpager reverse sliding #851

Open IslamKhSh opened 6 years ago

IslamKhSh commented 6 years ago

I tried to use it in RTL layout but it's not supported and find these bugs :

quentin41500 commented 6 years ago

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 commented 6 years ago

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.

IslamKhSh commented 6 years ago

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

quentin41500 commented 6 years ago

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?

IslamKhSh commented 6 years ago

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

quentin41500 commented 6 years ago

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.

IslamKhSh commented 6 years ago

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

quentin41500 commented 6 years ago

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

IslamKhSh commented 6 years ago

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

quentin41500 commented 6 years ago

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

vlad-roid commented 5 years ago

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.

islamarr commented 3 years ago

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