Material dialog library - prevent dismissing/closing the dialog on onPositive function call

Add autoDismiss(false) and dismiss the dialog manually in callback method.

  new MaterialDialog.Builder(mainActivity)
            .title(R.string.title)
            .autoDismiss(false)
            .content(R.string.content)
            .positiveText(R.string.positive)
            .negativeText(R.string.negative)
            .positiveColor(setColor())
            .onPositive((dialog, which) => {
                // do something positive here
                dialog.dismiss();
            })
            .onNegative((dialog, which) => {
                // do something negative here
                dialog.dismiss();
            })
            .negativeColor(setColor())
            .typeface(titleAndActions, contentAndListItems)
            .build()
            .show();