minor code reformatting at number blocking confirmation

This commit is contained in:
tibbi 2020-05-23 19:03:14 +02:00
parent 3ac08e2b21
commit e8f6ec3eb2
2 changed files with 5 additions and 6 deletions

View File

@ -326,10 +326,9 @@ class ThreadActivity : SimpleActivity() {
}
private fun blockNumber() {
val baseString = R.string.block_confirmation
val numbers = participants.map { it.phoneNumber }.toTypedArray()
val numbers = participants.map { it.phoneNumber }
val numbersString = TextUtils.join(", ", numbers)
val question = String.format(resources.getString(baseString), numbersString)
val question = String.format(resources.getString(R.string.block_confirmation), numbersString)
ConfirmationDialog(this, question) {
ensureBackgroundThread {

View File

@ -78,9 +78,9 @@ class ConversationsAdapter(activity: SimpleActivity, var conversations: ArrayLis
override fun getItemCount() = conversations.size
private fun askConfirmBlock() {
val numbers = TextUtils.join(", ", getSelectedItems().distinctBy { it.phoneNumber }.map { it.phoneNumber })
val baseString = R.string.block_confirmation
val question = String.format(resources.getString(baseString), numbers)
val numbers = getSelectedItems().distinctBy { it.phoneNumber }.map { it.phoneNumber }
val numbersString = TextUtils.join(", ", numbers)
val question = String.format(resources.getString(R.string.block_confirmation), numbersString)
ConfirmationDialog(activity, question) {
blockNumbers()