From 3e8a65bda1788fcce9f2674ac13935b290b03ef3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 25 Sep 2018 14:17:55 +0200 Subject: [PATCH] highlight contact number from the search query --- .../simplemobiletools/contacts/activities/DialpadActivity.kt | 2 +- .../simplemobiletools/contacts/adapters/ContactsAdapter.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/DialpadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/DialpadActivity.kt index 790d95a6..73e7dd6e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/activities/DialpadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/activities/DialpadActivity.kt @@ -103,7 +103,7 @@ class DialpadActivity : SimpleActivity() { it.cleanPhoneNumbers.any { (text.isNotEmpty() && it.value.contains(text)) || (numericOnly.isNotEmpty() && it.value.contains(numericOnly)) } } as ArrayList - ContactsAdapter(this, filtered, null, LOCATION_DIALPAD, null, dialpad_list, dialpad_fastscroller) { + ContactsAdapter(this, filtered, null, LOCATION_DIALPAD, null, dialpad_list, dialpad_fastscroller, text) { callContact(it as Contact) }.apply { addVerticalDividers(true) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt index 691e0eaf..802d074c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/adapters/ContactsAdapter.kt @@ -29,12 +29,12 @@ import java.util.* class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList, private val refreshListener: RefreshContactsListener?, private val location: Int, private val removeListener: RemoveFromGroupListener?, recyclerView: MyRecyclerView, - fastScroller: FastScroller, itemClick: (Any) -> Unit) : + fastScroller: FastScroller, highlightText: String = "", itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) { private lateinit var contactDrawable: Drawable private var config = activity.config - private var textToHighlight = "" + private var textToHighlight = highlightText var adjustedPrimaryColor = activity.getAdjustedPrimaryColor() var startNameWithSurname: Boolean