Skip to content

Instantly share code, notes, and snippets.

@venik venik/PokemonVM.kt
Created Mar 20, 2019

Embed
What would you like to do?
data class PokemonVM(
val app: Application,
val name: String,
val origin: String,
val avatar: Drawable
) {
val showDetails: ObservableBoolean = ObservableBoolean(false)
val description: ObservableField<String> = ObservableField("description placeholder")
fun onClick() {
val exposed = !showDetails.get()
showDetails.set(exposed)
Log.i(TAG, "onClick pokeName: " + name + " new status: " + exposed)
if (!exposed) {
// Do smth
} else {
// Do smth else
}
}
companion object {
val TAG = "PokemonVMXXYY"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.