diff --git a/app-ios/Sources/TimetableFeature/TimetableListView.swift b/app-ios/Sources/TimetableFeature/TimetableListView.swift index 677d99782..80adb94c6 100644 --- a/app-ios/Sources/TimetableFeature/TimetableListView.swift +++ b/app-ios/Sources/TimetableFeature/TimetableListView.swift @@ -118,7 +118,7 @@ struct TimetableGridView: View { let rooms = RoomType.allCases.filter {$0 != RoomType.roomIj} ScrollView([.horizontal, .vertical]) { - Grid { + Grid(alignment: .leading, horizontalSpacing: 4, verticalSpacing: 2) { GridRow { Color.clear .gridCellUnsizedAxes([.horizontal, .vertical]) @@ -127,8 +127,10 @@ struct TimetableGridView: View { let room = column.toRoom() Text(room.name.currentLangTitle).foregroundStyle(room.roomTheme.primaryColor).textStyle(.titleMedium) .frame(width: 192) + } } + DashedDivider(axis: .horizontal) ForEach(store.timetableItems, id: \.self) { timeBlock in GridRow { VStack { @@ -136,9 +138,8 @@ struct TimetableGridView: View { Spacer() }.frame(height: 153) - + ForEach(rooms, id: \.self) { room in - if let cell = timeBlock.getCellForRoom(room: room, onTap: { item in store.send(.view(.timetableItemTapped(item)))}) { cell @@ -151,8 +152,9 @@ struct TimetableGridView: View { } } } + DashedDivider(axis: .horizontal) } - } + }.fixedSize(horizontal: false, vertical: true) .padding(.trailing) bottomTabBarPadding @@ -191,6 +193,38 @@ struct TimeGroupMiniList: View { } } +struct DashedDivider: View { + public let axis: Axis + + var body: some View { + let shape = LineShape(axis: axis) + .stroke(style: .init(dash: [2])) + .foregroundStyle(AssetColors.Outline.outlineVariant.swiftUIColor) + if axis == .horizontal { + shape.frame(height: 1) + } else { + shape.frame(width: 1).padding(0) + } + } +} + +struct LineShape: Shape { + public let axis: Axis + + func path(in rect: CGRect) -> Path { + var path = Path() + path.move(to: CGPoint(x: 0, y: 0)) + + if axis == .horizontal { + path.addLine(to: CGPoint(x: rect.width, y: 0)) + } else { + path.addLine(to: CGPoint(x: 0, y: rect.height)) + } + + return path + } +} + fileprivate var bottomTabBarPadding: some View { // bottom floating tabbar padding Color.clear.padding(.bottom, 60)