Hello guys, I have a question related to "how to s...
# kotlin-in-action
k
Hello guys, I have a question related to "how to set the textcolor for all the textview inside the constraint layout at once?" Example: I have 10 textviews inside constraint layout. And based on some condition I have to change all the textview's textcolor. Rather than add textView1.setTextColor, textView2.setTextColor....textview10.setTextColor() ...do we have any other way to handle this ? Thanks in advance 🙂
a
It is pretty trivial if you are using data binding. Create a live data that holds the color res id and then use binding to bind the text views to it so you change the value of live data and the view redraw