AndroidImageSlider icon indicating copy to clipboard operation
AndroidImageSlider copied to clipboard

SliderLayout.setCurrentPosition(int pos) stops app responding

Open anonym24 opened this issue 9 years ago • 4 comments

SliderLayout.setCurrentPosition(int pos) stops app responding

it's ok if you change position like 1,2,3,4,5 but if you change it like 1,3,5 or from 10 to 0, app will become unresponsive

anonym24 avatar Sep 10 '17 11:09 anonym24

it's diffidently a bug when changing position from 10 to 0 using SliderLayout.setCurrentPosition only works ok if changing position from 0 to 10

anonym24 avatar Sep 10 '17 14:09 anonym24

I found some temporary solution https://stackoverflow.com/questions/22937651/infiniteviewpager-freezes-on-setcurrentitem-method\

we can find it in:

com.daimajia.slider.library.Tricks.InfinitePagerAdapter

anonym24 avatar Sep 10 '17 14:09 anonym24

I have the same trouble. have you found a solution?

ubione88 avatar Mar 21 '18 01:03 ubione88

This work for me

  if (sliderLayout.getCurrentPosition() > position) {
                    sliderLayout.setCurrentPosition( array.size() - 1, false);
                    sliderLayout.moveNextPosition();
                }
                sliderLayout.setCurrentPosition(position, false);

ubione88 avatar Mar 21 '18 02:03 ubione88