I know that programatically I can use
if (BuildConfig.DEBUG) {
// do something for a debug build
}
However, what I'd like to do is show a watermark when in debug mode. Is there a way to do something similar to this in the XML files?
It's possible now with the Data Binding Library.
First, you have to define a variable for the BuildConfig
object:
<data>
<import type="android.view.View" />
<variable
name="buildConfig"
type="your.app.domain.BuildConfig"/>
</data>
Then just use it like this:
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="@{buildConfig.DEBUG ? View.VISIBLE : View.GONE}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With