While using ViewPager2
in my current project, I wanted to use setOnTouchListener
, but I was unable to get any events.
I decided to extend the ViewPager2 class to override the touch event methods, but was unable to as the class definition is final.
Why is this class final and is there any way to extend it so that I can override the touch events?
Well I think they f'd up the whole viewpager thing from the getgo. Most liky because all the fragment in fragment code was also messed up back than.
They even ask us to not use the normal viewpager from brand new androidx because it has errors. I think some errors that are reported are now older code trying to fix issues from old viewpager implementations. I think they now got the code stable enough to be useable and don't want us to implement all the now-unnessessary and maybe counter-productive fixes when transitioning to viewpager2.
I am quite mad at how lazy google handled the whole fragments and viewpager stuff in the past. It speaks volumes they never got it working in the main codebase and always suggested using the compat packages.
So in short. Now after years they got it working and they want you to drop all your fixes that are now not needed anymore..