Open janheinrichmerker opened 8 years ago
I've tested quite a bunch of RTL view pager implementations including the one @mahmooddagga suggested and all of them had conflicts with the fadeable view pager we use internally.
I've seen something like a RecyclerView view pager recently and I may try that if I find time.
\subscribe @Crusher7
It seems like the issue isn't resolved yet right? If so there is an easy solution to use rotationY="180" in the viewpager and in the fragments, that would do the trick. If it's already solved please let me know how to use it.
@didi77 that may be a bit hacky but if it works why shouldn't we use it.
Could you maybe create an override of ViewPager
that does exactly this?
Then I would test it and embed it in the library.
Also is there any minimum SDK version for rotationY
? If so what options are there to backport it to Jelly Bean? No need to support the rotation on SDK versions below Jelly Bean, as these don't support RTL anyway.
minimum SDK for rotationY
is 16 so we're good on that end, regarding the override class:
you can do it by XML:
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rotationY="180"/>
or a simple class:
public class viewPagerRTL extends ViewPager {
public viewPagerRTL(Context context) {
super(context);
getRootView().setRotationY(180);
}
public viewPagerRTL(Context context, AttributeSet attrs) {
super(context, attrs);
getRootView().setRotationY(180);
}
}
Wow, I am facing this issue also. I will have a look into this as well. Please link the PR if you create one.
@didi77 Looks very promising, would you mind creating a PR? Personally I would rather like to have a dedicated class that does the rotation (and the rotation of each page) because that way we don't need to split that feature into more than one file.
Hey @heinrichreimer, Any updates on that one?
I'm currently not maintaining this lib actively. Seems that university needs more time than one might think 😉
Could be another argument for ViewPager2
As
ViewPager
has no built in RTL support the only way would be to create our ownViewPager
that basically reverses the slide ordering in RTL locales.