Skip to content

SimpleCheckDialog

Philipp Niedermayer edited this page Mar 4, 2017 · 20 revisions

CheckBox dialog

extends CustomViewDialog

A dialog with a checkbox.

Building dialogs

Example

SimpleCheckDialog.build()
            .title(R.string.terms_and_conditions)
            .msgHtml(R.string.terms_text_html)
            .label(R.string.read_and_accepted)
            .checkRequired(true)
            .pos(R.string.accept)
            .neut()
            .cancelable(false)
            .show(Activity.this, TERMS_DIALOG);

Available customizations

  • Checkbox label
    java .label(String title), .label(int resId)
  • Checkbox initial state
    .check(boolean checked)
  • Required flag
    .checkRequired(boolean required)
    If set to true, the positive button will be disabled as long as the checkbox is not checked.

Receiving results

The Bundle returned from this dialog will contain the following extras

boolean CHECKED    // Weather the checkbox was finally checked