I have used below code in my layout file to change two different view visibility according to flavor type of the application. I haven't seen any problems with debug build but i believe there is an issue with release build because I have been reported that both views are visible on the test release. Any idea why would this happen?
<Switch
android:id="@+id/configuration_main_network_switch"
style="@style/networkSelector"
android:visibility="@{BuildConfig.FLAVOR.equals(`xxxx`) ? View.GONE : View.VISIBLE}"
android:text="@{configurationMainNetworkSwitch.checked ? @string/network_configuration_main_wifi_enabled_button : @string/network_configuration_main_wifi_disabled_button}" />
<TextView
android:id="@+id/configuration_main_network_switch_gone"
style="@style/networkSelector"
android:visibility="@{BuildConfig.FLAVOR.equals(`xxxx`) ? View.VISIBLE : View.GONE}"
android:text="@string/network_configuration_main_wifi_enabled_button"/>
Import the required data-types first:
Then they can be referenced in data-binding statements:
I can also get the product flavor:
Maybe the string being compared to doesn't match?