diff --git a/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift b/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift index 80e0c00467..45bc3550ca 100644 --- a/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift +++ b/Swiftgram/SGSettingsUI/Sources/SGSettingsController.swift @@ -97,6 +97,7 @@ private enum SGBoolSetting: String { case hideChannelBottomButton case confirmCalls case swipeForVideoPIP + case mediaRecordingTooltip } private enum SGOneFromManySetting: String { @@ -255,6 +256,7 @@ private func SGControllerEntries(presentationData: PresentationData, callListSet id.increment(10000) entries.append(.header(id: id.count, section: .other, text: presentationData.strings.Appearance_Other.uppercased(), badge: nil)) + entries.append(.toggle(id: id.count, section: .other, settingName: .mediaRecordingTooltip, value: SGSimpleSettings.shared.mediaRecordingTooltip, text: i18n("Settings.mediaRecordingTooltip", lang), enabled: true)) entries.append(.toggle(id: id.count, section: .other, settingName: .swipeForVideoPIP, value: SGSimpleSettings.shared.videoPIPSwipeDirection == SGSimpleSettings.VideoPIPSwipeDirection.up.rawValue, text: i18n("Settings.swipeForVideoPIP", lang), enabled: true)) entries.append(.notice(id: id.count, section: .other, text: i18n("Settings.swipeForVideoPIP.Notice", lang))) entries.append(.toggle(id: id.count, section: .other, settingName: .hideChannelBottomButton, value: !SGSimpleSettings.shared.hideChannelBottomButton, text: i18n("Settings.showChannelBottomButton", lang), enabled: true)) @@ -473,6 +475,8 @@ public func sgSettingsController(context: AccountContext/*, focusOnItemTag: Int? SGSimpleSettings.shared.confirmCalls = value case .swipeForVideoPIP: SGSimpleSettings.shared.videoPIPSwipeDirection = value ? SGSimpleSettings.VideoPIPSwipeDirection.up.rawValue : SGSimpleSettings.VideoPIPSwipeDirection.none.rawValue + case .mediaRecordingTooltip: + SGSimpleSettings.shared.mediaRecordingTooltip = value } }, updateSliderValue: { setting, value in switch (setting) { diff --git a/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift b/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift index d779d47c07..ba3cc88417 100644 --- a/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift +++ b/Swiftgram/SGSimpleSettings/Sources/SimpleSettings.swift @@ -132,6 +132,7 @@ public class SGSimpleSettings { case status case dismissedSGSuggestions case duckyAppIconAvailable + case mediaRecordingTooltip } public enum DownloadSpeedBoostValues: String, CaseIterable { @@ -246,7 +247,8 @@ public class SGSimpleSettings { Keys.inputToolbar.rawValue: false, Keys.primaryUserId.rawValue: "", Keys.dismissedSGSuggestions.rawValue: [], - Keys.duckyAppIconAvailable.rawValue: true + Keys.duckyAppIconAvailable.rawValue: true, + Keys.mediaRecordingTooltip.rawValue: true, ] public static let groupDefaultValues: [String: Any] = [ @@ -463,6 +465,9 @@ public class SGSimpleSettings { @UserDefault(key: Keys.duckyAppIconAvailable.rawValue) public var duckyAppIconAvailable: Bool + + @UserDefault(key: Keys.mediaRecordingTooltip.rawValue) + public var mediaRecordingTooltip: Bool } extension SGSimpleSettings { diff --git a/Swiftgram/SGStrings/Strings/en.lproj/SGLocalizable.strings b/Swiftgram/SGStrings/Strings/en.lproj/SGLocalizable.strings index f37c56ea3f..6cd3fb811a 100644 --- a/Swiftgram/SGStrings/Strings/en.lproj/SGLocalizable.strings +++ b/Swiftgram/SGStrings/Strings/en.lproj/SGLocalizable.strings @@ -155,6 +155,8 @@ "Settings.swipeForVideoPIP" = "Video PIP with Swipe"; "Settings.swipeForVideoPIP.Notice" = "If enabled, swiping video will open it in Picture-in-Picture mode."; +"Settings.mediaRecordingTooltip" = "Media Recording Tooltip"; + "SessionBackup.Title" = "Accounts Backup"; "SessionBackup.Sessions.Title" = "Sessions"; "SessionBackup.Actions.Backup" = "Backup to Keychain"; diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4b140b19e1..5045c28a15 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -10401,6 +10401,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } func displayMediaRecordingTooltip() { + // MARK: Swiftgram + guard SGSimpleSettings.shared.mediaRecordingTooltip else { return } + guard let peer = self.presentationInterfaceState.renderedPeer?.peer else { return }