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

How can I use it on landscape #9

Open
yang1271772302 opened this issue Mar 2, 2018 · 5 comments
Open

How can I use it on landscape #9

yang1271772302 opened this issue Mar 2, 2018 · 5 comments

Comments

@yang1271772302
Copy link

I can't use it on landscape,can you help me to finish it?

@adityagohad
Copy link
Owner

what is the issue?

@MahdiYusefi
Copy link

MahdiYusefi commented Jun 17, 2018

It can not be scrolled to first and last item in wide screen.
when I'm trying to scroll the items in some wide screen like tablets it stucks on second or one before the last item.
EDIT:
Sorry I thought it would be better to mention that I completely followed the document. this is my recyclerview code:

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_registerNewCar_model"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/view1"
            android:layout_centerInParent="true"
            android:clipToPadding="false"
            android:paddingLeft="@dimen/dimen_185"
            android:paddingRight="@dimen/dimen_185"
           />

@BaptisteAmato
Copy link

What about this:

recyclerView.setPadding(screenwidth / 2, 0, screenwidth / 2, 0)

@MahdiYusefi
Copy link

It solved my issue.
Thank you.

@xmellado
Copy link

If someone is forking the code, onAttachedToWindow function can overridden in PickerLayoutManager class to automatically solve the issue:

    @Override
    public void onAttachedToWindow(final RecyclerView view) {
        super.onAttachedToWindow(view);

        final DisplayMetrics displayMetrics = view.getContext().getResources().getDisplayMetrics();
        final int screenWidth = displayMetrics.widthPixels;
        view.setPadding(screenWidth / 2, 0, screenWidth / 2, 0);
    }

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

No branches or pull requests

5 participants