Created
November 5, 2022 21:17
-
-
Save k0siara/36426d425bb51fa9eb118c12e5c0dcc5 to your computer and use it in GitHub Desktop.
ActivityHandling3Dialogs.kt
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 MainActivity : FragmentActivity(), | |
NoticeDialogFragment.NoticeDialogListener, | |
SecondDialogFragment.Listener, | |
ThirdDialogFragment.Listener { | |
private val viewModel by ... | |
fun showNoticeDialog() { | |
val dialog = NoticeDialogFragment() | |
dialog.show(supportFragmentManager, "NoticeDialogFragment") | |
} | |
fun showSecondDialog() { ... } | |
fun showThirdDialog() { ... } | |
override fun onDialogPositiveClick(dialog: DialogFragment) { | |
viewModel.onNoticePositiveClicked() | |
} | |
override fun onDialogNegativeClick(dialog: DialogFragment) { | |
viewModel.onNoticeNegativeClicked() | |
} | |
override fun onSecondDialogItemSelected(item: Item) { | |
viewModel.onItemSelected(item) | |
} | |
override fun onSecondDialogCancelled() { | |
viewModel.onItemSelectionCancelled() | |
} | |
override fun onThirdDialogButtonClicked() { | |
viewModel.onStartSomething() | |
} | |
override fun onThirdDialogFilterChanged(filter: Filter) { | |
viewModel.onFilterChanged(filter) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment