Since my app lags during left/right transitions between fragments in a ViewPager2
, I decided to disable its native swipe function with viewPager2!!.isUserInputEnabled=false
. However, this also disabled the blue colored edge effect when swiping horizontally for fragments at either ends.
As my fragments also use vertical ScrollView
, I noticed that the top and bottom edge effects work. Therefore, could it be possible to add left and right edge effects to a custom/extended vertical ScrollView
? I believe left and right edge effects already are in place for horizontal ScrollView
.
I also found the documentation regarding EdgeEffect where android.widget.EdgeEffect
also can be extended:
class Edge(context: Context) : EdgeEffect(context) {
// override functions
}
However, I don't know how I can apply it in order to add left/right edge effect to a vertical ScrollView.