package com.remax.visualnovel.extension

import androidx.core.view.isVisible
import com.remax.visualnovel.R
import com.remax.visualnovel.widget.uitoken.changeTextColor
import com.remax.visualnovel.widget.uitoken.view.UITokenTextView


/**
 * 切换点赞爱心状态
 */
fun UITokenTextView.changeLikedStatus(isLike: Boolean) {
    isVisible = true
    changeTextColor {
        textUIColorToken =
            context.getString(if (isLike) R.string.color_important_normal else R.string.color_txt_primary_normal)
    }
    setText(if (isLike) R.string.icon_like_fill else R.string.icon_like)
}

///**
// *  切换follow following 按钮状态
// */
//fun ButtonView.changeFollowStatus(followedStatus: String?) {
//    when (followedStatus) {
//        FollowedStatus.FOLLOWED -> {
//            setText(R.string.following)
//            setButtonStyle(ButtonView.DefaultButton_Tertiary)
//        }
//
//        FollowedStatus.CANCELED -> {
//            setText(R.string.follow)
//            setButtonStyle(ButtonView.DefaultButton_Primary)
//        }
//
//        else -> {
//            setText(R.string.follow)
//            setButtonStyle(ButtonView.DefaultButton_Primary)
//        }
//    }
//}
