iOS 26 minor fixes
This commit is contained in:
committed by
Stefan Ceriu
parent
e36dcfbc99
commit
8eb94e856c
@@ -6,17 +6,43 @@
|
||||
//
|
||||
|
||||
import Compound
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import SwiftUIIntrospect
|
||||
|
||||
extension View {
|
||||
@ViewBuilder
|
||||
func bloom() -> some View {
|
||||
modifier(BloomModifier())
|
||||
if #available(iOS 26, *) {
|
||||
modifier(BloomModifier())
|
||||
} else {
|
||||
modifier(OldBloomModifier())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@State private var standardAppearance = UINavigationBarAppearance()
|
||||
|
||||
@@ -34,19 +34,7 @@ struct HomeScreen: View {
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .navigationBarLeading) {
|
||||
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()
|
||||
}
|
||||
.accessibilityLabel(L10n.commonSettings)
|
||||
settingsButton
|
||||
}
|
||||
|
||||
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
|
||||
private var newRoomButton: some View {
|
||||
switch context.viewState.roomListMode {
|
||||
|
||||
@@ -215,7 +215,7 @@ struct MediaEventsTimelineScreen: View {
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .principal) {
|
||||
if #available(iOS 19, *) {
|
||||
if #available(iOS 26, *) {
|
||||
screenModePicker
|
||||
} else {
|
||||
screenModePicker
|
||||
|
||||
@@ -71,9 +71,9 @@ packages:
|
||||
exactVersion: 25.09.19-2
|
||||
# path: ../matrix-rust-sdk
|
||||
Compound:
|
||||
url: https://github.com/element-hq/compound-ios
|
||||
revision: 4ad0bd0acd825a905bb4955b32979fe34cc538eb
|
||||
# path: ../compound-ios
|
||||
# url: https://github.com/element-hq/compound-ios
|
||||
# revision: 4ad0bd0acd825a905bb4955b32979fe34cc538eb
|
||||
path: ../compound-ios
|
||||
AnalyticsEvents:
|
||||
url: https://github.com/matrix-org/matrix-analytics-events
|
||||
minorVersion: 0.29.2
|
||||
|
||||
Reference in New Issue
Block a user