File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import com.bumptech.glide.Glide
1010import com.bumptech.glide.load.engine.DiskCacheStrategy
1111import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
1212import com.bumptech.glide.request.RequestOptions
13+ import com.simplemobiletools.commons.extensions.beGone
1314import com.simplemobiletools.commons.extensions.getProperBackgroundColor
1415import com.simplemobiletools.commons.extensions.getProperTextColor
1516import com.simplemobiletools.commons.extensions.normalizeString
@@ -44,8 +45,13 @@ class AutoCompleteTextViewAdapter(
4445
4546 tag = nameToUse.isNotEmpty()
4647 item_autocomplete_name.text = nameToUse
47- item_autocomplete_number.text = contact.phoneNumbers.run {
48- firstOrNull { it.isPrimary }?.normalizedNumber ? : firstOrNull()?.normalizedNumber
48+ contact.phoneNumbers.apply {
49+ val phoneNumber = firstOrNull { it.isPrimary }?.normalizedNumber ? : firstOrNull()?.normalizedNumber
50+ if (phoneNumber.isNullOrEmpty()) {
51+ item_autocomplete_number.beGone()
52+ } else {
53+ item_autocomplete_number.text = phoneNumber
54+ }
4955 }
5056
5157 val options = RequestOptions ()
You can’t perform that action at this time.
0 commit comments