Created
November 5, 2022 21:15
-
-
Save k0siara/e46f13bcae015a98e34075d91e328bfc to your computer and use it in GitHub Desktop.
NoticeDialogFragment.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 NoticeDialogFragment : DialogFragment() { | |
internal lateinit var listener: NoticeDialogListener | |
interface NoticeDialogListener { | |
fun onDialogPositiveClick(dialog: DialogFragment) | |
fun onDialogNegativeClick(dialog: DialogFragment) | |
} | |
override fun onAttach(context: Context) { | |
super.onAttach(context) | |
try { | |
listener = context as NoticeDialogListener | |
} catch (e: ClassCastException) { | |
throw ... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment