I want to decrease the use of binding in my code
fun setVisibility() {
binding.tvFact.visibility = View.VISIBLE
binding.tvTimeStamp.visibility = View.VISIBLE
binding.progressBar.visibility = View.GONE
}
CodePudding user response:
If you do not like the syntax try this:
binding.apply{
tvFact.visibility = View.VISIBLE
tvTimeStamp.visibility = View.VISIBLE
progressBar.visibility = View.GONE
}
CodePudding user response:
You can set these values in XML itself
as default ones, so it won't process each time to set it.
<View
...
android:visibility="gone">
</>