kotterknife icon indicating copy to clipboard operation
kotterknife copied to clipboard

added @OnClick replacement

Open piotrpo opened this issue 9 years ago • 2 comments

A little less code to set up view onClick listener

piotrpo avatar Oct 06 '15 18:10 piotrpo

In Kotlin adding a click listener on a view as already a single call, so I'm not really sure of the need for this.

button.setOnClickListener {
  // do stuff
}

If this were to stay, I'd like to see the View added to the callback since it's optional if there's only one arg (can be accessed with it if you want) and so theres no need to lose information along the way.

rharter avatar Mar 17 '17 14:03 rharter

The original butterknife version has debounced click listener to prevent multiple clicks. @rharter How do you handle this in Kotlin with such listeners?

3mph4515 avatar Dec 12 '17 15:12 3mph4515