Created
July 31, 2022 16:21
-
-
Save motorro/c3bd6a80b6a2ad359161a813c3ee59ff to your computer and use it in GitHub Desktop.
Item contents state
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
class ContentState(private val contents: String) : CommonMachineState<LceGesture, LceUiState>() { | |
override fun doStart() { | |
setUiState(LceUiState.Item(contents)) | |
} | |
override fun doProcess(gesture: LceGesture) = when (gesture) { | |
LceGesture.Back -> onBack() | |
else -> Timber.d("Unhandled gesture: %s", gesture) | |
} | |
private fun onBack() { | |
setMachineState(ItemListState()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment