janheinrichmerker / material-intro

A simple material design app intro with cool animations and a fluent API.
https://jitpack.io/#com.heinrichreimer/material-intro
MIT License
1.74k stars 307 forks source link

RTL support #32

Open janheinrichmerker opened 8 years ago

janheinrichmerker commented 8 years ago

As ViewPager has no built in RTL support the only way would be to create our own ViewPager that basically reverses the slide ordering in RTL locales.

mahmooddagga commented 8 years ago

https://github.com/diego-gomez-olvera/RtlViewPager

janheinrichmerker commented 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

moshedidi commented 6 years ago

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.

janheinrichmerker commented 6 years ago

@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.

janheinrichmerker commented 6 years ago

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.

moshedidi commented 6 years ago

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);
    }
}
meierjan commented 6 years ago

Wow, I am facing this issue also. I will have a look into this as well. Please link the PR if you create one.

janheinrichmerker commented 6 years ago

@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.

shaharcarbyne commented 5 years ago

Hey @heinrichreimer, Any updates on that one?

janheinrichmerker commented 5 years ago

I'm currently not maintaining this lib actively. Seems that university needs more time than one might think 😉

janheinrichmerker commented 3 years ago

Could be another argument for ViewPager2