Created
January 25, 2018 04:51
-
-
Save n8ebel/610848d820d7118d9c73941ed0549f61 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
// Indicate the the screen should be closed | |
class ImageViewModel() : BaseViewModel() { | |
@BoundMethod | |
fun onExitFullscreenClicked() { | |
lifecycleState.set(FinishedOk) | |
} | |
} | |
// indicate that the screen should be finished and a result is returned | |
class LessonViewModel() : BaseViewModel() { | |
var currentlySelectedId = 0 | |
... | |
@BoundMethod | |
fun onSelectClicked() { | |
lifecycleState.set(FinishedWithResult( | |
RESULT_LESSON_SELECTED, | |
Intent().apply { putExtra("selectedId", currentlySelectedId) } | |
)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment