Created
March 20, 2019 18:56
-
-
Save venik/64e44ac1a7736cc49925e47ae74a0327 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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