Unit |
dismiss()
Dismiss the fragment and its dialog. If the fragment was added to the back stack, all back stack state up to and including this entry will be popped. Otherwise, a new transaction will be committed to remove the fragment.
|
Unit |
dismissAllowingStateLoss()
Version of dismiss() that uses FragmentTransaction.commitAllowingStateLoss() . See linked documentation for further details.
|
Dialog? |
getDialog()
Return the Dialog this fragment is currently controlling.
|
Boolean |
getShowsDialog()
Return the current value of setShowsDialog(boolean) .
|
Int |
getTheme()
|
Boolean |
isCancelable()
Return the current value of setCancelable(boolean) .
|
Unit |
onAttach(@NonNull context: Context)
|
Unit |
onCancel(@NonNull dialog: DialogInterface)
|
Unit |
onCreate(@Nullable savedInstanceState: Bundle?)
|
Unit |
onDestroyView()
Remove dialog.
|
Unit |
onDetach()
|
Unit |
onDismiss(@NonNull dialog: DialogInterface)
|
LayoutInflater |
onGetLayoutInflater(@Nullable savedInstanceState: Bundle?)
Returns the LayoutInflater used to inflate Views of this Fragment. The default implementation will throw an exception if the Fragment is not attached.
If this is called from within onCreateDialog(Bundle) , the layout inflater from Fragment#onGetLayoutInflater(Bundle) , without the dialog theme, will be returned.
|
Unit |
onSaveInstanceState(@NonNull outState: Bundle)
|
Unit |
onStart()
|
Unit |
onStop()
|
Unit |
onViewStateRestored(@Nullable savedInstanceState: Bundle?)
|
Dialog |
requireDialog()
Return the Dialog this fragment is currently controlling.
|
Unit |
setCancelable(cancelable: Boolean)
Control whether the shown Dialog is cancelable. Use this instead of directly calling Dialog.setCancelable(boolean) , because DialogFragment needs to change its behavior based on this.
|
Unit |
setShowsDialog(showsDialog: Boolean)
Controls whether this fragment should be shown in a dialog. If not set, no Dialog will be created and the fragment's view hierarchy will thus not be added to it. This allows you to instead use it as a normal fragment (embedded inside of its activity).
This is normally set for you based on whether the fragment is associated with a container view ID passed to FragmentTransaction.add(int, Fragment) . If the fragment was added with a container, setShowsDialog will be initialized to false; otherwise, it will be true.
If calling this manually, it should be called in onCreate(Bundle) as calling it any later will have no effect.
|
Unit |
setStyle(style: Int, @StyleRes theme: Int)
Call to customize the basic appearance and behavior of the fragment's dialog. This can be used for some common dialog behaviors, taking care of selecting flags, theme, and other options for you. The same effect can be achieve by manually setting Dialog and Window attributes yourself. Calling this after the fragment's Dialog is created will have no effect.
|
Unit |
show(@NonNull manager: FragmentManager, @Nullable tag: String?)
Display the dialog, adding the fragment to the given FragmentManager. This is a convenience for explicitly creating a transaction, adding the fragment to it with the given tag, and committing it. This does not add the transaction to the fragment back stack. When the fragment is dismissed, a new transaction will be executed to remove it from the activity.
|
Int |
show(@NonNull transaction: FragmentTransaction, @Nullable tag: String?)
Display the dialog, adding the fragment using an existing transaction and then committing the transaction.
|
Unit |
showNow(@NonNull manager: FragmentManager, @Nullable tag: String?)
Display the dialog, immediately adding the fragment to the given FragmentManager. This is a convenience for explicitly creating a transaction, adding the fragment to it with the given tag, and calling FragmentTransaction#commitNow() . This does not add the transaction to the fragment back stack. When the fragment is dismissed, a new transaction will be executed to remove it from the activity.
|