package com.remax.visualnovel.extension

import android.widget.ImageView
import androidx.core.view.isVisible
import com.remax.visualnovel.R
import com.remax.visualnovel.constant.Gender

/**
 * Created by HJW on 2025/7/16
 */

/**
 * 显示性别
 */
fun ImageView.showGender(gender: Int?) {
    isVisible = true
    when (gender) {
        Gender.MALE.value -> setImageResource(R.mipmap.ic_gender_male)

        Gender.FEMALE.value -> setImageResource(R.mipmap.ic_gender_female)

        Gender.NONCONFORMING.value -> setImageResource(R.mipmap.ic_gender_nonconforming)

        Gender.OTHER.value -> setImageResource(R.mipmap.ic_gender_nonconforming)

        else -> {
            isVisible = false
        }
    }
}