package com.adealink.weparty.commonui.ext

import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.style.AbsoluteSizeSpan
import android.widget.EditText
import com.adealink.frame.ext.safeSetSpan

fun EditText.setHintTextSize(hintTextSizePx: Int) {
    val spannableSb = SpannableStringBuilder(this.hint)
    val absoluteSizeSpan = AbsoluteSizeSpan(hintTextSizePx, false)
    spannableSb.safeSetSpan(absoluteSizeSpan,
        0,
        spannableSb.toString().length,
        Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
    hint = spannableSb
}