mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 13:28:50 +01:00
Use the new iOS 16.4 sheet background for app selection sheet (You'll need to use Xcode 14.3 going forward)
This commit is contained in:
parent
65431dc727
commit
356b58bf67
@ -47,10 +47,19 @@ public struct AppAccountsSelectorView: View {
|
||||
labelView
|
||||
}
|
||||
.sheet(isPresented: $isPresented, content: {
|
||||
accountsView.presentationDetents([.height(preferredHeight), .large])
|
||||
.onAppear {
|
||||
refreshAccounts()
|
||||
}
|
||||
if #available(iOS 16.4, *) {
|
||||
accountsView.presentationDetents([.height(preferredHeight), .large])
|
||||
.presentationBackground(.thinMaterial)
|
||||
.presentationCornerRadius(16)
|
||||
.onAppear {
|
||||
refreshAccounts()
|
||||
}
|
||||
} else {
|
||||
accountsView.presentationDetents([.height(preferredHeight), .large])
|
||||
.onAppear {
|
||||
refreshAccounts()
|
||||
}
|
||||
}
|
||||
})
|
||||
.onChange(of: currentAccount.account?.id) { _ in
|
||||
refreshAccounts()
|
||||
@ -80,6 +89,14 @@ public struct AppAccountsSelectorView: View {
|
||||
.accessibilityHint("accessibility.app-account.selector.accounts.hint")
|
||||
}
|
||||
|
||||
private var accountBackgroundColor: Color {
|
||||
if #available(iOS 16.4, *) {
|
||||
return Color.clear
|
||||
} else {
|
||||
return theme.secondaryBackgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
private var accountsView: some View {
|
||||
NavigationStack {
|
||||
List {
|
||||
@ -108,7 +125,7 @@ public struct AppAccountsSelectorView: View {
|
||||
}
|
||||
.listStyle(.insetGrouped)
|
||||
.scrollContentBackground(.hidden)
|
||||
.background(theme.secondaryBackgroundColor)
|
||||
.background(accountBackgroundColor)
|
||||
.navigationTitle("settings.section.accounts")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
|
@ -64,7 +64,6 @@ public struct AvatarView: View {
|
||||
AvatarPlaceholderView(size: size)
|
||||
}
|
||||
}
|
||||
.animation(nil)
|
||||
.frame(width: size.size.width, height: size.size.height)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user