mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-03 04:41:10 +02:00
fix some crashes at inflating some views
This commit is contained in:
parent
013bb713d6
commit
2b636f7240
@ -40,7 +40,6 @@ import com.simplemobiletools.contacts.models.Email
|
|||||||
import com.simplemobiletools.contacts.models.Event
|
import com.simplemobiletools.contacts.models.Event
|
||||||
import com.simplemobiletools.contacts.models.PhoneNumber
|
import com.simplemobiletools.contacts.models.PhoneNumber
|
||||||
import kotlinx.android.synthetic.main.activity_contact.*
|
import kotlinx.android.synthetic.main.activity_contact.*
|
||||||
import kotlinx.android.synthetic.main.activity_contact.view.*
|
|
||||||
import kotlinx.android.synthetic.main.item_email.view.*
|
import kotlinx.android.synthetic.main.item_email.view.*
|
||||||
import kotlinx.android.synthetic.main.item_event.view.*
|
import kotlinx.android.synthetic.main.item_event.view.*
|
||||||
import kotlinx.android.synthetic.main.item_phone_number.view.*
|
import kotlinx.android.synthetic.main.item_phone_number.view.*
|
||||||
@ -609,35 +608,32 @@ class ContactActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addNewPhoneNumberField() {
|
private fun addNewPhoneNumberField() {
|
||||||
layoutInflater.inflate(R.layout.item_phone_number, contact_numbers_holder, false).apply {
|
val numberHolder = layoutInflater.inflate(R.layout.item_phone_number, contact_numbers_holder, false) as ViewGroup
|
||||||
updateTextColors(this as ViewGroup)
|
updateTextColors(numberHolder)
|
||||||
setupPhoneNumberTypePicker(contact_number_type)
|
setupPhoneNumberTypePicker(numberHolder.contact_number_type)
|
||||||
contact_numbers_holder.addView(this)
|
contact_numbers_holder.addView(numberHolder)
|
||||||
contact_numbers_holder.onGlobalLayout {
|
contact_numbers_holder.onGlobalLayout {
|
||||||
contact_number.requestFocus()
|
numberHolder.contact_number.requestFocus()
|
||||||
showKeyboard(contact_number)
|
showKeyboard(numberHolder.contact_number)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addNewEmailField() {
|
private fun addNewEmailField() {
|
||||||
layoutInflater.inflate(R.layout.item_email, contact_emails_holder, false).apply {
|
val emailHolder = layoutInflater.inflate(R.layout.item_email, contact_emails_holder, false) as ViewGroup
|
||||||
updateTextColors(this as ViewGroup)
|
updateTextColors(emailHolder)
|
||||||
setupEmailTypePicker(contact_email_type)
|
setupEmailTypePicker(emailHolder.contact_email_type)
|
||||||
contact_emails_holder.addView(this)
|
contact_emails_holder.addView(emailHolder)
|
||||||
contact_emails_holder.onGlobalLayout {
|
contact_emails_holder.onGlobalLayout {
|
||||||
contact_email.requestFocus()
|
emailHolder.contact_email.requestFocus()
|
||||||
showKeyboard(contact_email)
|
showKeyboard(emailHolder.contact_email)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addNewEventField() {
|
private fun addNewEventField() {
|
||||||
layoutInflater.inflate(R.layout.item_event, contact_events_holder, false).apply {
|
val eventHolder = layoutInflater.inflate(R.layout.item_event, contact_events_holder, false) as ViewGroup
|
||||||
updateTextColors(this as ViewGroup)
|
updateTextColors(eventHolder)
|
||||||
setupEventTypePicker(this)
|
setupEventTypePicker(eventHolder)
|
||||||
contact_events_holder.addView(this)
|
contact_events_holder.addView(eventHolder)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteContact() {
|
private fun deleteContact() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user