Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

DialogFragment

open class DialogFragment : Fragment, OnCancelListener, OnDismissListener
kotlin.Any
   ↳ androidx.fragment.app.Fragment
   ↳ androidx.fragment.app.DialogFragment

Static library support version of the framework's android.app.DialogFragment. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

Summary

Constants
static Int

Style for setStyle(int, int): a basic, normal dialog.

static Int

Style for setStyle(int, int): don't draw any frame at all; the view hierarchy returned by onCreateView is entirely responsible for drawing the dialog.

static Int

Style for setStyle(int, int): like STYLE_NO_FRAME, but also disables all input to the dialog.

static Int

Style for setStyle(int, int): don't include a title area.

Public constructors

Constructor used by the default FragmentFactory.

<init>(@LayoutRes contentLayoutId: Int)

Alternate constructor that can be called from your default, no argument constructor to provide a default layout that will be inflated by onCreateView(LayoutInflater, ViewGroup, Bundle).

Public methods
open Unit

Dismiss the fragment and its dialog.

open Unit

Version of dismiss() that uses FragmentTransaction.commitAllowingStateLoss().

open Dialog?

Return the Dialog this fragment is currently controlling.

open Boolean

Return the current value of setShowsDialog(boolean).

open Int

open Boolean

Return the current value of setCancelable(boolean).

open Unit
onAttach(@NonNull context: Context)

open Unit
onCancel(@NonNull dialog: DialogInterface)

open Unit
onCreate(@Nullable savedInstanceState: Bundle?)

open Dialog
onCreateDialog(@Nullable savedInstanceState: Bundle?)

Override to build your own custom Dialog container.

open Unit

Remove dialog.

open Unit

open Unit
onDismiss(@NonNull dialog: DialogInterface)

open LayoutInflater
onGetLayoutInflater(@Nullable savedInstanceState: Bundle?)

Returns the LayoutInflater used to inflate Views of this Fragment.

open Unit
onSaveInstanceState(@NonNull outState: Bundle)

open Unit

open Unit

open Unit
onViewStateRestored(@Nullable savedInstanceState: Bundle?)

Dialog

Return the Dialog this fragment is currently controlling.

open Unit
setCancelable(cancelable: Boolean)

Control whether the shown Dialog is cancelable.

open Unit
setShowsDialog(showsDialog: Boolean)

Controls whether this fragment should be shown in a dialog.

open Unit
setStyle(style: Int, @StyleRes theme: Int)

Call to customize the basic appearance and behavior of the fragment's dialog.

open Unit
show(@NonNull manager: FragmentManager, @Nullable tag: String?)

Display the dialog, adding the fragment to the given FragmentManager.

open Int
show(@NonNull transaction: FragmentTransaction, @Nullable tag: String?)

Display the dialog, adding the fragment using an existing transaction and then committing the transaction.

open Unit
showNow(@NonNull manager: FragmentManager, @Nullable tag: String?)

Display the dialog, immediately adding the fragment to the given FragmentManager.

Inherited functions