Skip to content

Instantly share code, notes, and snippets.

@veena14cs
Created October 15, 2019 06:10
Show Gist options
  • Save veena14cs/261e76531c31711b1ae7bb907a90dc4a to your computer and use it in GitHub Desktop.
Save veena14cs/261e76531c31711b1ae7bb907a90dc4a to your computer and use it in GitHub Desktop.
private fun subscribeToCurrentState() {
ephemeralStateLiveData.observe(fragment, Observer<EphemeralState> { result ->
logger.d("StateFragment", "getCurrentState: ${result.state.name}")
val customizationArgsMap: Map<String, InteractionObject> = result.state.interaction.customizationArgsMap
val allKeys: Set<String> = customizationArgsMap.keys
for (key in allKeys) {
logger.d("StateFragment", key)
}
if (customizationArgsMap.contains("choices")) {
val customizationArgs: InteractionObject? = customizationArgsMap.get("choices")
val stringList :StringList= customizationArgs!!.setOfHtmlString
logger.d("StateFragment", "value: ${stringList.htmlCount}")
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment