From cb0206ae6de7713e5d6b0ce687b374409f8d5d8f Mon Sep 17 00:00:00 2001 From: Mehdi Nosrati Sahlan Date: Thu, 2 Jan 2020 20:33:00 +0330 Subject: [PATCH] add binding adapters --- .../main/java/io/mns/mpfm/utils/BindingAdapters.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/src/main/java/io/mns/mpfm/utils/BindingAdapters.java diff --git a/app/src/main/java/io/mns/mpfm/utils/BindingAdapters.java b/app/src/main/java/io/mns/mpfm/utils/BindingAdapters.java new file mode 100644 index 0000000..24308a7 --- /dev/null +++ b/app/src/main/java/io/mns/mpfm/utils/BindingAdapters.java @@ -0,0 +1,12 @@ +package io.mns.mpfm.utils; + +import android.view.View; + +import androidx.databinding.BindingAdapter; + +public class BindingAdapters { + @BindingAdapter("visibleGone") + public static void showHide(View view, boolean show) { + view.setVisibility(show ? View.VISIBLE : View.GONE); + } +}