Minor code optimizations
This commit is contained in:
@@ -90,8 +90,7 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
binding.AndroidTitle.visibility = View.GONE
|
binding.AndroidTitle.visibility = View.GONE
|
||||||
androidCheck.visibility = View.GONE
|
androidCheck.visibility = View.GONE
|
||||||
index = intent.getIntExtra("index", 0)
|
index = intent.getIntExtra("index", 0)
|
||||||
val contact = Contact.contacts()[index]
|
val contact = Contact.contacts()[index] as Contact.BaresipContact
|
||||||
if (contact is Contact.BaresipContact) {
|
|
||||||
val name = contact.name
|
val name = contact.name
|
||||||
color = contact.color
|
color = contact.color
|
||||||
id = contact.id
|
id = contact.id
|
||||||
@@ -105,7 +104,6 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
uriView.setText(contact.uri)
|
uriView.setText(contact.uri)
|
||||||
uOrI = index.toString()
|
uOrI = index.toString()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
val avatarRequest =
|
val avatarRequest =
|
||||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||||
@@ -272,9 +270,8 @@ class ContactActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
if (newContact)
|
if (newContact)
|
||||||
Contact.contacts().add(contact)
|
Contact.contacts().add(contact)
|
||||||
Contact.sortContacts()
|
|
||||||
Contact.generateContactNames()
|
|
||||||
Contact.saveBaresipContacts()
|
Contact.saveBaresipContacts()
|
||||||
|
Contact.contactsUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
BaresipService.activities.remove("contact,$newContact,$uOrI")
|
BaresipService.activities.remove("contact,$newContact,$uOrI")
|
||||||
|
|||||||
Reference in New Issue
Block a user