mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Replace share location icon with the iOS share location icon (#2474)
This commit is contained in:
parent
9d1d5e43a9
commit
548fd27d6a
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 })
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
BIN
UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png
(Stored with Git LFS)
BIN
UnitTests/__Snapshots__/PreviewTests/test_locationMarkerView.1.png
(Stored with Git LFS)
Binary file not shown.
BIN
UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png
(Stored with Git LFS)
BIN
UnitTests/__Snapshots__/PreviewTests/test_staticLocationScreenViewer.Picker.png
(Stored with Git LFS)
Binary file not shown.
1
changelog.d/1486.change
Normal file
1
changelog.d/1486.change
Normal file
@ -0,0 +1 @@
|
||||
Replaced the share my location button icon with the iOS share icon.
|
Loading…
x
Reference in New Issue
Block a user