package com.kdanmobile.reader.screen.view

import android.content.Context
import android.support.constraint.ConstraintLayout
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.CompoundButton
import com.kdanmobile.reader.R
import kotlinx.android.synthetic.main.view_toolbar_setting.view.*

class ToolbarSettingView : ConstraintLayout {
    var onCheckedChangeListenerComment: CompoundButton.OnCheckedChangeListener? = null
        set(value) {
            field = value
            rowSwitchView_show_commentTool?.onCheckedChangeListener = value
        }

    var onCheckedChangeListenerBOTA: CompoundButton.OnCheckedChangeListener? = null
        set(value) {
            field = value
            rowSwitchView_show_BOTATool?.onCheckedChangeListener = value
        }

    var isShowCommentToolEnable: Boolean = false
        set(value) {
            field = value
            rowSwitchView_show_commentTool?.isChecked = value
        }

    var isShowBOTAToolEnable: Boolean = false
        set(value) {
            field = value
            rowSwitchView_show_BOTATool?.isChecked = value
        }

    constructor(context: Context) : super(context) {
        initView()
    }

    constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
        initView()
    }

    constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
        initView()
    }

    private fun initView() {
        LayoutInflater.from(context).inflate(R.layout.view_toolbar_setting, this)
    }
}