title: Condition rendering for login fields in xml
body: <p>I come from a react background but recently have had to do more xml as part of my job.</p>
  
  <p>Currently understand you can display different layouts if a user does something. However if a user is logging in. Say username and password and when a field is empty i want the drawable to flip to red. Creating a new layout seems odd? Can I not use ternary similar to JSX for example.</p>
  
  <pre><code>android:background=" isValid ? @drawable/good : @drawable/error"
  </code></pre>
  
  <p>where isValid is a boolean and in its respective file I check if it is empty or not and display an alert if it is. But cant seem to change the layout dynamically. </p>
  
  <p>Thanks in advance.</p>