diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/ConfirmationDialogFragment.kt b/app/src/main/java/com/owncloud/android/ui/dialog/ConfirmationDialogFragment.kt index 20dd1b943c..d0fd56c1e0 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/ConfirmationDialogFragment.kt +++ b/app/src/main/java/com/owncloud/android/ui/dialog/ConfirmationDialogFragment.kt @@ -75,11 +75,16 @@ open class ConfirmationDialogFragment : DialogFragment(), Injectable { val message = getString(messageId, *messageArguments) val builder = MaterialAlertDialogBuilder(requireActivity()) - .setTitle(if (titleId == 0) { R.string.dialog_alert_title } else { titleId }) .setIcon(com.owncloud.android.R.drawable.ic_warning) .setIconAttribute(R.attr.alertDialogIcon) .setMessage(message) + if (titleId == 0) { + builder.setTitle(R.string.dialog_alert_title) + } else if (titleId != -1) { + builder.setTitle(titleId) + } + if (positiveButtonTextId != -1) { builder.setPositiveButton(positiveButtonTextId) { dialog: DialogInterface, _: Int -> mListener?.onConfirmation(tag)