Newer
Older
SmartKitchenTablet / app / src / main / java / com / casic / br / extensions / ViewGroup.kt
package com.casic.br.extensions

import android.view.View
import android.view.ViewGroup
import com.casic.br.utils.LocaleConstant

//TODO 后期整合到View扩展函数去
fun ViewGroup.disableLayout(vararg view: View) {
    this.alpha = LocaleConstant.VIEW_DISABLE
    this.isEnabled = false
    view.forEach {
        it.isEnabled = false
    }
}

fun ViewGroup.enableLayout(vararg view: View) {
    this.alpha = LocaleConstant.VIEW_ENABLE
    this.isEnabled = true
    view.forEach {
        it.isEnabled = true
    }
}