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

RTL support #32

Open
janheinrichmerker opened this issue Mar 29, 2016 · 12 comments
Open

RTL support #32

janheinrichmerker opened this issue Mar 29, 2016 · 12 comments

Comments

@janheinrichmerker
Copy link
Owner

No description provided.

@janheinrichmerker
Copy link
Owner Author

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

@janheinrichmerker janheinrichmerker modified the milestones: Release 1.4.1, Release 1.4 Apr 28, 2016
@janheinrichmerker janheinrichmerker removed this from the Release 1.4.1 milestone May 27, 2016
@janheinrichmerker
Copy link
Owner Author

janheinrichmerker commented Sep 11, 2016

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

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

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

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

moshedidi commented Mar 3, 2018

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

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

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

Hey @heinrichreimer,
Any updates on that one?

@janheinrichmerker
Copy link
Owner Author

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

@janheinrichmerker janheinrichmerker removed their assignment May 27, 2021
@janheinrichmerker
Copy link
Owner Author

Could be another argument for ViewPager2

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

5 participants