package com.adealink.weparty.commonui.widget

import android.graphics.Color
import android.text.TextPaint
import android.text.style.ClickableSpan
import android.view.View
import androidx.annotation.ColorRes
import com.adealink.frame.aab.util.getCompatColor

open class ColorClickSpan(@ColorRes private val colorId: Int) : ClickableSpan() {

    override fun onClick(widget: View) {

    }

    override fun updateDrawState(ds: TextPaint) {
        super.updateDrawState(ds)
        ds.isUnderlineText = false
        ds.color = getCompatColor(colorId)
        ds.bgColor = Color.TRANSPARENT
    }

}