diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt index e30e6873..d79321b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/NewMessageActivity.kt @@ -66,14 +66,14 @@ class NewMessageActivity : SimpleActivity() { new_message_confirm.applyColorFilter(config.textColor) new_message_confirm.setOnClickListener { val number = new_message_to.value - launchThreadActivity(number, number, "") + launchThreadActivity(number, number) } } private fun isThirdPartyIntent(): Boolean { if (intent.action == Intent.ACTION_SENDTO && intent.dataString != null) { val number = intent.dataString!!.removePrefix("sms:").removePrefix("smsto:").removePrefix("mms").removePrefix("mmsto:").trim() - launchThreadActivity(number, "", "") + launchThreadActivity(number, "") return true } return false @@ -82,9 +82,7 @@ class NewMessageActivity : SimpleActivity() { private fun setupAdapter(contacts: ArrayList) { ContactsAdapter(this, contacts, contacts_list, null) { hideKeyboard() - - val text = intent.getStringExtra(Intent.EXTRA_TEXT) ?: "" - launchThreadActivity((it as Contact).phoneNumber, it.name, text) + launchThreadActivity((it as Contact).phoneNumber, it.name) }.apply { contacts_list.adapter = this } @@ -105,6 +103,9 @@ class NewMessageActivity : SimpleActivity() { suggested_contact_name.text = contact.name loadImage(contact.photoUri, suggested_contact_image, contact.name) suggestions_holder.addView(this) + setOnClickListener { + launchThreadActivity(contact.phoneNumber, contact.name) + } } } } @@ -113,7 +114,8 @@ class NewMessageActivity : SimpleActivity() { } } - private fun launchThreadActivity(phoneNumber: String, name: String, text: String) { + private fun launchThreadActivity(phoneNumber: String, name: String) { + val text = intent.getStringExtra(Intent.EXTRA_TEXT) ?: "" Intent(this, ThreadActivity::class.java).apply { putExtra(THREAD_ID, getThreadId(phoneNumber).toInt()) putExtra(THREAD_TITLE, name) diff --git a/app/src/main/res/layout/item_suggested_contact.xml b/app/src/main/res/layout/item_suggested_contact.xml index 6ff55463..7535748b 100644 --- a/app/src/main/res/layout/item_suggested_contact.xml +++ b/app/src/main/res/layout/item_suggested_contact.xml @@ -3,6 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/suggested_contact_holder" android:layout_width="wrap_content" + android:background="?selectableItemBackground" android:layout_height="wrap_content">