I was looking at the generated code of ButterKnife, and noticed that for @OnClick
annotations it is using a DebouncingOnClickListener
, implemented by the library.
What the DebouncingOnClickListener
does it to avoid more than one click on any element using that listener on the same frame (to achieve this they use a static flag). You can see the implementation here.
I have tried to find an explanation on why they decided to use this for every on click event managed by the library, but could not find any.
So, why they use that? Why have they decided that every user of ButterKnife need this? Shouldn't be the user who decides to use that or not? Why couple the view binding help it provides with this "feature"? What happens if I want to receive more than one click on the same frame? I couldn't use ButterKnife for click events.
I don't pretend to be offensive, just want an explanation, maybe I am missing something.