Class SimpleCheckDialog

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, androidx.activity.result.ActivityResultCaller, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

public class SimpleCheckDialog extends CustomViewDialog<SimpleCheckDialog>
An simple dialog with a checkbox that can be set as required before proceeding Created by eltos on 14.10.2015.
  • Field Details

  • Constructor Details

    • SimpleCheckDialog

      public SimpleCheckDialog()
  • Method Details

    • build

      public static SimpleCheckDialog build()
    • check

      public SimpleCheckDialog check(boolean preset)
      Sets the initial check state
      Parameters:
      preset - checkbox initial state
      Returns:
      this instance
    • label

      public SimpleCheckDialog label(CharSequence checkBoxLabel)
      Sets the checkbox's label
      Parameters:
      checkBoxLabel - the label as string
      Returns:
      this instance
    • label

      public SimpleCheckDialog label(@StringRes int checkBoxLabelResourceId)
      Sets the checkbox's label
      Parameters:
      checkBoxLabelResourceId - the label as android string resource
      Returns:
      this instance
    • checkRequired

      public SimpleCheckDialog checkRequired(boolean required)
      Whether the check is required. The positive button will be disabled until the checkbox got checked
      Parameters:
      required - whether checking the checkbox is required
      Returns:
      this instance
    • onCreateContentView

      public android.view.View onCreateContentView(android.os.Bundle savedInstanceState)
      Description copied from class: CustomViewDialog
      Inflate your custom view here.
      Specified by:
      onCreateContentView in class CustomViewDialog<SimpleCheckDialog>
      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.
    • onDialogShown

      protected void onDialogShown()
      Description copied from class: CustomViewDialog
      Overwrite this method to take action once the dialog is shown such as settings an input focus, showing the keyboard or setting the initial positiveButtonState
      Overrides:
      onDialogShown in class CustomViewDialog<SimpleCheckDialog>
    • onResult

      public 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<SimpleCheckDialog>
      Parameters:
      which - see SimpleDialog.OnDialogResultListener
      Returns:
      the bundle to merge with the results or null
    • onSaveInstanceState

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