Slackbot
05/06/2023, 10:47 AMChrimaeon
05/06/2023, 10:59 AMtoString
method.Chrimaeon
05/06/2023, 11:26 AMprint
on android. if you want to log something to logcat use https://developer.android.com/reference/android/util/Log
3. if it was clear I would not have asked
4. if you format all the code it would be easier to follow whats code and whats just a statement.
5. whats hindering you in overriding toString
?Chrimaeon
05/07/2023, 8:50 AMyou can override themethod.toString
Chrimaeon
05/07/2023, 8:51 AMChrimaeon
05/07/2023, 8:52 AMChrimaeon
05/07/2023, 8:52 AMChrimaeon
05/07/2023, 3:44 PMChrimaeon
05/07/2023, 3:44 PMChrimaeon
05/07/2023, 3:50 PMopen class UiEvent
interface PersonalInfoViewModelContract {
sealed class Event: UiEvent() {
data class CheckoutClicked(val s:String = "") : Event() {
override fun toString() = "PersonalInfoViewModelContractEventCheckoutClicked"
}
}
}
val instance = PersonalInfoViewModelContract.Event.CheckoutClicked("foo")
print(instance)
Chrimaeon
05/07/2023, 4:10 PMinterface PersonalInfoViewModelContract {
sealed class Event: UiEvent() {
override fun toString(): String {
return javaClass.name.replace("$", "")
}
data class CheckoutClicked(val s:String = "") : Event() {
override fun toString() = super.toString()
}
}
}
Chrimaeon
05/07/2023, 4:45 PMChrimaeon
05/07/2023, 5:05 PM