diff --git a/yobble/Resources/Localizable.xcstrings b/yobble/Resources/Localizable.xcstrings index 7a53e5d..604893e 100644 --- a/yobble/Resources/Localizable.xcstrings +++ b/yobble/Resources/Localizable.xcstrings @@ -2104,6 +2104,9 @@ }, "Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+." : { + }, + "Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+." : { + }, "Поделитесь идеями, сообщите об ошибке или расскажите, что работает отлично." : { "comment" : "feedback: info detail", @@ -3227,6 +3230,9 @@ }, "Экспериментальная поддержка iOS 15" : { + }, + "Экспериментальная поддержка iOS 15/16" : { + }, "Это устройство" : { "comment" : "Заголовок секции текущего устройства" diff --git a/yobble/Views/Login/LoginView.swift b/yobble/Views/Login/LoginView.swift index 61cf95d..b8a5998 100644 --- a/yobble/Views/Login/LoginView.swift +++ b/yobble/Views/Login/LoginView.swift @@ -97,7 +97,7 @@ struct LoginView: View { private var shouldShowLegacySupportNotice: Bool { #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) #else return false @@ -479,7 +479,7 @@ private struct LegacySupportNoticeView: View { .font(.headline) .multilineTextAlignment(.center) - Text("Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+.") + Text("Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+.") .font(.subheadline) .foregroundColor(.secondary) .multilineTextAlignment(.center) diff --git a/yobble/Views/Tab/Settings/SettingsView.swift b/yobble/Views/Tab/Settings/SettingsView.swift index 2781633..efd3cb2 100644 --- a/yobble/Views/Tab/Settings/SettingsView.swift +++ b/yobble/Views/Tab/Settings/SettingsView.swift @@ -12,6 +12,9 @@ struct SettingsView: View { private let themeOptions = ThemeOption.ordered private let profileService = ProfileService() 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 { ThemeOption.option(for: themeManager.theme) @@ -21,7 +24,7 @@ struct SettingsView: View { Form { if shouldShowLegacySupportBanner { LegacySupportBanner() - .listRowInsets(EdgeInsets(top: 12, leading: 0, bottom: 4, trailing: 0)) + .listRowInsets(bannerRowInsets) .listRowBackground(Color.clear) } @@ -157,6 +160,7 @@ struct SettingsView: View { loadMessengerProfileIfNeeded(force: true) } } + .applyFormSectionSpacing(compactSectionSpacing) } @ViewBuilder @@ -171,7 +175,7 @@ struct SettingsView: View { statusTags: messengerStatusTags(for: profile), isOfficial: profile.isVerified ) - .listRowInsets(EdgeInsets(top: 16, leading: 0, bottom: 8, trailing: 0)) + .listRowInsets(bannerRowInsets) .listRowBackground(Color.clear) } else if isMessengerProfileLoading { HStack { @@ -179,8 +183,8 @@ struct SettingsView: View { ProgressView() Spacer() } - .padding(.vertical, 24) - .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) + .padding(.vertical, 12) + .listRowInsets(bannerRowInsets) .listRowBackground(Color.clear) } else if let error = messengerProfileError { VStack(spacing: 8) { @@ -193,8 +197,8 @@ struct SettingsView: View { .buttonStyle(.borderedProminent) } .frame(maxWidth: .infinity) - .padding(.vertical, 16) - .listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)) + .padding(.vertical, 12) + .listRowInsets(bannerRowInsets) .listRowBackground(Color.clear) } } @@ -348,7 +352,7 @@ struct SettingsView: View { private var shouldShowLegacySupportBanner: Bool { #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) #else return false @@ -365,13 +369,12 @@ struct SettingsView: View { @ViewBuilder private var aboutSection: some View { if let _ = messengerProfile { - Section() { - card { - VStack(spacing: 0) { - infoRow( - title: NSLocalizedString("Юзернейм", comment: ""), - value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user") - ) + card { + VStack(spacing: 0) { + infoRow( + title: NSLocalizedString("Юзернейм", comment: ""), + value: loginDisplay ?? NSLocalizedString("Неизвестный пользователь", comment: "Messenger settings unknown user") + ) // if let membership = membershipDescription { // rowDivider @@ -386,11 +389,10 @@ struct SettingsView: View { // title: NSLocalizedString("Ваш рейтинг", comment: "Messenger settings rating title"), // 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 { var body: some View { HStack(alignment: .top, spacing: 12) { @@ -466,9 +479,9 @@ private struct LegacySupportBanner: View { .foregroundColor(.yellow) VStack(alignment: .leading, spacing: 4) { - Text("Экспериментальная поддержка iOS 15") + Text("Экспериментальная поддержка iOS 15/16") .font(.headline) - Text("Поддержка iOS 15 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 16+.") + Text("Поддержка iOS 15/16 работает в экспериментальном режиме. Для лучшей совместимости требуется iOS 17+.") .font(.subheadline) .foregroundColor(.secondary) }