Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

added @OnClick replacement - #25

Open
piotrpo wants to merge 2 commits into
JakeWharton:masterfrom
piotrpo:master
Open

added @OnClick replacement#25
piotrpo wants to merge 2 commits into
JakeWharton:masterfrom
piotrpo:master

Conversation

@piotrpo

@piotrpo piotrpo commented Oct 6, 2015

Copy link
Copy Markdown

A little less code to set up view onClick listener

@rharter

rharter commented Mar 17, 2017

Copy link
Copy Markdown
Contributor

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.

@3mph4515

Copy link
Copy Markdown

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants