Skip to content

Instantly share code, notes, and snippets.

@exallium
Last active February 2, 2016 13:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exallium/2ec40c48fe04f64c0600 to your computer and use it in GitHub Desktop.
Save exallium/2ec40c48fe04f64c0600 to your computer and use it in GitHub Desktop.
public abstract class ButterKnifeViewHolder(val itemView : View) {}
public fun <T : View> ButterKnifeViewHolder.bindView(id: Int): ReadOnlyProperty<Any, T> = ViewBinding(id)
public fun <T : View> ButterKnifeViewHolder.bindOptionalView(id: Int): ReadOnlyProperty<Any, T?> = OptionalViewBinding(id)
public fun <T : View> ButterKnifeViewHolder.bindViews(vararg ids: Int): ReadOnlyProperty<Any, List<T>> = ViewListBinding(ids)
public fun <T : View> ButterKnifeViewHolder.bindOptionalViews(vararg ids: Int): ReadOnlyProperty<Any, List<T>> = OptionalViewListBinding(ids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment