refactoring
This commit is contained in:
parent
f0dbda4135
commit
6d1eddb6cd
|
@ -93,14 +93,11 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
|
||||||
if (event.startTS != event.endTS && !event.getIsAllDay()) {
|
if (event.startTS != event.endTS && !event.getIsAllDay()) {
|
||||||
val startDayCode = Formatter.getDayCodeFromTS(event.startTS)
|
val startDayCode = Formatter.getDayCodeFromTS(event.startTS)
|
||||||
val endDayCode = Formatter.getDayCodeFromTS(event.endTS)
|
val endDayCode = Formatter.getDayCodeFromTS(event.endTS)
|
||||||
val startTimePostFix = if (startDayCode != dayCode) Formatter.getDayTitle(activity, startDayCode,false) else null
|
val startTimeString = event_item_time.text
|
||||||
val endTimePostFix = if (endDayCode != dayCode) Formatter.getDayTitle(activity, endDayCode,false) else null
|
val startDayString = if (startDayCode != dayCode) "(${Formatter.getDayTitle(activity, startDayCode,false)})" else ""
|
||||||
val timeString = "${event_item_time.text}" +
|
val endTimeString = Formatter.getTimeFromTS(context, event.endTS)
|
||||||
(if ( !startTimePostFix.isNullOrEmpty()) "(${startTimePostFix})" else "") +
|
val endDayString = if (endDayCode != dayCode) "(${Formatter.getDayTitle(activity, endDayCode,false)})" else ""
|
||||||
" - ${Formatter.getTimeFromTS(context, event.endTS)}"+
|
event_item_time.text = "$startTimeString$startDayString - $endTimeString$endDayString"
|
||||||
(if ( !endTimePostFix.isNullOrEmpty()) "(${endTimePostFix})" else "")
|
|
||||||
|
|
||||||
event_item_time.text = timeString
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event_item_description.text = if (replaceDescriptionWithLocation) event.location else event.description.replace("\n", " ")
|
event_item_description.text = if (replaceDescriptionWithLocation) event.location else event.description.replace("\n", " ")
|
||||||
|
|
Loading…
Reference in New Issue