Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
727 B
2
Indexable
Never
private fun renderGender(): Unit = with(binding) {
        val genderMap = mapOf(
            MALE_KEY to Pair(
                context.getString(R.string.feature_mamiads_title_male),
                BasicIcon.MALE
            ),
            FEMALE_KEY to Pair(
                context.getString(R.string.feature_mamiads_title_female),
                BasicIcon.FEMALE
            )
        )

        val (genderText, genderIcon) = genderMap[state.gender?.toLowerCase()] ?: Pair("", null)

        genderTextView.apply {
            visible()
            text = genderText
        }

        genderIconCV.apply {
            visible()
            bind {
                imageDrawable = genderIcon
            }
        }
    }