mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Replace share location icon with the iOS share location icon (#2474)
This commit is contained in:
@@ -18,21 +18,11 @@ import Compound
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct LocationMarkerView: View {
|
struct LocationMarkerView: View {
|
||||||
var mode: Mode = .map
|
|
||||||
enum Mode { case map, button }
|
|
||||||
|
|
||||||
private let pinColor: Color = .compound.iconOnSolidPrimary
|
private let pinColor: Color = .compound.iconOnSolidPrimary
|
||||||
private let pinInsets = EdgeInsets(top: 13, leading: 12, bottom: 15, trailing: 12)
|
private let pinInsets = EdgeInsets(top: 13, leading: 12, bottom: 15, trailing: 12)
|
||||||
private let buttonScale: Double = 28 / 52
|
private let buttonScale: Double = 28 / 52
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
switch mode {
|
|
||||||
case .map: mapMarker
|
|
||||||
case .button: buttonMarker
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var mapMarker: some View {
|
|
||||||
CompoundIcon(\.locationPinSolid)
|
CompoundIcon(\.locationPinSolid)
|
||||||
.dynamicTypeSize(.large)
|
.dynamicTypeSize(.large)
|
||||||
.foregroundStyle(pinColor)
|
.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 {
|
var backgroundShape: some View {
|
||||||
Image(asset: Asset.Images.locationMarkerShape)
|
Image(asset: Asset.Images.locationMarkerShape)
|
||||||
.resizable()
|
.resizable()
|
||||||
@@ -72,11 +51,6 @@ struct LocationMarkerView_Previews: PreviewProvider, TestablePreview {
|
|||||||
|
|
||||||
LocationMarkerView()
|
LocationMarkerView()
|
||||||
.colorScheme(.dark)
|
.colorScheme(.dark)
|
||||||
|
|
||||||
LocationMarkerView(mode: .button)
|
|
||||||
|
|
||||||
LocationMarkerView(mode: .button)
|
|
||||||
.colorScheme(.dark)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ struct RoomListFiltersState {
|
|||||||
var availableFilters = Set(RoomListFilter.allCases)
|
var availableFilters = Set(RoomListFilter.allCases)
|
||||||
for filter in activeFilters {
|
for filter in activeFilters {
|
||||||
availableFilters.remove(filter)
|
availableFilters.remove(filter)
|
||||||
if let complementaryFilter = filter.incompatibleFilter {
|
if let incompatibleFilter = filter.incompatibleFilter {
|
||||||
availableFilters.remove(complementaryFilter)
|
availableFilters.remove(incompatibleFilter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return availableFilters.sorted(by: { $0.rawValue < $1.rawValue })
|
return availableFilters.sorted(by: { $0.rawValue < $1.rawValue })
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ struct StaticLocationScreen: View {
|
|||||||
context.send(viewAction: .selectLocation)
|
context.send(viewAction: .selectLocation)
|
||||||
} label: {
|
} label: {
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
LocationMarkerView(mode: .button)
|
CompoundIcon(\.shareIos)
|
||||||
Text(context.viewState.isSharingUserLocation ? L10n.screenShareMyLocationAction : L10n.screenShareThisLocationAction)
|
Text(context.viewState.isSharingUserLocation ? L10n.screenShareMyLocationAction : L10n.screenShareThisLocationAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:168fcdfd95bf0e928b3a5894096a394ddd840566cdcc9522f158accde7ceaa66
|
oid sha256:eb2fb780c30fd4beed3b7f70562b22882f475dd0536b2c96d3c0f3511ddceb17
|
||||||
size 83323
|
size 79174
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:ccfb8d354e43d1b1f878051aee601d48c15ccb33d24c3388a735b32b2b1a3ff9
|
oid sha256:fa6b2460268c0abb419beed38e44b72e635613c7527e153aa706025d1c493f25
|
||||||
size 99864
|
size 99191
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Replaced the share my location button icon with the iOS share icon.
|
||||||
Reference in New Issue
Block a user