mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
iOS 26 minor fixes
This commit is contained in:
committed by
Stefan Ceriu
parent
12dc6f42ba
commit
2de50ab036
@@ -6,17 +6,43 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import Compound
|
import Compound
|
||||||
|
import Foundation
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import SwiftUIIntrospect
|
import SwiftUIIntrospect
|
||||||
|
|
||||||
extension View {
|
extension View {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
func bloom() -> some View {
|
func bloom() -> some View {
|
||||||
modifier(BloomModifier())
|
if #available(iOS 26, *) {
|
||||||
|
modifier(BloomModifier())
|
||||||
|
} else {
|
||||||
|
modifier(OldBloomModifier())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct BloomModifier: ViewModifier {
|
private struct BloomModifier: ViewModifier {
|
||||||
|
@State private var height = CGFloat.zero
|
||||||
|
|
||||||
|
func body(content: Content) -> some View {
|
||||||
|
content
|
||||||
|
.onGeometryChange(for: CGFloat.self) { proxy in
|
||||||
|
proxy.safeAreaInsets.top
|
||||||
|
} action: { height in
|
||||||
|
self.height = height
|
||||||
|
}
|
||||||
|
.overlay(alignment: .top) {
|
||||||
|
LinearGradient(gradient: .compound.subtle,
|
||||||
|
startPoint: .top,
|
||||||
|
endPoint: .init(x: 0.5, y: 0.35))
|
||||||
|
.ignoresSafeArea(edges: .all)
|
||||||
|
.frame(height: height)
|
||||||
|
.allowsHitTesting(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private struct OldBloomModifier: ViewModifier {
|
||||||
@Environment(\.colorScheme) private var colorScheme
|
@Environment(\.colorScheme) private var colorScheme
|
||||||
|
|
||||||
@State private var standardAppearance = UINavigationBarAppearance()
|
@State private var standardAppearance = UINavigationBarAppearance()
|
||||||
|
|||||||
@@ -34,19 +34,7 @@ struct HomeScreen: View {
|
|||||||
@ToolbarContentBuilder
|
@ToolbarContentBuilder
|
||||||
private var toolbar: some ToolbarContent {
|
private var toolbar: some ToolbarContent {
|
||||||
ToolbarItem(placement: .navigationBarLeading) {
|
ToolbarItem(placement: .navigationBarLeading) {
|
||||||
Button {
|
settingsButton
|
||||||
context.send(viewAction: .showSettings)
|
|
||||||
} label: {
|
|
||||||
LoadableAvatarImage(url: context.viewState.userAvatarURL,
|
|
||||||
name: context.viewState.userDisplayName,
|
|
||||||
contentID: context.viewState.userID,
|
|
||||||
avatarSize: .user(on: .chats),
|
|
||||||
mediaProvider: context.mediaProvider)
|
|
||||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
|
|
||||||
.overlayBadge(10, isBadged: context.viewState.requiresExtraAccountSetup)
|
|
||||||
.compositingGroup()
|
|
||||||
}
|
|
||||||
.accessibilityLabel(L10n.commonSettings)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
@@ -54,6 +42,23 @@ struct HomeScreen: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var settingsButton: some View {
|
||||||
|
Button {
|
||||||
|
context.send(viewAction: .showSettings)
|
||||||
|
} label: {
|
||||||
|
LoadableAvatarImage(url: context.viewState.userAvatarURL,
|
||||||
|
name: context.viewState.userDisplayName,
|
||||||
|
contentID: context.viewState.userID,
|
||||||
|
avatarSize: .user(on: .chats),
|
||||||
|
mediaProvider: context.mediaProvider)
|
||||||
|
.accessibilityIdentifier(A11yIdentifiers.homeScreen.userAvatar)
|
||||||
|
.overlayBadge(10, isBadged: context.viewState.requiresExtraAccountSetup)
|
||||||
|
.compositingGroup()
|
||||||
|
.clipShape(.circle)
|
||||||
|
}
|
||||||
|
.accessibilityLabel(L10n.commonSettings)
|
||||||
|
}
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var newRoomButton: some View {
|
private var newRoomButton: some View {
|
||||||
switch context.viewState.roomListMode {
|
switch context.viewState.roomListMode {
|
||||||
|
|||||||
+1
-1
@@ -215,7 +215,7 @@ struct MediaEventsTimelineScreen: View {
|
|||||||
@ToolbarContentBuilder
|
@ToolbarContentBuilder
|
||||||
private var toolbar: some ToolbarContent {
|
private var toolbar: some ToolbarContent {
|
||||||
ToolbarItem(placement: .principal) {
|
ToolbarItem(placement: .principal) {
|
||||||
if #available(iOS 19, *) {
|
if #available(iOS 26, *) {
|
||||||
screenModePicker
|
screenModePicker
|
||||||
} else {
|
} else {
|
||||||
screenModePicker
|
screenModePicker
|
||||||
|
|||||||
+3
-3
@@ -71,9 +71,9 @@ packages:
|
|||||||
exactVersion: 25.09.19-2
|
exactVersion: 25.09.19-2
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
# url: https://github.com/element-hq/compound-ios
|
||||||
revision: 4ad0bd0acd825a905bb4955b32979fe34cc538eb
|
# revision: 4ad0bd0acd825a905bb4955b32979fe34cc538eb
|
||||||
# path: ../compound-ios
|
path: ../compound-ios
|
||||||
AnalyticsEvents:
|
AnalyticsEvents:
|
||||||
url: https://github.com/matrix-org/matrix-analytics-events
|
url: https://github.com/matrix-org/matrix-analytics-events
|
||||||
minorVersion: 0.29.2
|
minorVersion: 0.29.2
|
||||||
|
|||||||
Reference in New Issue
Block a user