From 548fd27d6a98076d982432ef57e3504c32d02037 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:35:22 +0100 Subject: [PATCH] Replace share location icon with the iOS share location icon (#2474) --- .../SwiftUI/Views/LocationMarkerView.swift | 26 ------------------- .../View/Filters/RoomListFilterModels.swift | 4 +-- .../View/StaticLocationScreen.swift | 2 +- .../test_locationMarkerView.1.png | 4 +-- ...test_staticLocationScreenViewer.Picker.png | 4 +-- changelog.d/1486.change | 1 + 6 files changed, 8 insertions(+), 33 deletions(-) create mode 100644 changelog.d/1486.change diff --git a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift index b485a2667..784cb10a8 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift @@ -18,21 +18,11 @@ import Compound import SwiftUI struct LocationMarkerView: View { - var mode: Mode = .map - enum Mode { case map, button } - private let pinColor: Color = .compound.iconOnSolidPrimary private let pinInsets = EdgeInsets(top: 13, leading: 12, bottom: 15, trailing: 12) private let buttonScale: Double = 28 / 52 var body: some View { - switch mode { - case .map: mapMarker - case .button: buttonMarker - } - } - - var mapMarker: some View { CompoundIcon(\.locationPinSolid) .dynamicTypeSize(.large) .foregroundStyle(pinColor) @@ -46,17 +36,6 @@ struct LocationMarkerView: View { } } - var buttonMarker: some View { - CompoundIcon(\.locationPinSolid, size: .custom(13), relativeTo: .body) - .foregroundStyle(pinColor) - .scaledPadding(.top, pinInsets.top * buttonScale) - .scaledPadding(.bottom, pinInsets.bottom * buttonScale) - .scaledPadding(.horizontal, pinInsets.leading * buttonScale) - .background { - backgroundShape - } - } - var backgroundShape: some View { Image(asset: Asset.Images.locationMarkerShape) .resizable() @@ -72,11 +51,6 @@ struct LocationMarkerView_Previews: PreviewProvider, TestablePreview { LocationMarkerView() .colorScheme(.dark) - - LocationMarkerView(mode: .button) - - LocationMarkerView(mode: .button) - .colorScheme(.dark) } } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/Filters/RoomListFilterModels.swift b/ElementX/Sources/Screens/HomeScreen/View/Filters/RoomListFilterModels.swift index ee7f5920c..0af4d1e6b 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/Filters/RoomListFilterModels.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/Filters/RoomListFilterModels.swift @@ -86,8 +86,8 @@ struct RoomListFiltersState { var availableFilters = Set(RoomListFilter.allCases) for filter in activeFilters { availableFilters.remove(filter) - if let complementaryFilter = filter.incompatibleFilter { - availableFilters.remove(complementaryFilter) + if let incompatibleFilter = filter.incompatibleFilter { + availableFilters.remove(incompatibleFilter) } } return availableFilters.sorted(by: { $0.rawValue < $1.rawValue }) diff --git a/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift b/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift index c967631d8..98d24c0db 100644 --- a/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift +++ b/ElementX/Sources/Screens/LocationSharing/View/StaticLocationScreen.swift @@ -110,7 +110,7 @@ struct StaticLocationScreen: View { context.send(viewAction: .selectLocation) } label: { HStack(spacing: 8) { - LocationMarkerView(mode: .button) + CompoundIcon(\.shareIos) Text(context.viewState.isSharingUserLocation ? L10n.screenShareMyLocationAction : L10n.screenShareThisLocationAction) } } diff --git a/UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png b/UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png index f8a8bc9b7..6bee79674 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:168fcdfd95bf0e928b3a5894096a394ddd840566cdcc9522f158accde7ceaa66 -size 83323 +oid sha256:eb2fb780c30fd4beed3b7f70562b22882f475dd0536b2c96d3c0f3511ddceb17 +size 79174 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png b/UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png index 5f15f8494..5ca4e7345 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccfb8d354e43d1b1f878051aee601d48c15ccb33d24c3388a735b32b2b1a3ff9 -size 99864 +oid sha256:fa6b2460268c0abb419beed38e44b72e635613c7527e153aa706025d1c493f25 +size 99191 diff --git a/changelog.d/1486.change b/changelog.d/1486.change new file mode 100644 index 000000000..783b378d0 --- /dev/null +++ b/changelog.d/1486.change @@ -0,0 +1 @@ +Replaced the share my location button icon with the iOS share icon. \ No newline at end of file