Created
January 20, 2020 15:24
-
-
Save fluxtah/839903da939eecb621ece4c10405f857 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
companion object { | |
fun getNumbersEnglish(): LiveData<List<String>> { | |
return object : LiveData<List<String>>() { | |
override fun onActive() { | |
GlobalScope.launch(Dispatchers.IO) { | |
delay(500) | |
postValue(listOf("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight")) | |
} | |
} | |
} | |
} | |
fun getNumbersJapanese(): LiveData<List<String>> { | |
return object : LiveData<List<String>>() { | |
override fun onActive() { | |
GlobalScope.launch(Dispatchers.IO) { | |
delay(500) | |
postValue(listOf("ひとつ", "ふたつ", "みっつ", "よっつ", "いつつ", "むっつ", "ななつ", "やっつ")) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment