Class MonthYearPicker

  • All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnDismissListener, android.view.View.OnCreateContextMenuListener, android.widget.NumberPicker.OnValueChangeListener, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

    public class MonthYearPicker
    extends androidx.fragment.app.DialogFragment
    implements android.widget.NumberPicker.OnValueChangeListener
    MonthYearPicker is a widget for selecting the month and year. Allows the selection of month and year.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class androidx.fragment.app.Fragment

        androidx.fragment.app.Fragment.InstantiationException, androidx.fragment.app.Fragment.SavedState
    • Field Summary

      • Fields inherited from class androidx.fragment.app.DialogFragment

        STYLE_NO_FRAME, STYLE_NO_INPUT, STYLE_NO_TITLE, STYLE_NORMAL
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      android.app.Dialog onCreateDialog​(android.os.Bundle savedInstanceState)  
      void onValueChange​(android.widget.NumberPicker picker, int oldVal, int newVal)  
      void setListener​(android.app.DatePickerDialog.OnDateSetListener listener)
      Registers the OnDateSetListener for this dialog fragment.
      void setMonth​(int month)
      Sets the month.
      void setYear​(int year)
      Sets the year.
      • Methods inherited from class androidx.fragment.app.DialogFragment

        dismiss, dismissAllowingStateLoss, getDialog, getShowsDialog, getTheme, isCancelable, onActivityCreated, onAttach, onCancel, onCreate, onDestroyView, onDetach, onDismiss, onGetLayoutInflater, onSaveInstanceState, onStart, onStop, requireDialog, setCancelable, setShowsDialog, setStyle, setupDialog, show, show, showNow
      • Methods inherited from class androidx.fragment.app.Fragment

        dump, equals, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getArguments, getChildFragmentManager, getContext, getEnterTransition, getExitTransition, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSavedStateRegistry, getSharedElementEnterTransition, getSharedElementReturnTransition, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hashCode, hasOptionsMenu, instantiate, instantiate, isAdded, isDetached, isHidden, isInLayout, isMenuVisible, isRemoving, isResumed, isStateSaved, isVisible, onActivityResult, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onCreateView, onDestroy, onDestroyOptionsMenu, onHiddenChanged, onInflate, onInflate, onLowMemory, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPause, onPictureInPictureModeChanged, onPrepareOptionsMenu, onPrimaryNavigationFragmentChanged, onRequestPermissionsResult, onResume, onViewCreated, onViewStateRestored, postponeEnterTransition, postponeEnterTransition, 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, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MonthYearPicker

        public MonthYearPicker()
        Constructor for MonthYearPicker
    • Method Detail

      • setListener

        public void setListener​(android.app.DatePickerDialog.OnDateSetListener listener)
        Registers the OnDateSetListener for this dialog fragment.
        Parameters:
        listener - callback for date picker actions
      • setMonth

        public void setMonth​(int month)
        Sets the month.
        Parameters:
        month - month value
      • setYear

        public void setYear​(int year)
        Sets the year.
        Parameters:
        year - year value
      • onCreateDialog

        public android.app.Dialog onCreateDialog​(android.os.Bundle savedInstanceState)
        Overrides:
        onCreateDialog in class androidx.fragment.app.DialogFragment
      • onValueChange

        public void onValueChange​(android.widget.NumberPicker picker,
                                  int oldVal,
                                  int newVal)
        Specified by:
        onValueChange in interface android.widget.NumberPicker.OnValueChangeListener