package com.base.datarecovery.view

import android.view.MotionEvent
import android.view.View
import androidx.coordinatorlayout.widget.CoordinatorLayout
import com.google.android.material.bottomsheet.BottomSheetBehavior


class CustomBottomSheetBehavior<V : View> : BottomSheetBehavior<V>() {
    override fun onInterceptTouchEvent(parent: CoordinatorLayout, child: V, event: MotionEvent): Boolean {
        // 根据需要拦截触摸事件，这里我们选择不拦截，即不允许拖动
        return false
    }

    override fun onTouchEvent(parent: CoordinatorLayout, child: V, event: MotionEvent): Boolean {
        // 这里我们返回super.onTouchEvent(parent, child, event)来处理触摸事件
        return super.onTouchEvent(parent, child, event)
    }

    override fun onStartNestedScroll(
        coordinatorLayout: CoordinatorLayout,
        child: V,
        directTargetChild: View,
        target: View,
        axes: Int,
        type: Int
    ): Boolean {
        // 这里我们选择不开始嵌套滚动
        return false
    }
}