package com.remax.visualnovel.extension.ui

import com.remax.visualnovel.R
import com.remax.visualnovel.widget.ui.buttons.IconButtonView
import com.remax.visualnovel.widget.uitoken.changeTextColor

/**
 * Created by HJW on 2023/7/24
 */

fun IconButtonView.setFavorite(userFavorite: Boolean) {
    if (userFavorite) {
        setText(R.string.icon_star_fill)
        changeTextColor {
            textUIColorToken = context.getString(R.string.color_warning_gradient_normal)
        }
    } else {
        setText(R.string.icon_star)
        changeTextColor {
            textUIColorToken = context.getString(R.string.color_txt_primary_normal)
        }
    }
}