private Pair<AlertDialog, SimpleDialogViewBinding> constructCommons(final Consumer<Editable> searchListener) {


        final AlertDialog.Builder builder = Dialogs.newBuilder(getContext());
        if (title != null) {
            builder.setTitle(this.title.getText(context));
        }

        //create buttons here, but with empty listener. This disables auto-dismiss functions
        if (positiveButton != null) {
            builder.setPositiveButton(getPositiveButton(), null);
        }
        if (negativeButton != null) {
            builder.setNegativeButton(getNegativeButton(), null);
        }
        if (neutralButton != null) {
            builder.setNeutralButton(getNeutralButton(), null);
        }

        builder.setCancelable(true);

        final AlertDialog dialog = builder.create();

        final SimpleDialogViewBinding binding = SimpleDialogViewBinding.inflate(LayoutInflater.from(context));
        dialog.setView(binding.getRoot());

        if (this.title != null || searchListener != null) {
            final TextParam usedTitle = this.title == null ? TextParam.text("") : this.title;
            final SimpleDialogTitleViewBinding titleView = SimpleDialogTitleViewBinding.inflate(LayoutInflater.from(context));
            dialog.setCustomTitle(titleView.getRoot());
            usedTitle.applyTo(titleView.dialogTitle);

            if (searchListener != null) {
                setupSearchTitle(titleView, searchListener);
            }
        }
        if (this.message != null) {
            binding.dialogMessage.setVisibility(View.VISIBLE);
            this.message.applyTo(binding.dialogMessage);
        } else {
            binding.dialogMessage.setVisibility(View.GONE);
        }

        return new Pair<>(dialog, binding);
    }
Sets an action to execute when neutral button is clicked
main/src/main/java/cgeo/geocaching/ui/dialog/SimpleDialog.java