From f6b62565989fa78b493c48a8a8efe9b9284c29d9 Mon Sep 17 00:00:00 2001 From: alansley Date: Tue, 20 Aug 2024 14:44:25 +1000 Subject: [PATCH] Minor cleanup of BlockedContactsActivity --- .../securesms/preferences/BlockedContactsActivity.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsActivity.kt index 85e35f443d..41aa5d5a57 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/preferences/BlockedContactsActivity.kt @@ -27,7 +27,7 @@ class BlockedContactsActivity: PassphraseRequiredActionBarActivity() { val adapter: BlockedContactsAdapter by lazy { BlockedContactsAdapter(viewModel) } // Method to show a sequence of toasts one after the other - fun showToastSequence(toastStrings: List, toastLengthSetting: Int,context: Context) { + private fun showToastSequence(toastStrings: List, toastLengthSetting: Int,context: Context) { val handler = Handler(Looper.getMainLooper()) val delayStepMilliseconds = when (toastLengthSetting) { @@ -46,17 +46,11 @@ class BlockedContactsActivity: PassphraseRequiredActionBarActivity() { } } - fun unblock() { + private fun unblock() { showSessionDialog { title(viewModel.getTitle(this@BlockedContactsActivity)) - val contactsToUnblock = viewModel.state.selectedItems - - // Get the names of each person to unblock for later user in the toast(s) - // Note: We must do this before `viewModel.unblock` - //val contactsToUnblockNames = contactsToUnblock.map { it.name } - val numContactsToUnblock = contactsToUnblock.size val txt = when (numContactsToUnblock) { // Note: We do not have to handle 0 because if no contacts are chosen then the unblock button is deactivated @@ -74,7 +68,6 @@ class BlockedContactsActivity: PassphraseRequiredActionBarActivity() { .format().toString() } } - text(txt) button(R.string.theContinue) { @@ -108,6 +101,5 @@ class BlockedContactsActivity: PassphraseRequiredActionBarActivity() { } binding.unblockButton.setOnClickListener { unblock() } - } }