Please, just allow to type more shortly and habitually ?:
instead of if(...) else
.
Let’s see example
ViewCompat.setBackgroundTintList(editText, if (hasFocus) colorLineFocus else colorLine)
ViewCompat.setBackgroundTintList(editText, hasFocus ? colorLineFocus : colorLine)
Subjectevily, 2nd line is more readble for me. In 1st line I need visually to extract (detect) condition, and statements.
When it occurs in big block of code, it reads very uncomfortable.
I do not see any problem to implement this traditional syntax. It has exactly the same logic ?:
and if-else
.
So, whats problem?