1

Can not remove the glow effect on over-scroll in TabLayout with ViewPager2.

I have tried android:overScrollMode="never" and android:fadingEdge="none" but it doesn't work.

<androidx.viewpager2.widget.ViewPager2
            android:id="@+id/viewPager2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:overScrollMode="never"/>
Moisoni Ioan
  • 1,370
  • 1
  • 13
  • 24

2 Answers2

2

You're right, android:overScrollMode="never" is not disabling the over scroll effect. The respective issue created on the issue tracker: https://issuetracker.google.com/issues/134912610

But you can try workaround, described in this answer.

Anatolii Chub
  • 1,228
  • 1
  • 4
  • 14
0

As @Anatolii Chub mentioned, it is an issue. He provided a link to a workaround in Kotlin but I use Java in my project so this is the solution:

//disable glow effect when over-scroll
if (viewPager2.getChildAt(0) instanceof RecyclerView) {
    viewPager2.getChildAt(0).setOverScrollMode(View.OVER_SCROLL_NEVER);
}

His answer will remain accepted because he provided info for solution.

Moisoni Ioan
  • 1,370
  • 1
  • 13
  • 24