Created
February 2, 2021 08:05
-
-
Save FareesHussain/5c4a36c276f94e9ce55586ea4019e8af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Language item view model for the recycler view in [AppLanguageFragment] and | |
* [AudioLanguageFragment]. | |
*/ | |
class LanguageItemViewModel( | |
val language: String, | |
private val selectedLanguage: LiveData<String>, | |
val languageRadioButtonListener: LanguageRadioButtonListener | |
) : ObservableViewModel() { | |
val isLanguageSelected: LiveData<Boolean> by lazy { | |
Transformations.map(selectedLanguage) { it == language } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment