@@ -12,10 +12,7 @@ import com.bumptech.glide.signature.ObjectKey
1212import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
1313import com.simplemobiletools.commons.dialogs.ConfirmationDialog
1414import com.simplemobiletools.commons.dialogs.RadioGroupDialog
15- import com.simplemobiletools.commons.extensions.beVisibleIf
16- import com.simplemobiletools.commons.extensions.getColoredDrawableWithColor
17- import com.simplemobiletools.commons.extensions.highlightTextPart
18- import com.simplemobiletools.commons.extensions.isActivityDestroyed
15+ import com.simplemobiletools.commons.extensions.*
1916import com.simplemobiletools.commons.models.RadioItem
2017import com.simplemobiletools.commons.views.FastScroller
2118import com.simplemobiletools.commons.views.MyRecyclerView
@@ -38,6 +35,8 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
3835 private lateinit var contactDrawable: Drawable
3936 private var config = activity.config
4037 private var textToHighlight = " "
38+
39+ var adjustedPrimaryColor = activity.getAdjustedPrimaryColor()
4140 var startNameWithSurname: Boolean
4241 var showContactThumbnails: Boolean
4342 var showPhoneNumbers: Boolean
@@ -250,14 +249,14 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList<Cont
250249 private fun setupView (view : View , contact : Contact ) {
251250 view.apply {
252251 val fullName = contact.getFullName()
253- val nameText = if (textToHighlight.isEmpty()) fullName else fullName.highlightTextPart(textToHighlight, primaryColor )
252+ val nameText = if (textToHighlight.isEmpty()) fullName else fullName.highlightTextPart(textToHighlight, adjustedPrimaryColor )
254253 contact_name.text = nameText
255254 contact_name.setTextColor(textColor)
256255 contact_name.setPadding(if (showContactThumbnails) smallPadding else bigPadding, smallPadding, smallPadding, 0 )
257256
258257 if (contact_number != null ) {
259258 val numberText = contact.phoneNumbers.firstOrNull()?.value ? : " "
260- contact_number.text = if (textToHighlight.isEmpty()) numberText else numberText.highlightTextPart(textToHighlight, primaryColor )
259+ contact_number.text = if (textToHighlight.isEmpty()) numberText else numberText.highlightTextPart(textToHighlight, adjustedPrimaryColor )
261260 contact_number.setTextColor(textColor)
262261 contact_number.setPadding(if (showContactThumbnails) smallPadding else bigPadding, 0 , smallPadding, 0 )
263262 }
0 commit comments