mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Render the live location timeline item (#5209)
* created the data for the timeline item # Conflicts: # ElementX/Sources/Other/Logging/Tracing.swift # ElementX/Sources/Services/Authentication/AuthenticationService.swift # ElementX/Sources/Services/Authentication/LinkNewDeviceService.swift * Implemented the LLS timeline item * updated preview tests * pr and design suggestions * previewscrollview is debug only
This commit is contained in:
@@ -271,6 +271,9 @@ private extension EventBasedTimelineItemProtocol {
|
||||
return locationTimelineItem.content.geoURI == nil ||
|
||||
properties.replyDetails != nil ||
|
||||
properties.isThreaded ? defaultInsets : .zero
|
||||
case let liveLocationTimelineItem as LiveLocationRoomTimelineItem:
|
||||
return properties.replyDetails != nil ||
|
||||
properties.isThreaded ? defaultInsets : .zero
|
||||
default:
|
||||
return defaultInsets
|
||||
}
|
||||
@@ -278,7 +281,7 @@ private extension EventBasedTimelineItemProtocol {
|
||||
|
||||
var contentCornerRadius: CGFloat {
|
||||
switch self {
|
||||
case is ImageRoomTimelineItem, is VideoRoomTimelineItem, is LocationRoomTimelineItem:
|
||||
case is ImageRoomTimelineItem, is VideoRoomTimelineItem, is LocationRoomTimelineItem, is LiveLocationRoomTimelineItem:
|
||||
return properties.replyDetails != nil || properties.isThreaded ? 8 : .zero
|
||||
default:
|
||||
return .zero
|
||||
|
||||
@@ -32,7 +32,7 @@ private struct TimelineItemSendInfoModifier: ViewModifier {
|
||||
AnyLayout(HStackLayout(alignment: .bottom, spacing: spacing))
|
||||
case .vertical(let spacing):
|
||||
AnyLayout(GridLayout(alignment: .leading, verticalSpacing: spacing))
|
||||
case .overlay:
|
||||
case .overlay, .hidden:
|
||||
AnyLayout(ZStackLayout(alignment: .bottomTrailing))
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,8 @@ private struct TimelineItemSendInfoLabel: View {
|
||||
content
|
||||
.gridColumnAlignment(.trailing)
|
||||
}
|
||||
case .hidden:
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +127,7 @@ private struct TimelineItemSendInfo {
|
||||
case horizontal(spacing: CGFloat = 4)
|
||||
case vertical(spacing: CGFloat = 4)
|
||||
case overlay(capsuleStyle: Bool)
|
||||
case hidden
|
||||
}
|
||||
|
||||
let itemID: TimelineItemIdentifier
|
||||
@@ -164,6 +167,8 @@ private extension TimelineItemSendInfo {
|
||||
layoutType = switch timelineItem {
|
||||
case is TextBasedRoomTimelineItem:
|
||||
.overlay(capsuleStyle: false)
|
||||
case let liveLocationTimelineItem as LiveLocationRoomTimelineItem:
|
||||
liveLocationTimelineItem.layout
|
||||
case let message as EventBasedMessageTimelineItemProtocol:
|
||||
switch message {
|
||||
case is ImageRoomTimelineItem, is VideoRoomTimelineItem:
|
||||
@@ -186,6 +191,16 @@ private extension TimelineItemSendInfo {
|
||||
}
|
||||
}
|
||||
|
||||
private extension LiveLocationRoomTimelineItem {
|
||||
var layout: TimelineItemSendInfo.LayoutType {
|
||||
if content.isLive, isOutgoing {
|
||||
.hidden
|
||||
} else {
|
||||
.overlay(capsuleStyle: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private extension EncryptionAuthenticity {
|
||||
var foregroundStyle: SwiftUI.Color {
|
||||
|
||||
Reference in New Issue
Block a user