Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈
...

Miguel Ángel Moreno nitrico

🐈
...
View GitHub Profile
@nitrico
nitrico / LastAdapter.kt
Created Jul 3, 2016
LastAdapter.Builder
View LastAdapter.kt
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)