This commit is contained in:
cheykrym 2025-12-13 01:42:52 +03:00
parent 692696b937
commit 6dc496b426
3 changed files with 40 additions and 21 deletions

View File

@ -2104,6 +2104,9 @@
}, },
"Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+." : { "Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+." : {
},
"Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+." : {
}, },
"Поделитесь идеями, сообщите об ошибке или расскажите, что работает отлично." : { "Поделитесь идеями, сообщите об ошибке или расскажите, что работает отлично." : {
"comment" : "feedback: info detail", "comment" : "feedback: info detail",
@ -3227,6 +3230,9 @@
}, },
"Экспериментальная поддержка iOS 15" : { "Экспериментальная поддержка iOS 15" : {
},
"Экспериментальная поддержка iOS 15/16" : {
}, },
"Это устройство" : { "Это устройство" : {
"comment" : "Заголовок секции текущего устройства" "comment" : "Заголовок секции текущего устройства"

View File

@ -97,7 +97,7 @@ struct LoginView: View {
private var shouldShowLegacySupportNotice: Bool { private var shouldShowLegacySupportNotice: Bool {
#if os(iOS) #if os(iOS)
let requiredVersion = OperatingSystemVersion(majorVersion: 16, minorVersion: 0, patchVersion: 0) let requiredVersion = OperatingSystemVersion(majorVersion: 17, minorVersion: 0, patchVersion: 0)
return !ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) return !ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion)
#else #else
return false return false
@ -479,7 +479,7 @@ private struct LegacySupportNoticeView: View {
.font(.headline) .font(.headline)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)
Text("Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+.") Text("Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+.")
.font(.subheadline) .font(.subheadline)
.foregroundColor(.secondary) .foregroundColor(.secondary)
.multilineTextAlignment(.center) .multilineTextAlignment(.center)

View File

@ -12,6 +12,9 @@ struct SettingsView: View {
private let themeOptions = ThemeOption.ordered private let themeOptions = ThemeOption.ordered
private let profileService = ProfileService() private let profileService = ProfileService()
private let messengerAvatarSize: CGFloat = 96 private let messengerAvatarSize: CGFloat = 96
private let bannerRowInsets = EdgeInsets(top: 4, leading: 0, bottom: 4, trailing: 0)
private let aboutRowInsets = EdgeInsets(top: 2, leading: 0, bottom: 2, trailing: 0)
private let compactSectionSpacing: CGFloat = 6
private var selectedThemeOption: ThemeOption { private var selectedThemeOption: ThemeOption {
ThemeOption.option(for: themeManager.theme) ThemeOption.option(for: themeManager.theme)
@ -21,7 +24,7 @@ struct SettingsView: View {
Form { Form {
if shouldShowLegacySupportBanner { if shouldShowLegacySupportBanner {
LegacySupportBanner() LegacySupportBanner()
.listRowInsets(EdgeInsets(top: 12, leading: 0, bottom: 4, trailing: 0)) .listRowInsets(bannerRowInsets)
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
} }
@ -157,6 +160,7 @@ struct SettingsView: View {
loadMessengerProfileIfNeeded(force: true) loadMessengerProfileIfNeeded(force: true)
} }
} }
.applyFormSectionSpacing(compactSectionSpacing)
} }
@ViewBuilder @ViewBuilder
@ -171,7 +175,7 @@ struct SettingsView: View {
statusTags: messengerStatusTags(for: profile), statusTags: messengerStatusTags(for: profile),
isOfficial: profile.isVerified isOfficial: profile.isVerified
) )
.listRowInsets(EdgeInsets(top: 16, leading: 0, bottom: 8, trailing: 0)) .listRowInsets(bannerRowInsets)
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
} else if isMessengerProfileLoading { } else if isMessengerProfileLoading {
HStack { HStack {
@ -179,8 +183,8 @@ struct SettingsView: View {
ProgressView() ProgressView()
Spacer() Spacer()
} }
.padding(.vertical, 24) .padding(.vertical, 12)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) .listRowInsets(bannerRowInsets)
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
} else if let error = messengerProfileError { } else if let error = messengerProfileError {
VStack(spacing: 8) { VStack(spacing: 8) {
@ -193,8 +197,8 @@ struct SettingsView: View {
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
} }
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.padding(.vertical, 16) .padding(.vertical, 12)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) .listRowInsets(bannerRowInsets)
.listRowBackground(Color.clear) .listRowBackground(Color.clear)
} }
} }
@ -348,7 +352,7 @@ struct SettingsView: View {
private var shouldShowLegacySupportBanner: Bool { private var shouldShowLegacySupportBanner: Bool {
#if os(iOS) #if os(iOS)
let requiredVersion = OperatingSystemVersion(majorVersion: 16, minorVersion: 0, patchVersion: 0) let requiredVersion = OperatingSystemVersion(majorVersion: 17, minorVersion: 0, patchVersion: 0)
return !ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion) return !ProcessInfo.processInfo.isOperatingSystemAtLeast(requiredVersion)
#else #else
return false return false
@ -365,13 +369,12 @@ struct SettingsView: View {
@ViewBuilder @ViewBuilder
private var aboutSection: some View { private var aboutSection: some View {
if let _ = messengerProfile { if let _ = messengerProfile {
Section() { card {
card { VStack(spacing: 0) {
VStack(spacing: 0) { infoRow(
infoRow( title: NSLocalizedString("Юзернейм", comment: ""),
title: NSLocalizedString("Юзернейм", comment: ""), value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user")
value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user") )
)
// if let membership = membershipDescription { // if let membership = membershipDescription {
// rowDivider // rowDivider
@ -386,11 +389,10 @@ struct SettingsView: View {
// title: NSLocalizedString("Ваш рейтинг", comment: "Messenger settings rating title"), // title: NSLocalizedString("Ваш рейтинг", comment: "Messenger settings rating title"),
// value: ratingDisplayValue // value: ratingDisplayValue
// ) // )
}
} }
.listRowInsets(EdgeInsets(top: 8, leading: 0, bottom: 8, trailing: 0))
.listRowBackground(Color.clear)
} }
.listRowInsets(aboutRowInsets)
.listRowBackground(Color.clear)
} }
} }
@ -458,6 +460,17 @@ struct SettingsView: View {
} }
} }
private extension View {
@ViewBuilder
func applyFormSectionSpacing(_ spacing: CGFloat) -> some View {
if #available(iOS 17.0, *) {
self.listSectionSpacing(.custom(spacing))
} else {
self
}
}
}
private struct LegacySupportBanner: View { private struct LegacySupportBanner: View {
var body: some View { var body: some View {
HStack(alignment: .top, spacing: 12) { HStack(alignment: .top, spacing: 12) {
@ -466,9 +479,9 @@ private struct LegacySupportBanner: View {
.foregroundColor(.yellow) .foregroundColor(.yellow)
VStack(alignment: .leading, spacing: 4) { VStack(alignment: .leading, spacing: 4) {
Text("Экспериментальная поддержка iOS 15") Text("Экспериментальная поддержка iOS 15/16")
.font(.headline) .font(.headline)
Text("Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+.") Text("Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+.")
.font(.subheadline) .font(.subheadline)
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }