Skip to content

Commit

Permalink
Merge pull request #372 from rakuyoMo/feature/top-offset
Browse files Browse the repository at this point in the history
  • Loading branch information
kvyatkovskys authored Aug 19, 2024
2 parents f555bbd + c191ae5 commit 0b4f78e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/KVKCalendar/DayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ extension DayView: CalendarSettingProtocol {
timelineFrame.size.height -= scrollableWeekView.frame.height
}

timelineFrame.origin.y += style.timeline.offsetTop

if isAvailableEventViewer {
if UIApplication.shared.orientation.isPortrait {
timelineFrame.size.width = UIScreen.main.bounds.width * 0.5
Expand Down
2 changes: 2 additions & 0 deletions Sources/KVKCalendar/Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public struct TimelineStyle {
return 0.5
#endif
}()
public var offsetTop: CGFloat = 0
public var offsetLineLeft: CGFloat = 10
public var offsetLineRight: CGFloat = 10
public var backgroundColor: UIColor = .white
Expand Down Expand Up @@ -859,6 +860,7 @@ extension TimelineStyle: Equatable {
&& compare(\.movingMinuteLabelRoundUpTime)
&& compare(\.minuteLabelRoundUpTime)
&& compare(\.widthLine)
&& compare(\.offsetTop)
&& compare(\.offsetLineLeft)
&& compare(\.offsetLineRight)
&& compare(\.backgroundColor)
Expand Down
2 changes: 2 additions & 0 deletions Sources/KVKCalendar/WeekView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ extension WeekView: CalendarSettingProtocol {
timelineFrame.size.height -= scrollableWeekView.frame.height
}

timelineFrame.origin.y += style.timeline.offsetTop

let timelineViews = Array(0..<style.timeline.maxLimitCachedPages).reduce([]) { (acc, _) -> [TimelineView] in
return acc + [createTimelineView(frame: timelineFrame)]
}
Expand Down

0 comments on commit 0b4f78e

Please sign in to comment.