1

I have a list of fragments implemented together with FragmentStatePagerAdapter. I must replace the current fragment with a new one each time the button don't like will be clicked. The problem with the ViewPager. In my case the ViewPager scroll exactly list.size() -1 times smoothly, All other scrolling disable the smoothly scrolling.

 doNotLike.setOnClickListener(new View.OnClickListener() {
        @Override
         public void onClick(View v) {
               fragmentList.set(viewPager.getCurrentItem(), alternativeList.get(viewPager.getCurrentItem()));
                viewPagerAdapter.notifyDataSetChanged();
                viewPager.setCurrentItem(currentPos + 1, true);

    }
  });

I have no idea why the smoothly scrolling is so limited with fragmentList-size and how can I turn off this behaviour.

Sam Joos
  • 430
  • 2
  • 11
  • 25
  • Did you find anything? Is this question I just posted the same you wanted to do? http://stackoverflow.com/questions/43996911/how-to-scroll-change-page-of-android-viewpager-smoothly – Ferran Maylinch May 16 '17 at 09:03
  • 1
    I think that was a bug in Android library. There is no solution! – Sam Joos May 16 '17 at 13:13

0 Answers0