mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-25 07:50:56 +01:00
figure out which attendee has been picked by clicking on a suggestion
This commit is contained in:
parent
fa2cf07211
commit
979f463e97
@ -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?) {
|
||||
|
@ -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<Attendee>) : ArrayAdapter<Attendee>(activity, 0, contacts) {
|
||||
private var resultList = ArrayList<Attendee>()
|
||||
var resultList = ArrayList<Attendee>()
|
||||
private var placeholder = activity.resources.getDrawable(R.drawable.attendee_circular_background)
|
||||
|
||||
init {
|
||||
|
Loading…
Reference in New Issue
Block a user