mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
removed LLS feature flag
This commit is contained in:
@@ -12,7 +12,6 @@ import SwiftUI
|
||||
struct LocationSharingScreenCoordinatorParameters {
|
||||
let interactionMode: LocationSharingInteractionMode
|
||||
let mapURLBuilder: MapTilerURLBuilderProtocol
|
||||
let liveLocationSharingEnabled: Bool
|
||||
let roomProxy: JoinedRoomProxyProtocol
|
||||
let timelineController: TimelineControllerProtocol
|
||||
let liveLocationManager: LiveLocationManagerProtocol
|
||||
@@ -42,7 +41,6 @@ final class LocationSharingScreenCoordinator: CoordinatorProtocol {
|
||||
|
||||
viewModel = LocationSharingScreenViewModel(interactionMode: parameters.interactionMode,
|
||||
mapURLBuilder: parameters.mapURLBuilder,
|
||||
liveLocationSharingEnabled: parameters.liveLocationSharingEnabled,
|
||||
roomProxy: parameters.roomProxy,
|
||||
timelineController: parameters.timelineController,
|
||||
liveLocationManager: parameters.liveLocationManager,
|
||||
|
||||
@@ -32,11 +32,9 @@ enum LocationSharingInteractionMode: Hashable {
|
||||
struct LocationSharingScreenViewState: BindableState {
|
||||
init(interactionMode: LocationSharingInteractionMode,
|
||||
mapURLBuilder: MapTilerURLBuilderProtocol,
|
||||
showLiveLocationSharingButton: Bool,
|
||||
ownUserID: String) {
|
||||
self.interactionMode = interactionMode
|
||||
self.mapURLBuilder = mapURLBuilder
|
||||
self.showLiveLocationSharingButton = showLiveLocationSharingButton
|
||||
self.ownUserID = ownUserID
|
||||
|
||||
let initialProfile: UserProfileProxy = switch interactionMode {
|
||||
@@ -65,7 +63,6 @@ struct LocationSharingScreenViewState: BindableState {
|
||||
|
||||
let interactionMode: LocationSharingInteractionMode
|
||||
let mapURLBuilder: MapTilerURLBuilderProtocol
|
||||
let showLiveLocationSharingButton: Bool
|
||||
let ownUserID: String
|
||||
var userProfiles: [String: UserProfileProxy]
|
||||
var liveLocationShares: [LiveLocationShare] = []
|
||||
|
||||
@@ -33,7 +33,6 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
|
||||
|
||||
init(interactionMode: LocationSharingInteractionMode,
|
||||
mapURLBuilder: MapTilerURLBuilderProtocol,
|
||||
liveLocationSharingEnabled: Bool,
|
||||
roomProxy: JoinedRoomProxyProtocol,
|
||||
timelineController: TimelineControllerProtocol,
|
||||
liveLocationManager: LiveLocationManagerProtocol,
|
||||
@@ -50,7 +49,6 @@ class LocationSharingScreenViewModel: LocationSharingScreenViewModelType, Locati
|
||||
|
||||
super.init(initialViewState: .init(interactionMode: interactionMode,
|
||||
mapURLBuilder: mapURLBuilder,
|
||||
showLiveLocationSharingButton: liveLocationSharingEnabled,
|
||||
ownUserID: roomProxy.ownUserID),
|
||||
mediaProvider: mediaProvider)
|
||||
|
||||
@@ -328,8 +326,7 @@ extension LocationSharingScreenViewModel {
|
||||
}
|
||||
|
||||
static func mock(type: MockType,
|
||||
senderID: String = "@dan:matrix.org",
|
||||
liveLocationSharingEnabled: Bool = true) -> LocationSharingScreenViewModel {
|
||||
senderID: String = "@dan:matrix.org") -> LocationSharingScreenViewModel {
|
||||
let interactionMode: LocationSharingInteractionMode = switch type {
|
||||
case .picker:
|
||||
.picker
|
||||
@@ -378,7 +375,6 @@ extension LocationSharingScreenViewModel {
|
||||
|
||||
return LocationSharingScreenViewModel(interactionMode: interactionMode,
|
||||
mapURLBuilder: ServiceLocator.shared.settings.mapTilerConfiguration,
|
||||
liveLocationSharingEnabled: liveLocationSharingEnabled,
|
||||
roomProxy: roomProxy,
|
||||
timelineController: MockTimelineController(),
|
||||
liveLocationManager: LiveLocationManagerMock(),
|
||||
|
||||
@@ -12,13 +12,6 @@ struct LocationPickerSheet: View {
|
||||
@Bindable var context: LocationSharingScreenViewModel.Context
|
||||
@State private var height: CGFloat = .zero
|
||||
|
||||
/// Fixes an iOS 26 sheet issue
|
||||
/// if the content doesn't meet a certain size
|
||||
/// additional insets are added.
|
||||
private var additionalHeight: CGFloat {
|
||||
context.viewState.showLiveLocationSharingButton ? 0 : 28
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
Text(L10n.screenSharingLocationOptionSheetTitle)
|
||||
@@ -26,6 +19,7 @@ struct LocationPickerSheet: View {
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.padding(.top, 29)
|
||||
.padding(.bottom, 25)
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .selectLocation)
|
||||
} label: {
|
||||
@@ -39,14 +33,13 @@ struct LocationPickerSheet: View {
|
||||
iconColor: .compound.iconSecondary)
|
||||
}
|
||||
}
|
||||
if context.viewState.showLiveLocationSharingButton {
|
||||
Button {
|
||||
context.send(viewAction: .startLiveLocation)
|
||||
} label: {
|
||||
LocationPickerLabel(text: L10n.actionShareLiveLocation,
|
||||
icon: \.locationPinSolid,
|
||||
iconColor: .compound.iconAccentPrimary)
|
||||
}
|
||||
|
||||
Button {
|
||||
context.send(viewAction: .startLiveLocation)
|
||||
} label: {
|
||||
LocationPickerLabel(text: L10n.actionShareLiveLocation,
|
||||
icon: \.locationPinSolid,
|
||||
iconColor: .compound.iconAccentPrimary)
|
||||
}
|
||||
}
|
||||
.readHeight($height)
|
||||
@@ -54,7 +47,7 @@ struct LocationPickerSheet: View {
|
||||
.presentationBackground(.compound.bgCanvasDefault)
|
||||
.presentationBackgroundInteraction(.enabled)
|
||||
.presentationDragIndicator(.hidden)
|
||||
.presentationDetents([.height(height + additionalHeight)])
|
||||
.presentationDetents([.height(height)])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,9 +126,7 @@ struct LocationSharingScreen: View {
|
||||
|
||||
struct LocationSharingScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = LocationSharingScreenViewModel.mock(type: .staticSenderLocation)
|
||||
|
||||
static let withoutLiveSharingViewModel = LocationSharingScreenViewModel.mock(type: .picker, liveLocationSharingEnabled: false)
|
||||
|
||||
|
||||
static let pinViewModel = LocationSharingScreenViewModel.mock(type: .staticPinLocation)
|
||||
|
||||
static let pickerViewModel = LocationSharingScreenViewModel.mock(type: .picker)
|
||||
@@ -141,11 +139,6 @@ struct LocationSharingScreen_Previews: PreviewProvider, TestablePreview {
|
||||
}
|
||||
.previewDisplayName("Picker")
|
||||
|
||||
ElementNavigationStack {
|
||||
LocationSharingScreen(context: withoutLiveSharingViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Picker without live location sharing")
|
||||
|
||||
ElementNavigationStack {
|
||||
LocationSharingScreen(context: viewModel.context)
|
||||
}
|
||||
|
||||
@@ -171,12 +171,11 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
.weakAssign(to: \.state.isKnockingEnabled, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
appSettings.$liveLocationSharingEnabled
|
||||
.combineLatest(appSettings.$liveLocationSharingTimeoutDatesByRoomID)
|
||||
appSettings.$liveLocationSharingTimeoutDatesByRoomID
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] isEnabled, timeoutDatesByRoomID in
|
||||
.sink { [weak self] timeoutDatesByRoomID in
|
||||
guard let self else { return }
|
||||
state.isSharingLiveLocation = isEnabled && timeoutDatesByRoomID.keys.contains(roomProxy.id)
|
||||
state.isSharingLiveLocation = timeoutDatesByRoomID.keys.contains(roomProxy.id)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
|
||||
-1
@@ -61,7 +61,6 @@ protocol AdvancedSettingsProtocol: AnyObject {
|
||||
var sharePresence: Bool { get set }
|
||||
var optimizeMediaUploads: Bool { get set }
|
||||
var liveLocationMinimumDistanceUpdate: Int { get set }
|
||||
var liveLocationSharingEnabled: Bool { get set }
|
||||
}
|
||||
|
||||
extension AppSettings: AdvancedSettingsProtocol { }
|
||||
|
||||
+2
-6
@@ -44,9 +44,7 @@ struct AdvancedSettingsScreen: View {
|
||||
|
||||
moderationAndSafetySection
|
||||
timelineMediaSection
|
||||
if context.liveLocationSharingEnabled {
|
||||
liveLocationSection
|
||||
}
|
||||
liveLocationSection
|
||||
}
|
||||
.compoundList()
|
||||
.navigationTitle(L10n.commonAdvancedSettings)
|
||||
@@ -164,9 +162,7 @@ private extension AppAppearance {
|
||||
struct AdvancedSettingsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = {
|
||||
AppSettings.resetAllSettings()
|
||||
let appSettings = AppSettings()
|
||||
appSettings.liveLocationSharingEnabled = true
|
||||
return AdvancedSettingsScreenViewModel(advancedSettings: appSettings,
|
||||
return AdvancedSettingsScreenViewModel(advancedSettings: AppSettings(),
|
||||
analytics: ServiceLocator.shared.analytics,
|
||||
clientProxy: ClientProxyMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
+1
-3
@@ -70,9 +70,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
var linkPreviewsEnabled: Bool { get set }
|
||||
|
||||
var linkNewDeviceEnabled: Bool { get set }
|
||||
|
||||
var liveLocationSharingEnabled: Bool { get set }
|
||||
|
||||
|
||||
var roomThreadListEnabled: Bool { get set }
|
||||
}
|
||||
|
||||
|
||||
-5
@@ -91,11 +91,6 @@ struct DeveloperOptionsScreen: View {
|
||||
.foregroundStyle(.compound.textCriticalPrimary)
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.liveLocationSharingEnabled) {
|
||||
Text("Live location sharing")
|
||||
Text("Requires app reboot")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.knockingEnabled) {
|
||||
Text("Knocking")
|
||||
Text("Ask to join rooms")
|
||||
|
||||
Reference in New Issue
Block a user