Class CommonDialog
-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.view.View.OnCreateContextMenuListener,androidx.activity.result.ActivityResultCaller,androidx.lifecycle.HasDefaultViewModelProviderFactory,androidx.lifecycle.LifecycleOwner,androidx.lifecycle.ViewModelStoreOwner,androidx.savedstate.SavedStateRegistryOwner
public class CommonDialog extends DialogFragmentCommon dialog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceCommonDialog.OnDialogButtonClickListenerpublic classCommonDialog.BuilderSubclasses of CommonDialog should extend this Builder and override getCurrentDialog to return the subclass dialog instance.
-
Field Summary
Fields Modifier and Type Field Description public final static intSTYLE_NORMALpublic final static intSTYLE_NO_TITLEpublic final static intSTYLE_NO_FRAMEpublic final static intSTYLE_NO_INPUT
-
Constructor Summary
Constructors Constructor Description CommonDialog()
-
Method Summary
Modifier and Type Method Description DialogonCreateDialog(@Nullable() Bundle savedInstanceState)voidonStart()ViewonCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)voidonResume()ViewgetDialogView()This method is only for custom dialogs where the layout changes but the view IDs remain the same. ViewonCreateContentView(ViewGroup container)Override this method in subclasses to create and set a new content layout. BundlegetPositiveDatas()Override this method to provide data for the positive button callback. BundlegetNegativeDatas()Override this method to provide data for the negative button callback. booleanonPositiveClick()Subclasses can override this to handle the positive click internally. booleanonNegativeClick()Subclasses can override this to handle the negative click internally. intgetDialogWidth()Get the dialog width. BundlegetExpandParams()-
Methods inherited from class androidx.fragment.app.DialogFragment
dismiss, dismissAllowingStateLoss, getDialog, getShowsDialog, getTheme, isCancelable, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStop, onViewStateRestored, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNow -
Methods inherited from class androidx.fragment.app.Fragment
dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getDefaultViewModelProviderFactory, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getParentFragmentManager, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityCreated, onActivityResult, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onViewCreated, postponeEnterTransition, registerForActivityResult, registerForContextMenu, requestPermissions, requireActivity, requireArguments, requireContext, requireFragmentManager, requireHost, requireParentFragment, requireView, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setInitialSavedState, setMenuVisibility, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu -
Methods inherited from class androidx.lifecycle.HasDefaultViewModelProviderFactory
getDefaultViewModelCreationExtras -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
onCreateDialog
@NonNull() Dialog onCreateDialog(@Nullable() Bundle savedInstanceState)
-
onStart
void onStart()
-
onCreateView
@Nullable() View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
-
onResume
void onResume()
-
getDialogView
View getDialogView()
This method is only for custom dialogs where the layout changes but the view IDs remain the same.
- Returns:
custom dialog view, or null to use the default layout
-
onCreateContentView
View onCreateContentView(ViewGroup container)
Override this method in subclasses to create and set a new content layout.
- Returns:
custom content view, or null to use the default
-
getPositiveDatas
Bundle getPositiveDatas()
Override this method to provide data for the positive button callback.
- Returns:
data bundle for the positive button callback
-
getNegativeDatas
Bundle getNegativeDatas()
Override this method to provide data for the negative button callback.
- Returns:
data bundle for the negative button callback
-
onPositiveClick
boolean onPositiveClick()
Subclasses can override this to handle the positive click internally. Return true to intercept and prevent the external click listener from being invoked.
- Returns:
true to intercept, false otherwise
-
onNegativeClick
boolean onNegativeClick()
Subclasses can override this to handle the negative click internally. Return true to intercept and prevent the external click listener from being invoked.
- Returns:
true to intercept, false otherwise
-
getDialogWidth
int getDialogWidth()
Get the dialog width. Override this method to set a custom width. Default is nearly full-screen.
- Returns:
dialog width in pixels, or 0 for default
-
getExpandParams
Bundle getExpandParams()
-
-
-
-