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

Snap center can't see the last item completely #26

Closed
dingbuoyi opened this issue Aug 22, 2017 · 7 comments
Closed

Snap center can't see the last item completely #26

dingbuoyi opened this issue Aug 22, 2017 · 7 comments
Milestone

Comments

@dingbuoyi
Copy link

dingbuoyi commented Aug 22, 2017

If you change the CardView's "layout_width" to 152dp which is in the adapter.xml,
then for the type which is "Snap center" in the demo app can't see the first and last item completely.

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="152dp"
    android:layout_height="wrap_content"
    android:layout_margin="4dp"
    android:clickable="true"
    android:foreground="?attr/selectableItemBackground"
    android:orientation="vertical">

image

@rubensousa
Copy link
Owner

Snap center means: center the closest item near the center. In this case it's the Slides card. The other views don't matter.

@dingbuoyi
Copy link
Author

@rubensousa

Thank you for reply, the problem is that you can't see the last item completely.
Every time you slide from right to left when the recycle view has reached the end, it will rebound and make the last but one item in the center of the recycle view.

@rubensousa
Copy link
Owner

rubensousa commented Aug 22, 2017

I know, but this isn't a library issue. If you need to show the last item, you need to pick another SnapHelper or adjust the card size so that it can fit at least 3 visible items at the same time :)

@rubensousa
Copy link
Owner

rubensousa commented Aug 22, 2017

Unless you mean extending LinearSnapHelper to something that overcomes this? As in a feature request.

@dingbuoyi
Copy link
Author

@rubensousa

Thank you for reply, you are right . I am trying to implement a custom SnapHelper which can overcomes this.

@rubensousa rubensousa added this to the 2.2.0 milestone Aug 30, 2019
@rubensousa
Copy link
Owner

@dingbuoyi I'll add this in 2.2.0.

@rubensousa rubensousa reopened this Aug 30, 2019
@rubensousa
Copy link
Owner

Let's follow this in #21

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

2 participants