简体   繁体   中英

How to auto scroll when image view is dragged to end in Android

So I have 2 horizontal scrollview and I take one image from one scrollview to another. I want the second scroll view to autoscroll when the dragged image reaches either end of horizontalscrollview. Something like cover art in music applications.

What I've done is attached a drag listener to second scroll view and whenever the event.getX() value crosses a certain threshold, I just call hsv2.smoothScrollBy(value, 0). But the problem is it just scrolls once. I want the scrolling to be smooth and continuous.

This is a demo project one of projects. Its a scroller the scroll automatically and continously. It was made to show a credits screen by continously scrolling through a list of images. This might help you or give you some idea.

https://github.com/blessenm/SlideshowDemo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM