mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Refactor and redesign Location Sharing Screen (#5155)
* refactored the static location screen to the location sharing screen # Conflicts: # UnitTests/Sources/LocationSharingScreenViewModelTests.swift # Conflicts: # ElementX.xcodeproj/project.pbxproj * implemented a custom pin with an overlayable view * implemented the render of the user when the location is sender instead of the pin type * removed description and body they are not used at all. * reimplemented single button for sharing this or user location + implemented an experimental way to update annotations * removed unnecessary @Suite description * implemented a way to display the alert on top of the sheet and added a spinner to the center user location button * fixed alerts strings * fixed a failing test * improved preview tests
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ enum TimelineControllerAction {
|
||||
}
|
||||
|
||||
case displayMediaPreview(item: EventBasedMessageTimelineItemProtocol, timelineViewModel: TimelineViewModelKind)
|
||||
case displayLocation(body: String, geoURI: GeoURI, description: String?)
|
||||
case displayLocation(senderID: String?, geoURI: GeoURI)
|
||||
case none
|
||||
}
|
||||
|
||||
|
||||
+19
-3
@@ -6,16 +6,32 @@
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import MatrixRustSDK
|
||||
|
||||
struct LocationRoomTimelineItemContent: Hashable {
|
||||
enum Kind {
|
||||
case sender
|
||||
case pin
|
||||
|
||||
init(from asset: AssetType?) {
|
||||
self = switch asset {
|
||||
case .pin:
|
||||
.pin
|
||||
case .sender, .none:
|
||||
.sender
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let body: String
|
||||
let geoURI: GeoURI?
|
||||
let description: String?
|
||||
let kind: Kind
|
||||
|
||||
init(body: String,
|
||||
geoURI: GeoURI? = nil,
|
||||
description: String? = nil) {
|
||||
kind: Kind = .sender) {
|
||||
self.body = body
|
||||
self.geoURI = geoURI
|
||||
self.description = description
|
||||
self.kind = kind
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
private func buildLocationTimelineItemContent(_ locationContent: LocationContent) -> LocationRoomTimelineItemContent {
|
||||
LocationRoomTimelineItemContent(body: locationContent.body,
|
||||
geoURI: .init(string: locationContent.geoUri),
|
||||
description: locationContent.description)
|
||||
kind: .init(from: locationContent.asset))
|
||||
}
|
||||
|
||||
private func buildFileTimelineItemContent(_ messageContent: FileMessageContent) -> FileRoomTimelineItemContent {
|
||||
|
||||
Reference in New Issue
Block a user