mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Even more space tweaks (#4588)
* Bring back the button to share a space on iOS 26. * Remove the setting and disable the space tab on iOS 17. (The tab bar is broken on iPadOS 17).
This commit is contained in:
@@ -130,7 +130,7 @@ struct StaticLocationScreen: View {
|
||||
Image(systemName: "square.and.arrow.up")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ViewBuilder
|
||||
private var shareSheet: some View {
|
||||
let location = context.viewState.initialMapCenter
|
||||
@@ -139,8 +139,17 @@ struct StaticLocationScreen: View {
|
||||
applicationActivities: ShareToMapsAppActivity.MapsAppType.allCases.map { ShareToMapsAppActivity(type: $0, location: location, locationDescription: locationDescription) })
|
||||
.edgesIgnoringSafeArea(.bottom)
|
||||
.presentationDetents([.medium, .large])
|
||||
.presentationCompactAdaptation(shareSheetCompactPresentation)
|
||||
.presentationDragIndicator(.hidden)
|
||||
}
|
||||
|
||||
private var shareSheetCompactPresentation: PresentationAdaptation {
|
||||
if #available(iOS 26.0, *) {
|
||||
.none // ShareLinks use a popover presentation on iOS 26, let it match that.
|
||||
} else {
|
||||
.sheet
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
-1
@@ -41,7 +41,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
||||
|
||||
var enableOnlySignedDeviceIsolationMode: Bool { get set }
|
||||
var enableKeyShareOnInvite: Bool { get set }
|
||||
var spacesEnabled: Bool { get set }
|
||||
var hideQuietNotificationAlerts: Bool { get set }
|
||||
|
||||
var hideUnreadMessagesBadge: Bool { get set }
|
||||
|
||||
-4
@@ -33,10 +33,6 @@ struct DeveloperOptionsScreen: View {
|
||||
}
|
||||
|
||||
Section("General") {
|
||||
Toggle(isOn: $context.spacesEnabled) {
|
||||
Text("Spaces")
|
||||
}
|
||||
|
||||
Toggle(isOn: $context.nextGenHTMLParserEnabled) {
|
||||
Text("Next gen HTML parsing")
|
||||
}
|
||||
|
||||
@@ -55,20 +55,27 @@ struct SpaceScreen: View {
|
||||
mediaProvider: context.mediaProvider)
|
||||
}
|
||||
|
||||
ToolbarItemGroup(placement: .secondaryAction) {
|
||||
// FIXME: The ShareLink crashes on iOS 26 due to the share sheet failing to morph out of the button 🤦♂️
|
||||
if let permalink = context.viewState.permalink, #unavailable(iOS 26.0) {
|
||||
Section {
|
||||
ShareLink(item: permalink) {
|
||||
Label(L10n.actionShare, icon: \.shareIos)
|
||||
// This should really use a ToolbarItemGroup(placement: .secondaryAction), however it
|
||||
// was crashing on iOS 26.0 when tapping the ShareLink as the popover presentation
|
||||
// controller attempts to anchor itself to the button that is no longer visible.
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Menu {
|
||||
if let permalink = context.viewState.permalink {
|
||||
Section {
|
||||
ShareLink(item: permalink) {
|
||||
Label(L10n.actionShare, icon: \.shareIos)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
Button(role: .destructive) { context.send(viewAction: .leaveSpace) } label: {
|
||||
Label(L10n.actionLeaveSpace, icon: \.leave)
|
||||
|
||||
Section {
|
||||
Button(role: .destructive) { context.send(viewAction: .leaveSpace) } label: {
|
||||
Label(L10n.actionLeaveSpace, icon: \.leave)
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
// Use an SF Symbol to match what ToolbarItemGroup(placement: .secondaryAction) would give us.
|
||||
Image(systemSymbol: .ellipsis)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user