android-viewpagerviewpagerindicator

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


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


Solution

  • 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.