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 DialogFragment
                        

    Common dialog

    • Constructor Summary

      Constructors 
      Constructor Description
      CommonDialog()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Dialog onCreateDialog(@Nullable() Bundle savedInstanceState)
      void onStart()
      View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
      void onResume()
      View getDialogView() This method is only for custom dialogs where the layout changes but the view IDs remain the same.
      View onCreateContentView(ViewGroup container) Override this method in subclasses to create and set a new content layout.
      Bundle getPositiveDatas() Override this method to provide data for the positive button callback.
      Bundle getNegativeDatas() Override this method to provide data for the negative button callback.
      boolean onPositiveClick() Subclasses can override this to handle the positive click internally.
      boolean onNegativeClick() Subclasses can override this to handle the negative click internally.
      int getDialogWidth() Get the dialog width.
      Bundle getExpandParams()
      • 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
    • Constructor Detail

      • CommonDialog

        CommonDialog()
    • Method Detail

      • onCreateDialog

        @NonNull() Dialog onCreateDialog(@Nullable() Bundle savedInstanceState)
      • onCreateView

        @Nullable() View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
      • 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