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

Allow customisation of timelines' event views' frame #198

Merged
merged 2 commits into from
Jul 14, 2021
Merged

Allow customisation of timelines' event views' frame #198

merged 2 commits into from
Jul 14, 2021

Conversation

wassup-
Copy link
Contributor

@wassup- wassup- commented Jul 13, 2021

This PR separates the timelines' calculation of event view frames.
This enables the user of the library to define custom logic for positioning / sizing event views.

The use-case for me to implement this is to support "background" events which appear behind other events displayed by the timeline, which was not possible with the original implementation of TimelineView.

screenshot

TimelineStyle now has an additional property public var eventLayout: TimelineEventLayout = DefaultTimelineEventLayout()
TimelineView now has an additional property private(set) var eventLayout: TimelineEventLayout, which will be set to style.eventLayout on init.

As you might have noticed, the original behaviour is now encapsulated within DefaultTimelineEventLayout.

Let me know what you think of this.

this way users can customise the layout of events displayed on the timeline
currently only the event view's frame can be customised
to match upstream style
@kvyatkovskys
Copy link
Owner

Thank you for the PR🙂. I'll look later today 😉

@kvyatkovskys
Copy link
Owner

looks good, thx for your work

@kvyatkovskys kvyatkovskys merged commit 842269f into kvyatkovskys:master Jul 14, 2021
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.

2 participants