diff --git a/Riot/Modules/Room/Location/RoomTimelineLocationView.swift b/Riot/Modules/Room/Location/RoomTimelineLocationView.swift index 882a277c96..5ffb88e154 100644 --- a/Riot/Modules/Room/Location/RoomTimelineLocationView.swift +++ b/Riot/Modules/Room/Location/RoomTimelineLocationView.swift @@ -35,6 +35,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat @IBOutlet private var descriptionContainerView: UIView! @IBOutlet private var descriptionLabel: UILabel! @IBOutlet private var descriptionIcon: UIImageView! + @IBOutlet private var attributionLabel: UILabel! private var mapView: MGLMapView! private var annotationView: LocationMarkerView? @@ -101,6 +102,7 @@ class RoomTimelineLocationView: UIView, NibLoadable, Themable, MGLMapViewDelegat descriptionLabel.textColor = theme.colors.primaryContent descriptionLabel.font = theme.fonts.footnote descriptionIcon.tintColor = theme.colors.accent + attributionLabel.textColor = theme.colors.accent layer.borderColor = theme.colors.quinaryContent.cgColor } diff --git a/Riot/Modules/Room/Location/RoomTimelineLocationView.xib b/Riot/Modules/Room/Location/RoomTimelineLocationView.xib index acc469b748..fb2e22a294 100644 --- a/Riot/Modules/Room/Location/RoomTimelineLocationView.xib +++ b/Riot/Modules/Room/Location/RoomTimelineLocationView.xib @@ -1,9 +1,9 @@ - + - + @@ -15,48 +15,72 @@ - - + + - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + - - - + + + + diff --git a/RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingView.swift b/RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingView.swift index 0d40d14d99..5c69349ccf 100644 --- a/RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingView.swift +++ b/RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingView.swift @@ -32,62 +32,70 @@ struct LocationSharingView: View { var body: some View { NavigationView { - LocationSharingMapView(tileServerMapURL: context.viewState.mapStyleURL, - avatarData: context.viewState.avatarData, - location: context.viewState.location, - errorSubject: context.viewState.errorSubject, - userLocation: $context.userLocation) - .toolbar { - ToolbarItem(placement: .navigationBarLeading) { - Button(VectorL10n.cancel, action: { - context.send(viewAction: .cancel) - }) - } - ToolbarItem(placement: .principal) { - Text(VectorL10n.locationSharingTitle) - .font(.headline) - .foregroundColor(theme.colors.primaryContent) - } - ToolbarItem(placement: .navigationBarTrailing) { - if context.viewState.location != nil { - Button { - context.send(viewAction: .share) - } label: { - Image(uiImage: Asset.Images.locationShareIcon.image) - .accessibilityIdentifier("LocationSharingView.shareButton") - } - .disabled(!context.viewState.shareButtonEnabled) - } else { - Button(VectorL10n.locationSharingShareAction, action: { - context.send(viewAction: .share) - }) - .disabled(!context.viewState.shareButtonEnabled) - } - } + ZStack(alignment: .bottom) { + LocationSharingMapView(tileServerMapURL: context.viewState.mapStyleURL, + avatarData: context.viewState.avatarData, + location: context.viewState.location, + errorSubject: context.viewState.errorSubject, + userLocation: $context.userLocation) + .ignoresSafeArea() + + HStack { + Link("© MapTiler", destination: URL(string: "https://www.maptiler.com/copyright/")!) + Link("© OpenStreetMap contributors", destination: URL(string: "https://www.openstreetmap.org/copyright")!) + } + .font(theme.fonts.caption1) + } + .toolbar { + ToolbarItem(placement: .navigationBarLeading) { + Button(VectorL10n.cancel, action: { + context.send(viewAction: .cancel) + }) } - .navigationBarTitleDisplayMode(.inline) - .introspectNavigationController { navigationController in - ThemeService.shared().theme.applyStyle(onNavigationBar: navigationController.navigationBar) + ToolbarItem(placement: .principal) { + Text(VectorL10n.locationSharingTitle) + .font(.headline) + .foregroundColor(theme.colors.primaryContent) } - .ignoresSafeArea() - .alert(item: $context.alertInfo) { info in - if let secondaryButton = info.secondaryButton { - return Alert(title: Text(info.title), - message: subtitleTextForAlertInfo(info), - primaryButton: .default(Text(info.primaryButton.title)) { - info.primaryButton.action?() - }, - secondaryButton: .default(Text(secondaryButton.title)) { - secondaryButton.action?() - }) + ToolbarItem(placement: .navigationBarTrailing) { + if context.viewState.location != nil { + Button { + context.send(viewAction: .share) + } label: { + Image(uiImage: Asset.Images.locationShareIcon.image) + .accessibilityIdentifier("LocationSharingView.shareButton") + } + .disabled(!context.viewState.shareButtonEnabled) } else { - return Alert(title: Text(info.title), - message: subtitleTextForAlertInfo(info), - dismissButton: .default(Text(info.primaryButton.title)) { - info.primaryButton.action?() - }) + Button(VectorL10n.locationSharingShareAction, action: { + context.send(viewAction: .share) + }) + .disabled(!context.viewState.shareButtonEnabled) } } + } + .navigationBarTitleDisplayMode(.inline) + .introspectNavigationController { navigationController in + ThemeService.shared().theme.applyStyle(onNavigationBar: navigationController.navigationBar) + } + .alert(item: $context.alertInfo) { info in + if let secondaryButton = info.secondaryButton { + return Alert(title: Text(info.title), + message: subtitleTextForAlertInfo(info), + primaryButton: .default(Text(info.primaryButton.title)) { + info.primaryButton.action?() + }, + secondaryButton: .default(Text(secondaryButton.title)) { + secondaryButton.action?() + }) + } else { + return Alert(title: Text(info.title), + message: subtitleTextForAlertInfo(info), + dismissButton: .default(Text(info.primaryButton.title)) { + info.primaryButton.action?() + }) + } + } } .accentColor(theme.colors.accent) .activityIndicator(show: context.viewState.showLoadingIndicator) diff --git a/changelog.d/5609.change b/changelog.d/5609.change new file mode 100644 index 0000000000..b33dea26b3 --- /dev/null +++ b/changelog.d/5609.change @@ -0,0 +1 @@ +Add attribution to location sharing maps. \ No newline at end of file