Skip to content

Instantly share code, notes, and snippets.

View nitrico's full-sized avatar

Miguel Ángel Moreno nitrico

View GitHub Profile
@nitrico
nitrico / LastAdapter.kt
Created July 3, 2016 16:23
LastAdapter.Builder
class Builder<T : Any> internal constructor(private val list: List<T>, private val variable: Int) {
private val map: MutableMap<Class<*>, Int> = mutableMapOf()
private var handler: LayoutHandler? = null
private var onBind: OnBindListener? = null
private var onClick: OnClickListener? = null
private var onLongClick: OnLongClickListener? = null
inline fun <reified T : Any> map(@LayoutRes layout: Int) = map(T::class.java, layout)