Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace WeekViewEntity with more versatile WeekViewItem #272

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

thellmund
Copy link
Owner

@thellmund thellmund commented Dec 19, 2021

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.

@thellmund thellmund changed the title Replace WeekViewEntity with more versatile WeekViewItem Replace WeekViewEntity with more versatile WeekViewItem Dec 19, 2021
@thellmund thellmund force-pushed the th/weekViewItem branch 3 times, most recently from 4363be5 to c24d73e Compare December 24, 2021 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant