package com.xuqm.sdhbwfu.core.ui.component

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.LinearLayout

/**
 * 拦截点击事件，全屏不可点击的时候，这么搞简单点
 */
class TouchLinearLayout : LinearLayout {
    constructor(context: Context) : super(context) {}
    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        return super.onTouchEvent(event)
    }

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        return !enableTouch
    }

    var enableTouch: Boolean = true

}