Live Location Sharing Banner (#5370)

* Live Location Sharing Banner

# Conflicts:
#	ElementX.xcodeproj/project.pbxproj

* updated the top banner modifier and the top banner views

# Conflicts:
#	ElementX/Resources/Localizations/en-US.lproj/Localizable.strings
#	ElementX/Resources/Localizations/en.lproj/Localizable.strings

* improved the stopping function from the timeline item

* stop live location sharing before starting a new one.

* added some tests for LiveLocationManager

* pr suggestions
This commit is contained in:
Mauro
2026-04-10 14:50:42 +02:00
committed by GitHub
parent 148b292ca6
commit 922fcafcd5
47 changed files with 413 additions and 83 deletions
@@ -0,0 +1,39 @@
//
// Copyright 2025 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Compound
import SwiftUI
struct LiveLocationSharingBannerView: View {
var onStop: () -> Void
var body: some View {
HStack(spacing: 9) {
CompoundIcon(\.locationPinSolid, size: .medium, relativeTo: .compound.bodyMDSemibold)
.foregroundColor(Color.compound.iconSuccessPrimary)
.accessibilityHidden(true)
Text(L10n.screenRoomLiveLocationBanner)
.font(.compound.bodyMDSemibold)
.foregroundColor(.compound.textPrimary)
Spacer()
Button(L10n.actionStop, role: .destructive, action: onStop)
.buttonStyle(.compound(.primary, size: .small))
}
.padding(.vertical, 16)
.padding(.horizontal, 15)
.background(Color.compound.bgCanvasDefault)
.overlay(alignment: .top) { Color.compound.separatorPrimary.frame(height: 1) }
.overlay(alignment: .bottom) { Color.compound.separatorPrimary.frame(height: 1) }
}
}
struct LiveLocationSharingBannerView_Previews: PreviewProvider, TestablePreview {
static var previews: some View {
LiveLocationSharingBannerView { }
.previewLayout(.sizeThatFits)
}
}