package com.remax.visualnovel.widget.ui.chips

import android.content.Context
import android.util.AttributeSet
import android.view.Gravity
import com.remax.visualnovel.R
import com.remax.visualnovel.utils.spannablex.utils.dp
import com.remax.visualnovel.widget.ui.IconFontTextView
import com.remax.visualnovel.widget.uitoken.changeBackground
import com.remax.visualnovel.widget.uitoken.changeTextStyle

/**
 * create by wl on 2022/9/9
 * 帮助chip
 */
class AssistChipView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : IconFontTextView(context, attrs, defStyleAttr) {

    init {
        //初始化固定token
        changeTextStyle {
            textUITextToken = context.getString(R.string.txt_label_m)
            textUIColorToken = context.getString(R.string.color_txt_primary_normal)
            textUIDisabledColorToken = context.getString(R.string.color_txt_disabled)
            textUIPressedColorToken = context.getString(R.string.color_txt_primary_normal)
        }
        changeBackground {
            backgroundUIColorToken = context.getString(R.string.color_surface_element_normal)
            backgroundUIDisabledColorToken = context.getString(R.string.color_surface_element_disabled)
            backgroundUIPressedColorToken = context.getString(R.string.color_surface_element_press)
            radiusToken = context.getString(R.string.radius_round)
        }
        gravity = Gravity.CENTER
        height = 32.dp
        setPaddingRelative(12.dp, 0, 16.dp, 0)
    }


}