ComponentDialog


public class ComponentDialog extends Dialog implements LifecycleOwner, OnBackPressedDispatcherOwner, SavedStateRegistryOwner

Known direct subclasses
AppCompatDialog

Base class for AppCompat themed android.app.Dialogs.

Known indirect subclasses
AlertDialog

A subclass of Dialog that can display one, two or three buttons.

MediaRouteChooserDialog

This class implements the route chooser dialog for MediaRouter.

MediaRouteControllerDialog

This class implements the route controller dialog for MediaRouter.


Base class for dialogs that enables composition of higher level components.

Summary

Public constructors

ComponentDialog(@NonNull Context context, @StyleRes int themeResId)

Public methods

void
@NonNull Lifecycle
final @NonNull OnBackPressedDispatcher

The OnBackPressedDispatcher that should handle the system back button.

@NonNull SavedStateRegistry
void

Sets the view tree owners before setting the content view so that the inflation process and attach listeners will see them already present.

void
@NonNull Bundle
void
setContentView(int layoutResID)
void
void

Protected methods

void
@CallSuper
onCreate(Bundle savedInstanceState)
void
void

Inherited methods

From android.app.Dialog
void
void
void
void
boolean
boolean
boolean
boolean
boolean
boolean
@NonNull T
<T extends View> findViewById(int p0)
@Nullable ActionBar
final @NonNull Context
@Nullable View
@NonNull LayoutInflater
@NonNull OnBackInvokedDispatcher
final @Nullable Activity
final @Nullable SearchEvent
final int
@Nullable Window
void
void
boolean
void
void
void
void
boolean
void
void
boolean
boolean
View
void
boolean
boolean
onKeyDown(int p0, @NonNull KeyEvent p1)
boolean
boolean
onKeyMultiple(int p0, int p1, @NonNull KeyEvent p2)
boolean
boolean
onKeyUp(int p0, @NonNull KeyEvent p1)
boolean
boolean
onMenuOpened(int p0, @NonNull Menu p1)
boolean
void
void
onPanelClosed(int p0, @NonNull Menu p1)
boolean
boolean
onPreparePanel(int p0, @Nullable View p1, @NonNull Menu p2)
void
boolean
boolean
boolean
boolean
void
void
ActionMode
ActionMode
void
void
void
final boolean
final @NonNull T
<T extends View> requireViewById(int p0)
void
void
setCancelable(boolean p0)
void
void
final void
final void
setFeatureDrawableAlpha(int p0, int p1)
final void
setFeatureDrawableResource(int p0, int p1)
final void
void
void
void
void
final void
void
void
setTitle(int p0)
final void
void
void
takeKeyEvents(boolean p0)
void
From android.view.Window.Callback
void
void

Public constructors

ComponentDialog

Added in 1.5.0
public ComponentDialog(@NonNull Context context, @StyleRes int themeResId)

Public methods

addContentView

public void addContentView(@NonNull View view, ViewGroup.LayoutParams params)

getLifecycle

Added in 1.5.0
public @NonNull Lifecycle getLifecycle()

getOnBackPressedDispatcher

Added in 1.10.0-beta01
public final @NonNull OnBackPressedDispatcher getOnBackPressedDispatcher()

The OnBackPressedDispatcher that should handle the system back button.

getSavedStateRegistry

Added in 1.7.0
public @NonNull SavedStateRegistry getSavedStateRegistry()

initializeViewTreeOwners

Added in 1.8.0
@CallSuper
public void initializeViewTreeOwners()

Sets the view tree owners before setting the content view so that the inflation process and attach listeners will see them already present.

onBackPressed

Added in 1.6.0
@CallSuper
public void onBackPressed()

onSaveInstanceState

public @NonNull Bundle onSaveInstanceState()

setContentView

public void setContentView(int layoutResID)

setContentView

public void setContentView(@NonNull View view)

setContentView

public void setContentView(@NonNull View view, ViewGroup.LayoutParams params)

Protected methods

onCreate

@CallSuper
protected void onCreate(Bundle savedInstanceState)

onStart

@CallSuper
protected void onStart()

onStop

@CallSuper
protected void onStop()