Skip to content

Instantly share code, notes, and snippets.

View ha-yi's full-sized avatar
🇵🇸
Software Engineer - Remote Worker

Hayi Nukman ha-yi

🇵🇸
Software Engineer - Remote Worker
View GitHub Profile
21 + 12
3 - 97
87 / 61
1 * 2
99 - 76 * 32 / 15
76 * 55
7 ^ 45
8 * 14 /7 *5
9 * 3 * 1
4 * 2 - 12
val name = users?.listOfField(Bantuan::name)
open class Bantuan() {
var id: Int? = null
var name: String? = null
var category: String? = null
var info: String? = null
var created: String? = null
var updated: String? = null
}
val name = users?.listOfField(User::nama)
inline fun <reified T, Y> MutableList<T>.listOfField(property: KMutableProperty1<T, Y?>):MutableList<Y> {
val yy = ArrayList<Y>()
this.forEach { t: T ->
yy.add(property.get(t) as Y)
}
return yy
}
val users:MutableList<User> = mutableListOf(...)
data class User(val id:Int?, val nama:String?, val alamat:String?)
infix fun View.onClick(function: () -> Unit) {
this.setOnClickListener { function.invoke() }
}
object Terpaksa {
private var context: Context? = null
infix fun init(context: Context) {
this.context = context
}
kalauBatal diKlik {
Terpaksa tanya Pertanyaan(denganJudul = "Batal?",
isiPertanyaan = "Apakah anda ingin membatalkan Membatalkan?",
kalauOke = {finish()})
}
recycler.loadData(ListJiwaContactorImpl::class.java, ListJiwaPresenter::class.java)