From 0d158b62e44908bbf80b72a430ae2a3160771b7b Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 16 Sep 2024 09:29:19 +1000 Subject: [PATCH] Cleaning up modals for platform consistency --- .../conversation/v2/ConversationActivityV2.kt | 17 +++++++++++++---- .../messagerequests/MessageRequestsActivity.kt | 7 ++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index 089461c706..c7d1304266 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -949,11 +949,20 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe block(deleteThread = true) } binding.declineMessageRequestButton.setOnClickListener { - viewModel.declineMessageRequest() - lifecycleScope.launch(Dispatchers.IO) { - ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(this@ConversationActivityV2) + fun doDecline() { + viewModel.declineMessageRequest() + lifecycleScope.launch(Dispatchers.IO) { + ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(this@ConversationActivityV2) + } + finish() + } + + showSessionDialog { + title(R.string.delete) + text(resources.getString(R.string.messageRequestsDelete)) + dangerButton(R.string.delete) { doDecline() } + button(R.string.cancel) } - finish() } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt index 93f79d2b16..4d280a47ad 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt @@ -108,7 +108,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat showSessionDialog { title(R.string.delete) text(resources.getString(R.string.messageRequestsDelete)) - button(R.string.delete) { doDecline() } + dangerButton(R.string.delete) { doDecline() } button(R.string.cancel) } } @@ -129,9 +129,10 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat } showSessionDialog { + title(resources.getString(R.string.clearAll)) text(resources.getString(R.string.messageRequestsClearAllExplanation)) - button(R.string.yes) { doDeleteAllAndBlock() } - button(R.string.no) + dangerButton(R.string.clear) { doDeleteAllAndBlock() } + button(R.string.cancel) } } }