This commit is contained in:
Mygod
2020-03-02 11:14:30 +08:00
parent 418618eecb
commit caa7b28b5c
2 changed files with 4 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ abstract class AlertDialogFragment<Arg : Parcelable, Ret : Parcelable> :
}
protected abstract fun AlertDialog.Builder.prepare(listener: DialogInterface.OnClickListener)
protected val arg by lazy { arguments!!.getParcelable<Arg>(KEY_ARG)!! }
protected val arg by lazy { requireArguments().getParcelable<Arg>(KEY_ARG)!! }
protected open val ret: Ret? get() = null
fun withArg(arg: Arg) = apply { arguments = Bundle().apply { putParcelable(KEY_ARG, arg) } }