Friday, January 11, 2019

Escape And(&&) Operator In Android Data Binding


The following operator need to be escaped (XML escaped characters):
  • & -> &
  • < -> &lt;
  • > -> &gt;
  • " -> &quot;
  • ' -> &apos;
android:visibility="@{!viewModel.isEdit &amp;&amp; viewModel.categoryIdItemPosition != 0 ? View.VISIBLE : View.GONE}"
android:visibility="@{viewModel.categoryIdItemPosition &gt; 0 ? View.VISIBLE : View.GONE}"