I have following code:
private fun setCashPaymentContainer(isSelected: Boolean) {
if (isSelected) {
dataBinding.cashPaymentCheckImageViewContainer.visibility = View.VISIBLE
} else {
dataBinding.cashPaymentCheckImageViewContainer.visibility = View.GONE
}
}
It works fine, but I would like to improve it and write it as simplified and readable if else block.It would be nice if I can make a one line if else statement Please suggest.