Skip to content

Instantly share code, notes, and snippets.

@venik
Created March 20, 2019 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save venik/64e44ac1a7736cc49925e47ae74a0327 to your computer and use it in GitHub Desktop.
Save venik/64e44ac1a7736cc49925e47ae74a0327 to your computer and use it in GitHub Desktop.
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