Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IslamKhSh opened this issue Aug 15, 2018 · 12 comments
Open

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

IslamKhSh opened this issue Aug 15, 2018 · 12 comments

Comments

@IslamKhSh
Copy link

IslamKhSh commented Aug 15, 2018

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

@quentin41500
Copy link
Member

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
Copy link
Member

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
Copy link
Author

IslamKhSh commented Aug 15, 2018

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
Copy link
Member

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 quentin41500 changed the title Not support RTL Enhancement - RTL - Missing support for viewpager reverse sliding Aug 15, 2018
@IslamKhSh
Copy link
Author

IslamKhSh commented Aug 15, 2018

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

@quentin41500
Copy link
Member

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
Copy link
Author

IslamKhSh commented Aug 16, 2018

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
Copy link
Member

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

@IslamKhSh
Copy link
Author

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
Copy link
Member

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

@vlad-roid
Copy link

vlad-roid commented Feb 11, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants