set same start and end time by default, different only from week grid

This commit is contained in:
tibbi 2017-02-06 22:28:05 +01:00
parent 23d802be10
commit de610c4dd9
3 changed files with 5 additions and 1 deletions

View File

@ -108,7 +108,9 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
title = resources.getString(R.string.new_event)
mEventStartDateTime = dateTime
mEventEndDateTime = mEventStartDateTime.plusHours(1)
val addHours = if (intent.getBooleanExtra(NEW_EVENT_SET_HOUR_DURATION, false)) 1 else 0
mEventEndDateTime = mEventStartDateTime.plusHours(addHours)
}
private fun showReminder1Dialog() {

View File

@ -188,6 +188,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val timestamp = mWeekTimestamp + index * DAY_SECONDS + hour * 60 * 60
Intent(context, EventActivity::class.java).apply {
putExtra(NEW_EVENT_START_TS, timestamp)
putExtra(NEW_EVENT_SET_HOUR_DURATION, true)
startActivity(this)
}
}

View File

@ -10,6 +10,7 @@ val YEAR_LABEL = "year"
val EVENT_ID = "event_id"
val NEW_EVENT_START_TS = "new_event_start_ts"
val WEEK_START_TIMESTAMP = "week_start_timestamp"
val NEW_EVENT_SET_HOUR_DURATION = "new_event_set_hour_duration"
val MONTHLY_VIEW = 1
val YEARLY_VIEW = 2