package com.remax.visualnovel.ui.chat.ui

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.remax.visualnovel.databinding.LayoutFontSetViewBinding


class FontSetView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {

    companion object {
        private var GAP = 1
    }

    private var mBinding: LayoutFontSetViewBinding

    private var mFontValue = 20

    init {
        mBinding = LayoutFontSetViewBinding.inflate(LayoutInflater.from(context), this, true)
        setupClickListeners()
    }




    private fun setupClickListeners() {
        with (mBinding) {
            ivFontPlus.setOnClickListener {
                mFontValue -= GAP
                tvFontValue.text = mFontValue.toString()
            }

            ivFontAdd.setOnClickListener {
                mFontValue += GAP
                tvFontValue.text = mFontValue.toString()
            }

        }
    }




}