package com.bc_chat.bc_base.utils

import android.view.View


/**
 * 显示view
 */
fun View?.visible() {
    this?.let {
        if (it.visibility != View.VISIBLE) {
            it.visibility = View.VISIBLE
        }
    }
}

/**
 * 隐藏view
 */
fun View?.gone() {
    this?.let {
        if (it.visibility == View.VISIBLE) {
            it.visibility = View.GONE
        }
    }
}

/**
 * 隐藏view
 */
fun View?.visibleToggle() {
    this?.let {
        if (it.visibility == View.VISIBLE) {
            it.visibility = View.GONE
        } else {
            it.visibility = View.VISIBLE
        }
    }
}

fun View?.invisible() {
    this?.let {
        if (it.visibility == View.VISIBLE) {
            it.visibility = View.INVISIBLE
        }
    }
}