package com.develop.common.widget

import android.content.Context
import android.util.AttributeSet
import androidx.recyclerview.widget.LinearLayoutManager

class ScrollLinearManager : LinearLayoutManager {
    private var isCanVerticalScroll = true

    constructor(context: Context?) : super(context) {}
    constructor(context: Context?, orientation: Int, reverseLayout: Boolean) : super(
        context,
        orientation,
        reverseLayout
    ) {
    }

    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int,
        defStyleRes: Int
    ) : super(context, attrs, defStyleAttr, defStyleRes) {
    }

    override fun canScrollVertically(): Boolean {
        return isCanVerticalScroll && super.canScrollVertically()
    }

    fun setCanScrollVertically(isCanScroll: Boolean) {
        isCanVerticalScroll = isCanScroll
    }
}