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 to implement scroll snap point effect? #11

Open
kiranboghra opened this issue Mar 5, 2016 · 6 comments
Open

How to implement scroll snap point effect? #11

kiranboghra opened this issue Mar 5, 2016 · 6 comments

Comments

@kiranboghra
Copy link

When user stop scrolling and MotionEvent.ACTION_UP is called in Carousel selected item should move to center point (Scroll snap point), is there any way or suggestionfor this functionality?

@applm
Copy link
Owner

applm commented Mar 5, 2016

Check my other repository. Deprecated one. CoverFlow there has this
implemented.
Dne 5. 3. 2016 10:55 dopoledne napsal uživatel "kiran boghra" <
[email protected]>:

When user stop scrolling and MotionEvent.ACTION_UP is called in Carousel
selected item should move to center point (Scroll snap point), is there any
way or suggestionfor this functionality?


Reply to this email directly or view it on GitHub
#11.

@kiranboghra
Copy link
Author

please provide link.

@gintechsystems
Copy link

@kiranboghra If you still need help with this I am implemented in my forked release.

@ashenriques
Copy link

@gintechsystems in your repository did u managed how to make scroll to position to work?
I tried it but I was unable to make it work properly.

One issue I have when I just uncomment the function "carousel.scrollToItemPosition(position);" in onClickListener is that some views do a visual flickering.

The other issue it's a little more complex to explain. But my idea is to scroll to a card that it's not displayed in the screen.
For instance if I turn off the loop, and set mCount to length * 5; I will have 25 cards.
So if I set the card's onLongClickListener method to call scrollToPosition for the hardcoded value 24 (the last card), independently in which card I click in theory I should always jump to the last card.
But what happens is that sometimes I jump to the last card -> 24, other times to 23. When I make the jump from the first card -> 0 the app just crashes.

Do you have any idea how to solve this?

@gintechsystems
Copy link

@ashenriques Take this to my repo please, I have gotten that to work using setSelection, I believe.

@ashenriques
Copy link

@gintechsystems you have your issues section disabled in your repo (try this -> http://programmers.stackexchange.com/questions/179468/forking-a-repo-on-github-but-allowing-new-issues-on-the-fork. The method setSelection centers the clicked card, but does not animate the scroll to it.

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

4 participants