mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
renaming contactId to id
This commit is contained in:
@@ -43,8 +43,8 @@ class NewMessageActivity : SimpleActivity() {
|
|||||||
val names = getNames()
|
val names = getNames()
|
||||||
contacts = getPhoneNumbers()
|
contacts = getPhoneNumbers()
|
||||||
contacts.forEach {
|
contacts.forEach {
|
||||||
val contactId = it.contactId
|
val contactId = it.id
|
||||||
val contact = names.firstOrNull { it.contactId == contactId }
|
val contact = names.firstOrNull { it.id == contactId }
|
||||||
val name = contact?.name
|
val name = contact?.name
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
it.name = name
|
it.name = name
|
||||||
@@ -73,7 +73,7 @@ class NewMessageActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun addSelectedContact(contact: Contact) {
|
private fun addSelectedContact(contact: Contact) {
|
||||||
new_message_to.setText("")
|
new_message_to.setText("")
|
||||||
if (selectedContacts.map { it.contactId }.contains(contact.contactId)) {
|
if (selectedContacts.map { it.id }.contains(contact.id)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ class NewMessageActivity : SimpleActivity() {
|
|||||||
layoutInflater.inflate(R.layout.item_selected_contact, null).apply {
|
layoutInflater.inflate(R.layout.item_selected_contact, null).apply {
|
||||||
selected_contact_name.text = contact.name
|
selected_contact_name.text = contact.name
|
||||||
selected_contact_remove.setOnClickListener {
|
selected_contact_remove.setOnClickListener {
|
||||||
removeSelectedContact(contact.contactId)
|
removeSelectedContact(contact.id)
|
||||||
}
|
}
|
||||||
views.add(this)
|
views.add(this)
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ class NewMessageActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun removeSelectedContact(id: Int) {
|
private fun removeSelectedContact(id: Int) {
|
||||||
selectedContacts = selectedContacts.filter { it.contactId != id }.toMutableList() as ArrayList<Contact>
|
selectedContacts = selectedContacts.filter { it.id != id }.toMutableList() as ArrayList<Contact>
|
||||||
showSelectedContacts()
|
showSelectedContacts()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
|
|||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
|
|
||||||
data class Contact(
|
data class Contact(
|
||||||
val contactId: Int,
|
val id: Int,
|
||||||
var name: String,
|
var name: String,
|
||||||
var photoUri: String,
|
var photoUri: String,
|
||||||
var phoneNumber: String
|
var phoneNumber: String
|
||||||
|
Reference in New Issue
Block a user