From e4cf282f917fe4770e56fc02de54d9861661b81b Mon Sep 17 00:00:00 2001 From: Arthur Norat <norat.arthur@gmail.com> Date: Wed, 19 Mar 2025 14:04:23 -0300 Subject: [PATCH] feat: Add Kids Mode toggle to Settings View --- Podfile.lock | 2 +- .../iOS/Settings.bundle/en.lproj/Root.strings | 2 ++ .../Settings.bundle/pt-BR.lproj/Root.strings | Bin 19596 -> 19690 bytes Sources/Headers/VLCConstants.h | 2 ++ Sources/Settings/Model/SettingsSection.swift | 8 ++++++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Podfile.lock b/Podfile.lock index 30aed5be3..a195ec749 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -205,4 +205,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 65a7fa9ee482022fade614219df0522c6399aafe -COCOAPODS: 1.15.2 +COCOAPODS: 1.16.2 diff --git a/Resources/iOS/Settings.bundle/en.lproj/Root.strings b/Resources/iOS/Settings.bundle/en.lproj/Root.strings index 533c90bd7..b2881aee2 100644 --- a/Resources/iOS/Settings.bundle/en.lproj/Root.strings +++ b/Resources/iOS/Settings.bundle/en.lproj/Root.strings @@ -171,3 +171,5 @@ "SETTINGS_RESET" = "Reset the settings"; "SETTINGS_RESET_TITLE" = "Reset"; + +"SETTINGS_KIDSMODE_TOGGLE" = "Kids mode"; diff --git a/Resources/iOS/Settings.bundle/pt-BR.lproj/Root.strings b/Resources/iOS/Settings.bundle/pt-BR.lproj/Root.strings index 38832c02ce9be7bc71aa79f05a889d12578ace9e..69b15228f48d738f576a10ce90a14a2c756842e4 100644 GIT binary patch delta 86 zcmeB~$@pp}<Axre$qrIt9^MR|3@!}8489EhK-!fdo*@LtatA^mAWw-wfx#Atm4Nd3 c3@JdYz>vw1$B@R52qa5@>>Qw+H3Js|06e-78vp<R delta 9 QcmaDgld)$e<Axp|02a>#GXMYp diff --git a/Sources/Headers/VLCConstants.h b/Sources/Headers/VLCConstants.h index c5d22a5b1..453e96286 100644 --- a/Sources/Headers/VLCConstants.h +++ b/Sources/Headers/VLCConstants.h @@ -185,6 +185,8 @@ #define kVLCDonationAnonymousCustomerID @"kVLCDonationAnonymousCustomerID" +#define kVLCSettingEnableKidsMode @"kVLCSettingEnableKidsMode" + /* LEGACY KEYS, DO NOT USE IN NEW CODE */ #define kVLCFTPServer @"ftp-server" #define kVLCFTPLogin @"ftp-login" diff --git a/Sources/Settings/Model/SettingsSection.swift b/Sources/Settings/Model/SettingsSection.swift index a7b6ffbe5..bd5ec5313 100644 --- a/Sources/Settings/Model/SettingsSection.swift +++ b/Sources/Settings/Model/SettingsSection.swift @@ -175,11 +175,19 @@ enum MainOptions { subtitle: Localizer.getSubtitle(for: k), action: .showActionSheet(title: "SETTINGS_DARKTHEME", preferenceKey: k, hasInfo: false)) } + + static var kidsMode: SettingsItem { + .init(title: "SETTINGS_KIDSMODE_TOGGLE", + subtitle: "SETTINGS_KIDSMODE_SUBTITLE", + action: .toggle(SettingsItem.Toggle(preferenceKey: kVLCSettingEnableKidsMode)), + isTitleEmphasized: false) + } static func section() -> SettingsSection? { .init(title: nil, items: [ privacy, appearance, + kidsMode ]) } } -- GitLab