implement number blocking from the Thread screen
This commit is contained in:
parent
0fe917053c
commit
bed5a80ccf
4 changed files with 15 additions and 180 deletions
|
|
@ -5,6 +5,7 @@ import android.content.Intent
|
|||
import android.os.Bundle
|
||||
import android.provider.Telephony
|
||||
import android.telephony.SmsManager
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
|
|
@ -153,7 +154,20 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun blockNumber() {
|
||||
val baseString = R.string.block_confirmation
|
||||
val numbers = selectedContacts.map { it.phoneNumber }.toTypedArray()
|
||||
val numbersString = TextUtils.join(", ", numbers)
|
||||
val question = String.format(resources.getString(baseString), numbersString)
|
||||
|
||||
ConfirmationDialog(this, question) {
|
||||
ensureBackgroundThread {
|
||||
numbers.forEach {
|
||||
addBlockedNumber(it)
|
||||
}
|
||||
refreshMessages()
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun askConfirmDelete() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue