do not automatically set end date with start date change

This commit is contained in:
tibbi 2017-05-21 12:06:19 +02:00
parent f99320724c
commit 4bf3a8a576
1 changed files with 0 additions and 13 deletions

View File

@ -26,8 +26,6 @@ import org.joda.time.DateTime
import java.util.* import java.util.*
class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener { class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private var mWasEndDateSet = false
private var mWasEndTimeSet = false
private var mReminder1Minutes = 0 private var mReminder1Minutes = 0
private var mReminder2Minutes = 0 private var mReminder2Minutes = 0
private var mReminder3Minutes = 0 private var mReminder3Minutes = 0
@ -81,9 +79,6 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
updateEndTimeText() updateEndTimeText()
updateEventType() updateEventType()
mWasEndDateSet = event != null
mWasEndTimeSet = event != null
event_start_date.setOnClickListener { setupStartDate() } event_start_date.setOnClickListener { setupStartDate() }
event_start_time.setOnClickListener { setupStartTime() } event_start_time.setOnClickListener { setupStartTime() }
event_end_date.setOnClickListener { setupEndDate() } event_end_date.setOnClickListener { setupEndDate() }
@ -523,16 +518,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
private val startDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth -> private val startDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth ->
dateSet(year, monthOfYear, dayOfMonth, true) dateSet(year, monthOfYear, dayOfMonth, true)
if (!mWasEndDateSet) {
dateSet(year, monthOfYear, dayOfMonth, false)
}
} }
private val startTimeSetListener = TimePickerDialog.OnTimeSetListener { view, hourOfDay, minute -> private val startTimeSetListener = TimePickerDialog.OnTimeSetListener { view, hourOfDay, minute ->
timeSet(hourOfDay, minute, true) timeSet(hourOfDay, minute, true)
if (!mWasEndTimeSet) {
timeSet(hourOfDay, minute, false)
}
} }
private val endDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth -> dateSet(year, monthOfYear, dayOfMonth, false) } private val endDateSetListener = DatePickerDialog.OnDateSetListener { view, year, monthOfYear, dayOfMonth -> dateSet(year, monthOfYear, dayOfMonth, false) }
@ -552,7 +541,6 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
} else { } else {
mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day) mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day)
updateEndDateText() updateEndDateText()
mWasEndDateSet = true
} }
} }
@ -567,7 +555,6 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
} else { } else {
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes) mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
updateEndTimeText() updateEndTimeText()
mWasEndTimeSet = true
} }
} }