launch the given contacts thread at clicking on him at the New Message screen

This commit is contained in:
tibbi 2020-04-06 12:23:01 +02:00
parent cdfaa3cea9
commit 6d8c889723
1 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,8 @@ import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
import com.simplemobiletools.smsmessenger.R import com.simplemobiletools.smsmessenger.R
import com.simplemobiletools.smsmessenger.adapters.AutoCompleteTextViewAdapter import com.simplemobiletools.smsmessenger.adapters.AutoCompleteTextViewAdapter
import com.simplemobiletools.smsmessenger.extensions.getThreadId
import com.simplemobiletools.smsmessenger.extensions.launchThreadActivity
import com.simplemobiletools.smsmessenger.models.Contact import com.simplemobiletools.smsmessenger.models.Contact
import kotlinx.android.synthetic.main.activity_new_message.* import kotlinx.android.synthetic.main.activity_new_message.*
import kotlinx.android.synthetic.main.item_selected_contact.view.* import kotlinx.android.synthetic.main.item_selected_contact.view.*
@ -67,7 +69,8 @@ class NewMessageActivity : SimpleActivity() {
new_message_to.setOnItemClickListener { parent, view, position, id -> new_message_to.setOnItemClickListener { parent, view, position, id ->
val currContacts = (new_message_to.adapter as AutoCompleteTextViewAdapter).resultList val currContacts = (new_message_to.adapter as AutoCompleteTextViewAdapter).resultList
val selectedContact = currContacts[position] val selectedContact = currContacts[position]
addSelectedContact(selectedContact) hideKeyboard()
launchThreadActivity(getThreadId(selectedContact.phoneNumber).toInt())
} }
} }