Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Last active February 15, 2020 07:30
Show Gist options
  • Save arkivanov/0394e67d6c220f48b2d557af6d446cbd to your computer and use it in GitHub Desktop.
Save arkivanov/0394e67d6c220f48b2d557af6d446cbd to your computer and use it in GitHub Desktop.
Fragment tree with inputs and outputs
class FragmentWithDialog(output: (Output) -> Unit) : Fragment() {
sealed class Output {
object DialogShown : Output()
}
}
class FragmentWithInput(input: Observable<Input>) : Fragment() {
sealed class Input {
object HideKeyboard : Input()
}
}
class FragmentWithDialogAndInput : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Add fragments to childFragmentManager and wire them
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment