Skip to content

Commit a1c5f06

Browse files
committed
Implemented the LLS timeline item
1 parent 52602b8 commit a1c5f06

34 files changed

+506
-75
lines changed

AccessibilityTests/Sources/GeneratedAccessibilityTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ extension AccessibilityTests {
291291
try await performAccessibilityAudit(named: "LinkNewDeviceScreen_Previews")
292292
}
293293

294+
func testLiveLocationRoomTimelineView() async throws {
295+
try await performAccessibilityAudit(named: "LiveLocationRoomTimelineView_Previews")
296+
}
297+
294298
func testLoadableImage() async throws {
295299
try await performAccessibilityAudit(named: "LoadableImage_Previews")
296300
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "placeholderMap.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.

ElementX/Resources/Localizations/en-US.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
"common_image" = "Image";
244244
"common_in_reply_to" = "In reply to %1$@";
245245
"common_invite_unknown_profile" = "This Matrix ID can't be found, so the invite might not be received.";
246+
"common_ios_expiration_time" = "Ends %1$@";
246247
"common_leaving_room" = "Leaving room";
247248
"common_leaving_space" = "Leaving space";
248249
"common_light" = "Light";

ElementX/Resources/Localizations/en.lproj/Localizable.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
"common_image" = "Image";
244244
"common_in_reply_to" = "In reply to %1$@";
245245
"common_invite_unknown_profile" = "This Matrix ID can't be found, so the invite might not be received.";
246+
"common_ios_expiration_time" = "Ends %1$@";
246247
"common_leaving_room" = "Leaving room";
247248
"common_leaving_space" = "Leaving space";
248249
"common_light" = "Light";

ElementX/Sources/Generated/Assets.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ internal enum Asset {
3737
internal static let launchBackground = ImageAsset(name: "images/launch-background")
3838
internal static let locationMarkerShape = ImageAsset(name: "images/location-marker-shape")
3939
internal static let mapBlurred = ImageAsset(name: "images/mapBlurred")
40+
internal static let placeholderMap = ImageAsset(name: "images/placeholderMap")
4041
internal static let mediaPause = ImageAsset(name: "images/media-pause")
4142
internal static let mediaPlay = ImageAsset(name: "images/media-play")
4243
internal static let notificationsPromptGraphic = ImageAsset(name: "images/notifications-prompt-graphic")

ElementX/Sources/Generated/Strings.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,10 @@ internal enum L10n {
538538
}
539539
/// This Matrix ID can't be found, so the invite might not be received.
540540
internal static var commonInviteUnknownProfile: String { return L10n.tr("Localizable", "common_invite_unknown_profile") }
541+
/// Ends %1$@
542+
internal static func commonIosExpirationTime(_ p1: Any) -> String {
543+
return L10n.tr("Localizable", "common_ios_expiration_time", String(describing: p1))
544+
}
541545
/// Leaving room
542546
internal static var commonLeavingRoom: String { return L10n.tr("Localizable", "common_leaving_room") }
543547
/// Leaving space

ElementX/Sources/Other/Extensions/Date.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ extension Date {
6464
static var mock: Date {
6565
DateComponents(calendar: .current, year: 2007, month: 1, day: 9, hour: 9, minute: 41).date ?? .now
6666
}
67+
68+
/// A fixed date used for mocks, previews etc.
69+
static var inOneMinute: Date {
70+
Date.now.addingTimeInterval(60)
71+
}
6772
}
6873

6974
private extension DateFormatter {

ElementX/Sources/Other/MapLibre/MapLibreStaticMapView.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ struct MapLibreStaticMapView<PinAnnotation: View>: View {
3434
self.pinAnnotationView = pinAnnotationView()
3535
}
3636

37+
init(geoURI: GeoURI,
38+
mapURLBuilder: MapTilerURLBuilderProtocol,
39+
attributionPlacement: MapTilerAttributionPlacement = .bottomLeft,
40+
mapSize: CGSize,
41+
@ViewBuilder pinAnnotationView: () -> PinAnnotation) {
42+
self.init(coordinates: .init(latitude: geoURI.latitude, longitude: geoURI.longitude),
43+
zoomLevel: 15,
44+
attributionPlacement: attributionPlacement,
45+
mapURLBuilder: mapURLBuilder,
46+
mapSize: mapSize,
47+
pinAnnotationView: pinAnnotationView)
48+
}
49+
3750
var body: some View {
3851
GeometryReader { geometry in
3952
if let url = mapURLBuilder.staticMapTileImageURL(for: colorScheme.mapStyle,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Copyright 2026 Element Creations Ltd.
3+
//
4+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
5+
// Please see LICENSE files in the repository root for full details.
6+
//
7+
8+
import SwiftUI
9+
10+
struct PreviewScrollView<Content: View>: View {
11+
var content: () -> Content
12+
13+
var body: some View {
14+
if ProcessInfo.isRunningTests {
15+
content()
16+
} else {
17+
ScrollView {
18+
content()
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)