package com.github.jackparisi.droidbox.binding

import android.databinding.BindingAdapter
import android.graphics.Rect
import android.util.Base64
import android.view.MotionEvent
import android.view.View
import android.view.animation.Animation
import android.view.animation.LinearInterpolator
import android.view.animation.RotateAnimation
import android.widget.ImageView
import com.bumptech.glide.Glide


/**
 * Created by Giacomo Parisi on 02/07/2017.
 * https://github.com/JackParisi
 */


@BindingAdapter("visibleOrGone")
fun bindVisibleOrGone(v: View, visible: Boolean) {
    v.visibility = if (visible) View.VISIBLE else View.GONE
}

@BindingAdapter("visibleOrInvisible")
fun bindVisibleOrInvisible(v: View, visible: Boolean) {
    v.visibility = if (visible) View.VISIBLE else View.INVISIBLE
}

package com.github.jackparisi.droidbox.binding

import android.databinding.BindingAdapter
import android.view.View


/**
 * Created by Giacomo Parisi on 02/07/2017.
 * https://github.com/JackParisi
 */

/**
 * Update the visibility of te view status VISIBLE/GONE based on boolean value
 *
 * @param view The view that need the visibility update
 * @param visible Set it to true for VISIBLE status or false for GONE status
 */
@BindingAdapter("visibleOrGone")
fun bindVisibleOrGone(view: View, visible: Boolean) {
    view.visibility = if (visible) View.VISIBLE else View.GONE
}

/**
 *
 * Update the visibility of te view status VISIBLE/INVISIBLE based on boolean value
 *
 * @param view The view that need the visibility update
 * @param visible Set it to true for VISIBLE status or false for INVISIBLE status
 */
@BindingAdapter("visibleOrInvisible")
fun bindVisibleOrInvisible(view: View, visible: Boolean) {
    view.visibility = if (visible) View.VISIBLE else View.INVISIBLE
}

Add docs for viewAdapter + methods refactor
Add docs for viewAdapter + methods refactor

JackParisi/DroidBox