mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
LLS Sheet implementation (#5420)
* Add LiveLocationSheet and refactor existing views to share code * Implement logic for highlighting a specific LLS from a user once selected in the sheet * Updated tests, project and added new previews for the LLS sheet. # Conflicts: # PreviewTests/Sources/__Snapshots__/PreviewTests/liveLocationRoomTimelineView.Bubbles-iPad-pseudo.png # PreviewTests/Sources/__Snapshots__/PreviewTests/liveLocationRoomTimelineView.Bubbles-iPhone-pseudo.png * add Equatable conformance to CLLocationCoordinate2D
This commit is contained in:
@@ -65,6 +65,7 @@ struct LocationSharingScreenViewState: BindableState {
|
||||
let ownUserID: String
|
||||
var userProfiles: [String: UserProfileProxy]
|
||||
var liveLocationShares: [LiveLocationShare] = []
|
||||
var isStoppingLiveLocation = false
|
||||
|
||||
var annotations: [LocationAnnotation] {
|
||||
switch interactionMode {
|
||||
@@ -80,6 +81,8 @@ struct LocationSharingScreenViewState: BindableState {
|
||||
case .viewLive:
|
||||
return liveLocationShares.compactMap { share in
|
||||
guard let geoURI = share.geoURI else { return nil }
|
||||
if share.userID == ownUserID, isStoppingLiveLocation { return nil }
|
||||
|
||||
let profile = userProfiles[share.userID] ?? UserProfileProxy(userID: share.userID)
|
||||
let kind = LocationMarkerKind.liveUser(profile)
|
||||
let coordinate = CLLocationCoordinate2D(latitude: geoURI.latitude, longitude: geoURI.longitude)
|
||||
@@ -175,6 +178,7 @@ enum LocationSharingScreenViewAction {
|
||||
case startLiveLocation
|
||||
case centerToUser
|
||||
case userDidPan
|
||||
case stopLiveLocation
|
||||
}
|
||||
|
||||
extension AlertInfo where T == LocationSharingViewAlert {
|
||||
|
||||
Reference in New Issue
Block a user