Class SimpleTimeDialog

java.lang.Object
androidx.fragment.app.Fragment
androidx.fragment.app.DialogFragment
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnDismissListener, android.view.View.OnCreateContextMenuListener, android.widget.TimePicker.OnTimeChangedListener, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

public class SimpleTimeDialog extends CustomViewDialog<SimpleTimeDialog> implements android.widget.TimePicker.OnTimeChangedListener
A time-picker dialog Created by eltos on 02.02.2017.
  • Field Details

  • Constructor Details

    • SimpleTimeDialog

      public SimpleTimeDialog()
  • Method Details

    • build

      public static SimpleTimeDialog build()
    • hour

      public SimpleTimeDialog hour(int hour)
      Specify the initially set hour
      Parameters:
      hour - initial hour (0-23)
      Returns:
      this instance
    • minute

      public SimpleTimeDialog minute(int minute)
      Specify the initially set minute
      Parameters:
      minute - initial minute (0-59)
      Returns:
      this instance
    • set24HourView

      public SimpleTimeDialog set24HourView(boolean view24Hour)
      Changes the hour display mode between 24 and AM/PM
      Parameters:
      view24Hour - true to use 24 hour mode, false to use AM/PM
      Returns:
      this instance
    • onCreateContentView

      protected android.view.View onCreateContentView(android.os.Bundle savedInstanceState)
      Description copied from class: CustomViewDialog
      Inflate your custom view here.
      Specified by:
      onCreateContentView in class CustomViewDialog<SimpleTimeDialog>
      Parameters:
      savedInstanceState - The last saved instance state of the Fragment, or null if this fragment is created for the first time.
      Returns:
      Return a new View to be displayed by the Fragment.
    • onTimeChanged

      public void onTimeChanged(android.widget.TimePicker view, int hourOfDay, int minute)
      Specified by:
      onTimeChanged in interface android.widget.TimePicker.OnTimeChangedListener
    • onSaveInstanceState

      public void onSaveInstanceState(android.os.Bundle outState)
      Overrides:
      onSaveInstanceState in class androidx.fragment.app.DialogFragment
    • onResult

      protected android.os.Bundle onResult(int which)
      Description copied from class: CustomViewDialog
      Overwrite this method to provide additional results from your custom view to be passed to the SimpleDialog.OnDialogResultListener.onResult(java.lang.String, int, android.os.Bundle)
      Overrides:
      onResult in class CustomViewDialog<SimpleTimeDialog>
      Parameters:
      which - see SimpleDialog.OnDialogResultListener
      Returns:
      the bundle to merge with the results or null