diff --git a/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt b/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt index c79af2a295..b81a622bac 100644 --- a/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/redesign/activities/PNModeActivity.kt @@ -83,7 +83,7 @@ class PNModeActivity : BaseActionBarActivity() { private fun register() { if (selectedOptionView == null) { val dialog = AlertDialog.Builder(this) - dialog.setMessage(R.string.activity_pn_mode_no_option_picked_dialog_title) + dialog.setTitle(R.string.activity_pn_mode_no_option_picked_dialog_title) dialog.setPositiveButton(R.string.ok) { _, _ -> } dialog.create().show() return diff --git a/src/org/thoughtcrime/securesms/loki/redesign/dialogs/PNModeBottomSheet.kt b/src/org/thoughtcrime/securesms/loki/redesign/dialogs/PNModeBottomSheet.kt index 583307e2ac..749d9d5263 100644 --- a/src/org/thoughtcrime/securesms/loki/redesign/dialogs/PNModeBottomSheet.kt +++ b/src/org/thoughtcrime/securesms/loki/redesign/dialogs/PNModeBottomSheet.kt @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms.loki.redesign.dialogs +import android.app.AlertDialog import android.content.DialogInterface import android.graphics.drawable.TransitionDrawable import android.os.Bundle @@ -31,7 +32,7 @@ class PNModeBottomSheet : BottomSheetDialogFragment() { super.onViewCreated(view, savedInstanceState) fcmOptionView.setOnClickListener { toggleFCM() } backgroundPollingOptionView.setOnClickListener { toggleBackgroundPolling() } - confirmButton.setOnClickListener { onConfirmTapped?.invoke(selectedOptionView == fcmOptionView) } + confirmButton.setOnClickListener { confirm() } skipButton.setOnClickListener { onSkipTapped?.invoke() } } @@ -84,4 +85,16 @@ class PNModeBottomSheet : BottomSheetDialogFragment() { } } } + + private fun confirm() { + if (selectedOptionView == null) { + val dialog = AlertDialog.Builder(context) + dialog.setTitle(R.string.sheet_pn_mode_no_option_picked_dialog_title) + dialog.setPositiveButton(R.string.ok) { _, _ -> } + dialog.create().show() + return + } + onConfirmTapped?.invoke(selectedOptionView == fcmOptionView) + } + // endregion } \ No newline at end of file