Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,46 @@ class EventActivity : SimpleActivity() {
val eventId = intent.getLongExtra(EVENT_ID, 0L)
ensureBackgroundThread {
val locations = eventsDB.getAllLocations()
val eventTitleMap = eventsDB.getAllEvents()
.associateBy { it.title } as HashMap<String, Event>
binding.eventTitle.setOnItemClickListener { parent, view, position, id ->
val prev = eventTitleMap[parent.getItemAtPosition(position)]
binding.eventLocation.setText(prev!!.location)
binding.eventDescription.setText(prev.description)

binding.eventAllDay.isChecked = prev.getIsAllDay()
mEventEndDateTime = mEventStartDateTime.plus(1000L * (prev.endTS - prev.startTS))

mReminder1Minutes = prev.reminder1Minutes
mReminder2Minutes = prev.reminder2Minutes
mReminder3Minutes = prev.reminder3Minutes

mReminder1Type = prev.reminder1Type
mReminder2Type = prev.reminder2Type
mReminder3Type = prev.reminder3Type

mAccessLevel = prev.accessLevel
mAvailability = prev.availability
mStatus = prev.status
mEventColor = prev.color

mAttendees = prev.attendees as ArrayList<Attendee>

mCalendarId = prev.calendarId

checkRepeatTexts(mRepeatInterval)
checkRepeatRule()
updateTexts()
updateCalendar()
checkAttendees()
updateActionBarTitle()
}

runOnUiThread {
val adapter = ArrayAdapter(this, R.layout.item_dropdown, locations)
binding.eventLocation.setAdapter(adapter)
val locationAdapter = ArrayAdapter(this, R.layout.item_dropdown, locations)
binding.eventLocation.setAdapter(locationAdapter)
val titleAdapter = ArrayAdapter(this, R.layout.item_dropdown, eventTitleMap.keys.toList())
binding.eventTitle.setAdapter(titleAdapter)
}

val event = eventsDB.getEventWithId(eventId)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<org.fossify.commons.views.MyEditText
<org.fossify.commons.views.MyAutoCompleteTextView
android:id="@+id/event_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Loading