Final changes

This commit is contained in:
Isaac 2023-12-21 01:17:07 +04:00
parent bb9ce8dedb
commit cbcdcd6f17
5 changed files with 23 additions and 15 deletions

View File

@ -72,7 +72,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
case keepChatNavigationStack(PresentationTheme, Bool) case keepChatNavigationStack(PresentationTheme, Bool)
case skipReadHistory(PresentationTheme, Bool) case skipReadHistory(PresentationTheme, Bool)
case unidirectionalSwipeToReply(Bool) case unidirectionalSwipeToReply(Bool)
case dustEffect(Bool) case callV2(Bool)
case alternativeStoryMedia(Bool) case alternativeStoryMedia(Bool)
case crashOnSlowQueries(PresentationTheme, Bool) case crashOnSlowQueries(PresentationTheme, Bool)
case crashOnMemoryPressure(PresentationTheme, Bool) case crashOnMemoryPressure(PresentationTheme, Bool)
@ -125,7 +125,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return DebugControllerSection.logging.rawValue return DebugControllerSection.logging.rawValue
case .webViewInspection, .resetWebViewCache: case .webViewInspection, .resetWebViewCache:
return DebugControllerSection.web.rawValue return DebugControllerSection.web.rawValue
case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .dustEffect, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure: case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .callV2, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure:
return DebugControllerSection.experiments.rawValue return DebugControllerSection.experiments.rawValue
case .clearTips, .resetNotifications, .crash, .resetData, .resetDatabase, .resetDatabaseAndCache, .resetHoles, .reindexUnread, .resetCacheIndex, .reindexCache, .resetBiometricsData, .optimizeDatabase, .photoPreview, .knockoutWallpaper, .storiesExperiment, .storiesJpegExperiment, .playlistPlayback, .enableQuickReactionSwitch, .voiceConference, .experimentalCompatibility, .enableDebugDataDisplay, .acceleratedStickers, .inlineForums, .localTranscription, .enableReactionOverrides, .restorePurchases: case .clearTips, .resetNotifications, .crash, .resetData, .resetDatabase, .resetDatabaseAndCache, .resetHoles, .reindexUnread, .resetCacheIndex, .reindexCache, .resetBiometricsData, .optimizeDatabase, .photoPreview, .knockoutWallpaper, .storiesExperiment, .storiesJpegExperiment, .playlistPlayback, .enableQuickReactionSwitch, .voiceConference, .experimentalCompatibility, .enableDebugDataDisplay, .acceleratedStickers, .inlineForums, .localTranscription, .enableReactionOverrides, .restorePurchases:
return DebugControllerSection.experiments.rawValue return DebugControllerSection.experiments.rawValue
@ -178,7 +178,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return 16 return 16
case .unidirectionalSwipeToReply: case .unidirectionalSwipeToReply:
return 17 return 17
case .dustEffect: case .callV2:
return 18 return 18
case .alternativeStoryMedia: case .alternativeStoryMedia:
return 19 return 19
@ -951,11 +951,11 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return settings return settings
}).start() }).start()
}) })
case let .dustEffect(value): case let .callV2(value):
return ItemListSwitchItem(presentationData: presentationData, title: "Dust Effect", value: value, sectionId: self.section, style: .blocks, updated: { value in return ItemListSwitchItem(presentationData: presentationData, title: "CallV2", value: value, sectionId: self.section, style: .blocks, updated: { value in
let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in
var settings = settings var settings = settings
settings.dustEffect = value settings.callV2 = value
return settings return settings
}).start() }).start()
}) })
@ -1426,7 +1426,7 @@ private func debugControllerEntries(sharedContext: SharedAccountContext, present
entries.append(.skipReadHistory(presentationData.theme, experimentalSettings.skipReadHistory)) entries.append(.skipReadHistory(presentationData.theme, experimentalSettings.skipReadHistory))
#endif #endif
entries.append(.unidirectionalSwipeToReply(experimentalSettings.unidirectionalSwipeToReply)) entries.append(.unidirectionalSwipeToReply(experimentalSettings.unidirectionalSwipeToReply))
entries.append(.dustEffect(experimentalSettings.dustEffect)) entries.append(.callV2(experimentalSettings.callV2))
entries.append(.alternativeStoryMedia(experimentalSettings.alternativeStoryMedia)) entries.append(.alternativeStoryMedia(experimentalSettings.alternativeStoryMedia))
} }
entries.append(.crashOnSlowQueries(presentationData.theme, experimentalSettings.crashOnLongQueries)) entries.append(.crashOnSlowQueries(presentationData.theme, experimentalSettings.crashOnLongQueries))

View File

@ -148,7 +148,12 @@ public final class CallController: ViewController {
} }
override public func loadDisplayNode() { override public func loadDisplayNode() {
var useV2 = self.call.context.sharedContext.immediateExperimentalUISettings.callV2
if let data = self.call.context.currentAppConfiguration.with({ $0 }).data, let _ = data["ios_killswitch_disable_callui_v2"] { if let data = self.call.context.currentAppConfiguration.with({ $0 }).data, let _ = data["ios_killswitch_disable_callui_v2"] {
useV2 = false
}
if !useV2 {
self.displayNode = CallControllerNode(sharedContext: self.sharedContext, account: self.account, presentationData: self.presentationData, statusBar: self.statusBar, debugInfo: self.call.debugInfo(), shouldStayHiddenUntilConnection: !self.call.isOutgoing && self.call.isIntegratedWithCallKit, easyDebugAccess: self.easyDebugAccess, call: self.call) self.displayNode = CallControllerNode(sharedContext: self.sharedContext, account: self.account, presentationData: self.presentationData, statusBar: self.statusBar, debugInfo: self.call.debugInfo(), shouldStayHiddenUntilConnection: !self.call.isOutgoing && self.call.isIntegratedWithCallKit, easyDebugAccess: self.easyDebugAccess, call: self.call)
self.isContentsReady.set(.single(true)) self.isContentsReady.set(.single(true))
} else { } else {

View File

@ -1673,10 +1673,13 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
let colorImage = generateSettingsMenuPeerColorsLabelIcon(colors: colors) let colorImage = generateSettingsMenuPeerColorsLabelIcon(colors: colors)
var boostIcon: UIImage? var boostIcon: UIImage?
var additionalBadge: String?
if let approximateBoostLevel = channel.approximateBoostLevel, approximateBoostLevel < 1 { if let approximateBoostLevel = channel.approximateBoostLevel, approximateBoostLevel < 1 {
boostIcon = generateDisclosureActionBoostLevelBadgeImage(text: presentationData.strings.Channel_Info_BoostLevelPlusBadge("1").string) boostIcon = generateDisclosureActionBoostLevelBadgeImage(text: presentationData.strings.Channel_Info_BoostLevelPlusBadge("1").string)
} else {
additionalBadge = presentationData.strings.Settings_New
} }
items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPeerColor, label: .image(colorImage, colorImage.size), additionalBadgeIcon: boostIcon, text: presentationData.strings.Channel_Info_AppearanceItem, icon: UIImage(bundleImageName: "Chat/Info/NameColorIcon"), action: { items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPeerColor, label: .image(colorImage, colorImage.size), additionalBadgeLabel: additionalBadge, additionalBadgeIcon: boostIcon, text: presentationData.strings.Channel_Info_AppearanceItem, icon: UIImage(bundleImageName: "Chat/Info/NameColorIcon"), action: {
interaction.editingOpenNameColorSetup() interaction.editingOpenNameColorSetup()
})) }))
} }

View File

@ -82,7 +82,7 @@ public final class BoostLevelIconComponent: Component {
func update(component: BoostLevelIconComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: Transition) -> CGSize { func update(component: BoostLevelIconComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<Empty>, transition: Transition) -> CGSize {
if self.component != component { if self.component != component {
self.imageView.image = generateDisclosureActionBoostLevelBadgeImage(text: component.strings.Channel_Appearance_BoostLevel("\(component.level)")) self.imageView.image = generateDisclosureActionBoostLevelBadgeImage(text: component.strings.Channel_Appearance_BoostLevel("\(component.level)").string)
} }
self.component = component self.component = component

View File

@ -54,7 +54,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
public var storiesJpegExperiment: Bool public var storiesJpegExperiment: Bool
public var crashOnMemoryPressure: Bool public var crashOnMemoryPressure: Bool
public var unidirectionalSwipeToReply: Bool public var unidirectionalSwipeToReply: Bool
public var dustEffect: Bool public var callV2: Bool
public var alternativeStoryMedia: Bool public var alternativeStoryMedia: Bool
public var allowWebViewInspection: Bool public var allowWebViewInspection: Bool
@ -89,7 +89,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
storiesJpegExperiment: false, storiesJpegExperiment: false,
crashOnMemoryPressure: false, crashOnMemoryPressure: false,
unidirectionalSwipeToReply: false, unidirectionalSwipeToReply: false,
dustEffect: false, callV2: false,
alternativeStoryMedia: false, alternativeStoryMedia: false,
allowWebViewInspection: false allowWebViewInspection: false
) )
@ -125,7 +125,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
storiesJpegExperiment: Bool, storiesJpegExperiment: Bool,
crashOnMemoryPressure: Bool, crashOnMemoryPressure: Bool,
unidirectionalSwipeToReply: Bool, unidirectionalSwipeToReply: Bool,
dustEffect: Bool, callV2: Bool,
alternativeStoryMedia: Bool, alternativeStoryMedia: Bool,
allowWebViewInspection: Bool allowWebViewInspection: Bool
) { ) {
@ -158,7 +158,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.storiesJpegExperiment = storiesJpegExperiment self.storiesJpegExperiment = storiesJpegExperiment
self.crashOnMemoryPressure = crashOnMemoryPressure self.crashOnMemoryPressure = crashOnMemoryPressure
self.unidirectionalSwipeToReply = unidirectionalSwipeToReply self.unidirectionalSwipeToReply = unidirectionalSwipeToReply
self.dustEffect = dustEffect self.callV2 = callV2
self.alternativeStoryMedia = alternativeStoryMedia self.alternativeStoryMedia = alternativeStoryMedia
self.allowWebViewInspection = allowWebViewInspection self.allowWebViewInspection = allowWebViewInspection
} }
@ -195,7 +195,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.storiesJpegExperiment = try container.decodeIfPresent(Bool.self, forKey: "storiesJpegExperiment") ?? false self.storiesJpegExperiment = try container.decodeIfPresent(Bool.self, forKey: "storiesJpegExperiment") ?? false
self.crashOnMemoryPressure = try container.decodeIfPresent(Bool.self, forKey: "crashOnMemoryPressure") ?? false self.crashOnMemoryPressure = try container.decodeIfPresent(Bool.self, forKey: "crashOnMemoryPressure") ?? false
self.unidirectionalSwipeToReply = try container.decodeIfPresent(Bool.self, forKey: "unidirectionalSwipeToReply") ?? false self.unidirectionalSwipeToReply = try container.decodeIfPresent(Bool.self, forKey: "unidirectionalSwipeToReply") ?? false
self.dustEffect = try container.decodeIfPresent(Bool.self, forKey: "dustEffect_2") ?? false self.callV2 = try container.decodeIfPresent(Bool.self, forKey: "callV2") ?? false
self.alternativeStoryMedia = try container.decodeIfPresent(Bool.self, forKey: "alternativeStoryMedia") ?? false self.alternativeStoryMedia = try container.decodeIfPresent(Bool.self, forKey: "alternativeStoryMedia") ?? false
self.allowWebViewInspection = try container.decodeIfPresent(Bool.self, forKey: "allowWebViewInspection") ?? false self.allowWebViewInspection = try container.decodeIfPresent(Bool.self, forKey: "allowWebViewInspection") ?? false
} }
@ -232,7 +232,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
try container.encode(self.storiesJpegExperiment, forKey: "storiesJpegExperiment") try container.encode(self.storiesJpegExperiment, forKey: "storiesJpegExperiment")
try container.encode(self.crashOnMemoryPressure, forKey: "crashOnMemoryPressure") try container.encode(self.crashOnMemoryPressure, forKey: "crashOnMemoryPressure")
try container.encode(self.unidirectionalSwipeToReply, forKey: "unidirectionalSwipeToReply") try container.encode(self.unidirectionalSwipeToReply, forKey: "unidirectionalSwipeToReply")
try container.encode(self.dustEffect, forKey: "dustEffect_2") try container.encode(self.callV2, forKey: "callV2")
try container.encode(self.alternativeStoryMedia, forKey: "alternativeStoryMedia") try container.encode(self.alternativeStoryMedia, forKey: "alternativeStoryMedia")
try container.encode(self.allowWebViewInspection, forKey: "allowWebViewInspection") try container.encode(self.allowWebViewInspection, forKey: "allowWebViewInspection")
} }