HorizontalScrollView, auto-scroll to the end with animation

I have a horizontalScrollView, and I need to autoscroll to complete the animation when the view loads. I applied this method for this:

final HorizontalScrollView strip = (HorizontalScrollView) contentView. findViewById(R.id.horizontalScrollView1); strip.postDelayed(new Runnable() { public void run() { strip.fullScroll(HorizontalScrollView.FOCUS_RIGHT); } }, 1000L); 

It works fine, but the main problem is that the scroll animation is too high, and I need to implement slow scrolling. Do you have any ideas?

+6
source share
2 answers

This is a demo project that I created for one of my projects. The scroller scrolls automatically and continuously. This was done to display the credits screen by continuously scrolling through the list of images. This may help you or give you some ideas.

https://github.com/blessenm/SlideshowDemo

+6
source

Try the following:

 ObjectAnimator animator=ObjectAnimator.ofInt(buttonHolderScrollView, "scrollX",targetXScroll ); animator.setStartDelay(100); animator.setDuration(100); animator.start(); 
+2
source

Source: https://habr.com/ru/post/897604/


All Articles