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 skipReadHistory(PresentationTheme, Bool)
case unidirectionalSwipeToReply(Bool)
case dustEffect(Bool)
case callV2(Bool)
case alternativeStoryMedia(Bool)
case crashOnSlowQueries(PresentationTheme, Bool)
case crashOnMemoryPressure(PresentationTheme, Bool)
@ -125,7 +125,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return DebugControllerSection.logging.rawValue
case .webViewInspection, .resetWebViewCache:
return DebugControllerSection.web.rawValue
case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .dustEffect, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure:
case .keepChatNavigationStack, .skipReadHistory, .unidirectionalSwipeToReply, .callV2, .alternativeStoryMedia, .crashOnSlowQueries, .crashOnMemoryPressure:
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:
return DebugControllerSection.experiments.rawValue
@ -178,7 +178,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return 16
case .unidirectionalSwipeToReply:
return 17
case .dustEffect:
case .callV2:
return 18
case .alternativeStoryMedia:
return 19
@ -951,11 +951,11 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return settings
}).start()
})
case let .dustEffect(value):
return ItemListSwitchItem(presentationData: presentationData, title: "Dust Effect", value: value, sectionId: self.section, style: .blocks, updated: { value in
case let .callV2(value):
return ItemListSwitchItem(presentationData: presentationData, title: "CallV2", value: value, sectionId: self.section, style: .blocks, updated: { value in
let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in
var settings = settings
settings.dustEffect = value
settings.callV2 = value
return settings
}).start()
})
@ -1426,7 +1426,7 @@ private func debugControllerEntries(sharedContext: SharedAccountContext, present
entries.append(.skipReadHistory(presentationData.theme, experimentalSettings.skipReadHistory))
#endif
entries.append(.unidirectionalSwipeToReply(experimentalSettings.unidirectionalSwipeToReply))
entries.append(.dustEffect(experimentalSettings.dustEffect))
entries.append(.callV2(experimentalSettings.callV2))
entries.append(.alternativeStoryMedia(experimentalSettings.alternativeStoryMedia))
}
entries.append(.crashOnSlowQueries(presentationData.theme, experimentalSettings.crashOnLongQueries))

View File

@ -148,7 +148,12 @@ public final class CallController: ViewController {
}
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"] {
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.isContentsReady.set(.single(true))
} else {

View File

@ -1673,10 +1673,13 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL
let colorImage = generateSettingsMenuPeerColorsLabelIcon(colors: colors)
var boostIcon: UIImage?
var additionalBadge: String?
if let approximateBoostLevel = channel.approximateBoostLevel, approximateBoostLevel < 1 {
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()
}))
}

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 {
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

View File

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