This pull request replaces the sealed class WeekViewEntity (with its subclasses Event<T> and BlockedTime) with a more versatile WeekViewItem.
WeekViewItem is a single data class. Instead of using the limited number of subclasses, all information required to correctly render an item are passed as parameters:
style: This is pretty much a copy of WeekViewEntity.Style. However, because adapters have access to Context, the new WeekViewItem.Style takes only resolved colors and dimensions. You can’t pass in a resource ID anymore.
configuration: This parameter encapsulates various configuration points. Most importantly, configuration.arrangement can be used to specify whether an item should be rendered in the foreground or background.
duration: This property makes the distinction between all-day and bounded events more explicit. Bounded events have a start and end time, while all-day events only have a date.
This pull request replaces the sealed class
WeekViewEntity
(with its subclassesEvent<T>
andBlockedTime
) with a more versatileWeekViewItem
.WeekViewItem
is a single data class. Instead of using the limited number of subclasses, all information required to correctly render an item are passed as parameters:style
: This is pretty much a copy ofWeekViewEntity.Style
. However, because adapters have access toContext
, the newWeekViewItem.Style
takes only resolved colors and dimensions. You can’t pass in a resource ID anymore.configuration
: This parameter encapsulates various configuration points. Most importantly,configuration.arrangement
can be used to specify whether an item should be rendered in the foreground or background.duration
: This property makes the distinction between all-day and bounded events more explicit. Bounded events have a start and end time, while all-day events only have a date.