Adjusted SS-64 so that all Block / Unblock buttons now use that text and are displayed in red

This commit is contained in:
alansley 2024-08-21 13:53:58 +10:00
parent 2192c2c007
commit 69f6818f99
5 changed files with 8 additions and 9 deletions

View File

@ -1242,10 +1242,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
.put(NAME_KEY, recipient.name) .put(NAME_KEY, recipient.name)
.format() .format()
) )
dangerButton( dangerButton(R.string.blockUnblock, R.string.AccessibilityId_unblockConfirm) {
R.string.blockUnblock,
R.string.AccessibilityId_unblockConfirm
) {
viewModel.unblock() viewModel.unblock()
// Unblock confirmation toast added as per SS-64 // Unblock confirmation toast added as per SS-64

View File

@ -33,7 +33,7 @@ class BlockedDialog(private val recipient: Recipient, private val context: Conte
title(resources.getString(R.string.blockUnblock)) title(resources.getString(R.string.blockUnblock))
text(spannable) text(spannable)
button(R.string.blockUnblock) { unblock() } dangerButton(R.string.blockUnblock,R.string.AccessibilityId_unblockConfirm) { unblock() }
cancelButton { dismiss() } cancelButton { dismiss() }
} }

View File

@ -617,7 +617,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
text(Phrase.from(context, R.string.blockDescription) text(Phrase.from(context, R.string.blockDescription)
.put(NAME_KEY, thread.recipient.name) .put(NAME_KEY, thread.recipient.name)
.format()) .format())
button(R.string.block) { dangerButton(R.string.block, R.string.AccessibilityId_blockConfirm) {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
storage.setBlocked(listOf(thread.recipient), true) storage.setBlocked(listOf(thread.recipient), true)
@ -637,7 +637,7 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
showSessionDialog { showSessionDialog {
title(R.string.blockUnblock) title(R.string.blockUnblock)
text(Phrase.from(context, R.string.blockUnblockName).put(NAME_KEY, thread.recipient.name).format()) text(Phrase.from(context, R.string.blockUnblockName).put(NAME_KEY, thread.recipient.name).format())
button(R.string.blockUnblock) { dangerButton(R.string.blockUnblock, R.string.AccessibilityId_unblockConfirm) {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
storage.setBlocked(listOf(thread.recipient), false) storage.setBlocked(listOf(thread.recipient), false)
withContext(Dispatchers.Main) { withContext(Dispatchers.Main) {

View File

@ -89,7 +89,9 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat
text(Phrase.from(context, R.string.blockDescription) text(Phrase.from(context, R.string.blockDescription)
.put(NAME_KEY, thread.recipient.name) .put(NAME_KEY, thread.recipient.name)
.format()) .format())
button(R.string.block) { doBlock() } dangerButton(R.string.block, R.string.AccessibilityId_blockConfirm) {
doBlock()
}
button(R.string.no) button(R.string.no)
} }
} }

View File

@ -70,7 +70,7 @@ class BlockedContactsActivity: PassphraseRequiredActionBarActivity() {
} }
text(txt) text(txt)
button(R.string.theContinue) { dangerButton(R.string.blockUnblock, R.string.AccessibilityId_unblockConfirm) {
// Show individual toasts for each unblocked user (we don't have suitable strings to do it as a single toast) // Show individual toasts for each unblocked user (we don't have suitable strings to do it as a single toast)
val contactsToUnblockNames = contactsToUnblock.map { it.name } val contactsToUnblockNames = contactsToUnblock.map { it.name }
val toastStrings = mutableListOf<String>() val toastStrings = mutableListOf<String>()