In android viewpager 2 , dot indicator, want to disable click event form dot indicator, not working

1.1k Views Asked by At

I am using https://github.com/tommybuonomo/dotsindicator dot indicator when I click in any dot, it leads me to that particular page. I want to disable that click event. I have used dots_indicator.isClickable = false but it is not working. any suggestions would be very appreciable. Thanks

2

There are 2 best solutions below

0
Amit Kumar On BEST ANSWER

After investing some time I found a workaround, which is working. I have created a View and cover the dot_indicatoer with that view and applied an empty setOnClickListener on that view. It is disabling the click event in the dot indicator

empty_view.setOnClickListener{ /*do nothing */}

and this is working like a charm.

1
ILIA On

dotsIndicator.dotsClickable = false