Answers for "Remove ViewPager2 Overscroll animation"

0

Remove ViewPager2 Overscroll animation

viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {

	@Override
    public void onPageSelected(int position) {
       super.onPageSelected(position);
	   View child = viewPager2.getChildAt(0);
       if (child instanceof RecyclerView)
          child.setOverScrollMode(View.OVER_SCROLL_NEVER);
	}
}
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language