Rename layout to item_autocomplete_title_subtitle.xml

This commit is contained in:
Naveen 2023-09-04 16:01:59 +05:30
parent e2ae8afe10
commit 801b4ae9e9
No known key found for this signature in database
GPG Key ID: 0E155DAD31671DA3
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.Filter
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
import com.simplemobiletools.calendar.pro.databinding.ItemAutocompleteEmailNameBinding
import com.simplemobiletools.calendar.pro.databinding.ItemAutocompleteTitleSubtitleBinding
import com.simplemobiletools.calendar.pro.models.Attendee
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.extensions.normalizeString
@ -20,7 +20,7 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val attendees: A
val attendeeHasName = attendee.name.isNotEmpty()
var listItem = convertView
if (listItem == null || listItem.tag != attendeeHasName) {
listItem = ItemAutocompleteEmailNameBinding.inflate(activity.layoutInflater, parent, false).root
listItem = ItemAutocompleteTitleSubtitleBinding.inflate(activity.layoutInflater, parent, false).root
}
val nameToUse = when {
@ -31,7 +31,7 @@ class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val attendees: A
val placeholder = BitmapDrawable(activity.resources, SimpleContactsHelper(context).getContactLetterIcon(nameToUse))
listItem.tag = attendeeHasName
ItemAutocompleteEmailNameBinding.bind(listItem).apply {
ItemAutocompleteTitleSubtitleBinding.bind(listItem).apply {
itemAutocompleteTitle.text = if (attendeeHasName) {
attendee.name
} else {