mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
implemented mediaRecordingTooltip
This commit is contained in:
parent
fbae7f359e
commit
5e47a80abb
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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";
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user