diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt index bfba5d654..9efb38efc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt @@ -1170,12 +1170,17 @@ class EventActivity : SimpleActivity() { event_attendees_holder.addView(attendeeHolder) attendeeHolder.event_attendee.setColors(config.textColor, getAdjustedPrimaryColor(), config.backgroundColor) + if (value != null) { attendeeHolder.event_attendee.setText(value) } val adapter = AutoCompleteTextViewAdapter(this, mAvailableContacts) attendeeHolder.event_attendee.setAdapter(adapter) + attendeeHolder.event_attendee.setOnItemClickListener { parent, view, position, id -> + val currAttendees = (attendeeHolder.event_attendee.adapter as AutoCompleteTextViewAdapter).resultList + val selectedAttendee = currAttendees[position] + } } private fun checkNewAttendeeField(value: String?) { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt index 5205d11ea..34ef234dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/AutoCompleteTextViewAdapter.kt @@ -19,7 +19,7 @@ import com.simplemobiletools.commons.extensions.normalizeString import kotlinx.android.synthetic.main.item_autocomplete_email_name.view.* class AutoCompleteTextViewAdapter(val activity: SimpleActivity, val contacts: ArrayList) : ArrayAdapter(activity, 0, contacts) { - private var resultList = ArrayList() + var resultList = ArrayList() private var placeholder = activity.resources.getDrawable(R.drawable.attendee_circular_background) init {