https://kotlinlang.org logo
a

Alin B.

07/13/2018, 11:41 AM
if in my data class I have 2 ints value and in the textview I want to bind something like "firstInt (secondInt)", what would be best, have a
get()
in the data class or use
String.format
with the 2 values OR do the string concatenation directly in
xml
? to me looks like a good approach go with get in data class
Copy code
val text: String
        get() = "$fisrtInt ($secondInt)"