diff --git a/Telegram-iOS/en.lproj/Localizable.strings b/Telegram-iOS/en.lproj/Localizable.strings index c49579f785..3e1f69ac74 100644 --- a/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram-iOS/en.lproj/Localizable.strings @@ -3063,7 +3063,6 @@ Unused sets are archived when you add more."; "Settings.Appearance" = "Appearance"; "Appearance.Title" = "Appearance"; -"Appearance.TextSize" = "TEXT SIZE"; "Appearance.Preview" = "CHAT PREVIEW"; "Appearance.ColorTheme" = "COLOR THEME"; "Appearance.ThemeDayClassic" = "Day Classic"; @@ -5115,3 +5114,9 @@ Any member of this group will be able to see messages in the channel."; "Theme.Colors.ColorWallpaperWarning" = "Are you sure you want to change your chat wallpaper to a color?"; "Theme.Colors.ColorWallpaperWarningProceed" = "Proceed"; + +"Appearance.TextSizeSetting" = "Text Size"; +"Appearance.TextSize.Automatic" = "System"; +"Appearance.TextSize.Title" = "Text Size"; +"Appearance.TextSize.UseSystem" = "User System Text Size"; +"Appearance.TextSize.Apply" = "Set"; diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift index 0b5a64ac53..6b2a1e06fc 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift @@ -162,7 +162,7 @@ enum BotCheckoutEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! BotCheckoutControllerArguments switch self { case let .header(theme, invoice, botName): @@ -170,27 +170,27 @@ enum BotCheckoutEntry: ItemListNodeEntry { case let .price(_, theme, text, value, isFinal): return BotCheckoutPriceItem(theme: theme, title: text, label: value, isFinal: isFinal, sectionId: self.section) case let .paymentMethod(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openPaymentMethod() }) case let .shippingInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openInfo(.address(.street1)) }) case let .shippingMethod(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openShippingMethod() }) case let .nameInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openInfo(.name) }) case let .emailInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openInfo(.email) }) case let .phoneInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openInfo(.phone) }) } @@ -418,12 +418,12 @@ final class BotCheckoutControllerNode: ItemListControllerNode, PKPaymentAuthoriz openShippingMethodImpl?() }) - let signal: Signal<(PresentationTheme, (ItemListNodeState, Any)), NoError> = combineLatest(context.sharedContext.presentationData, self.state.get(), paymentFormAndInfo.get(), context.account.postbox.loadedPeerWithId(messageId.peerId)) - |> map { presentationData, state, paymentFormAndInfo, botPeer -> (PresentationTheme, (ItemListNodeState, Any)) in - let nodeState = ItemListNodeState(entries: botCheckoutControllerEntries(presentationData: presentationData, state: state, invoice: invoice, paymentForm: paymentFormAndInfo?.0, formInfo: paymentFormAndInfo?.1, validatedFormInfo: paymentFormAndInfo?.2, currentShippingOptionId: paymentFormAndInfo?.3, currentPaymentMethod: paymentFormAndInfo?.4, botPeer: botPeer), style: .plain, focusItemTag: nil, emptyStateItem: nil, animateChanges: false) - - return (presentationData.theme, (nodeState, arguments)) - } + let signal: Signal<(ItemListPresentationData, (ItemListNodeState, Any)), NoError> = combineLatest(context.sharedContext.presentationData, self.state.get(), paymentFormAndInfo.get(), context.account.postbox.loadedPeerWithId(messageId.peerId)) + |> map { presentationData, state, paymentFormAndInfo, botPeer -> (ItemListPresentationData, (ItemListNodeState, Any)) in + let nodeState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: botCheckoutControllerEntries(presentationData: presentationData, state: state, invoice: invoice, paymentForm: paymentFormAndInfo?.0, formInfo: paymentFormAndInfo?.1, validatedFormInfo: paymentFormAndInfo?.2, currentShippingOptionId: paymentFormAndInfo?.3, currentPaymentMethod: paymentFormAndInfo?.4, botPeer: botPeer), style: .plain, focusItemTag: nil, emptyStateItem: nil, animateChanges: false) + + return (ItemListPresentationData(presentationData), (nodeState, arguments)) + } self.actionButton = BotCheckoutActionButton(inactiveFillColor: self.presentationData.theme.list.plainBackgroundColor, activeFillColor: self.presentationData.theme.list.itemAccentColor, foregroundColor: self.presentationData.theme.list.itemCheckColors.foregroundColor) self.actionButton.setState(.loading) diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift index c3096d8260..3b09d3f131 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift @@ -303,7 +303,7 @@ private final class BotCheckoutPasswordAlertContentNode: AlertContentNode { func botCheckoutPasswordEntryController(context: AccountContext, strings: PresentationStrings, cartTitle: String, period: Int32, requiresBiometrics: Bool, completion: @escaping (TemporaryTwoStepPasswordToken) -> Void) -> AlertController { var dismissImpl: (() -> Void)? let presentationData = context.sharedContext.currentPresentationData.with { $0 } - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), contentNode: BotCheckoutPasswordAlertContentNode(context: context, theme: presentationData.theme, strings: strings, cardTitle: cartTitle, period: period, requiresBiometrics: requiresBiometrics, cancel: { + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: BotCheckoutPasswordAlertContentNode(context: context, theme: presentationData.theme, strings: strings, cardTitle: cartTitle, period: period, requiresBiometrics: requiresBiometrics, cancel: { dismissImpl?() }, completion: { token in completion(token) diff --git a/submodules/BotPaymentsUI/Sources/BotReceiptControllerNode.swift b/submodules/BotPaymentsUI/Sources/BotReceiptControllerNode.swift index bc4a52031f..1672e2097c 100644 --- a/submodules/BotPaymentsUI/Sources/BotReceiptControllerNode.swift +++ b/submodules/BotPaymentsUI/Sources/BotReceiptControllerNode.swift @@ -149,7 +149,7 @@ enum BotReceiptEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! BotReceiptControllerArguments switch self { case let .header(theme, invoice, botName): @@ -157,17 +157,17 @@ enum BotReceiptEntry: ItemListNodeEntry { case let .price(_, theme, text, value, isFinal): return BotCheckoutPriceItem(theme: theme, title: text, label: value, isFinal: isFinal, sectionId: self.section) case let .paymentMethod(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) case let .shippingInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) case let .shippingMethod(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) case let .nameInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) case let .emailInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) case let .phoneInfo(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: nil) } } } @@ -275,11 +275,11 @@ final class BotReceiptControllerNode: ItemListControllerNode { let arguments = BotReceiptControllerArguments(account: context.account) - let signal: Signal<(PresentationTheme, (ItemListNodeState, Any)), NoError> = combineLatest(context.sharedContext.presentationData, receiptData.get(), context.account.postbox.loadedPeerWithId(messageId.peerId)) - |> map { presentationData, receiptData, botPeer -> (PresentationTheme, (ItemListNodeState, Any)) in - let nodeState = ItemListNodeState(entries: botReceiptControllerEntries(presentationData: presentationData, invoice: invoice, formInvoice: receiptData?.0, formInfo: receiptData?.1, shippingOption: receiptData?.2, paymentMethodTitle: receiptData?.3, botPeer: botPeer), style: .plain, focusItemTag: nil, emptyStateItem: nil, animateChanges: false) - - return (presentationData.theme, (nodeState, arguments)) + let signal: Signal<(ItemListPresentationData, (ItemListNodeState, Any)), NoError> = combineLatest(context.sharedContext.presentationData, receiptData.get(), context.account.postbox.loadedPeerWithId(messageId.peerId)) + |> map { presentationData, receiptData, botPeer -> (ItemListPresentationData, (ItemListNodeState, Any)) in + let nodeState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: botReceiptControllerEntries(presentationData: presentationData, invoice: invoice, formInvoice: receiptData?.0, formInfo: receiptData?.1, shippingOption: receiptData?.2, paymentMethodTitle: receiptData?.3, botPeer: botPeer), style: .plain, focusItemTag: nil, emptyStateItem: nil, animateChanges: false) + + return (ItemListPresentationData(presentationData), (nodeState, arguments)) } self.actionButton = BotCheckoutActionButton(inactiveFillColor: self.presentationData.theme.list.plainBackgroundColor, activeFillColor: self.presentationData.theme.list.itemAccentColor, foregroundColor: self.presentationData.theme.list.plainBackgroundColor) diff --git a/submodules/CallListUI/Sources/CallListCallItem.swift b/submodules/CallListUI/Sources/CallListCallItem.swift index 0df9fc8f7a..b0adfc1dd9 100644 --- a/submodules/CallListUI/Sources/CallListCallItem.swift +++ b/submodules/CallListUI/Sources/CallListCallItem.swift @@ -12,10 +12,6 @@ import PresentationDataUtils import AvatarNode import TelegramStringFormatting -private let titleFont = Font.regular(17.0) -private let statusFont = Font.regular(14.0) -private let dateFont = Font.regular(15.0) - private func callDurationString(strings: PresentationStrings, duration: Int32) -> String { if duration < 60 { return strings.Call_ShortSeconds(duration) @@ -67,8 +63,7 @@ private func callListNeighbors(item: ListViewItem, topItem: ListViewItem?, botto } class CallListCallItem: ListViewItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let dateTimeFormat: PresentationDateTimeFormat let account: Account let style: ItemListStyle @@ -82,9 +77,8 @@ class CallListCallItem: ListViewItem { let headerAccessoryItem: ListViewAccessoryItem? let header: ListViewItemHeader? - init(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, account: Account, style: ItemListStyle, topMessage: Message, messages: [Message], editing: Bool, revealed: Bool, interaction: CallListNodeInteraction) { - self.theme = theme - self.strings = strings + init(presentationData: ItemListPresentationData, dateTimeFormat: PresentationDateTimeFormat, account: Account, style: ItemListStyle, topMessage: Message, messages: [Message], editing: Bool, revealed: Bool, interaction: CallListNodeInteraction) { + self.presentationData = presentationData self.dateTimeFormat = dateTimeFormat self.account = account self.style = style @@ -301,18 +295,22 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { var updatedTheme: PresentationTheme? var updatedInfoIcon = false - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme updatedInfoIcon = true } + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + let statusFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + let dateFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + let editingOffset: CGFloat - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? if item.editing { - let sizeAndApply = editableControlLayout(50.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.presentationData.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 } else { editingOffset = 0.0 } @@ -328,12 +326,12 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { switch item.style { case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor insets = itemListNeighborsPlainInsets(neighbors) case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor insets = itemListNeighborsGroupedInsets(neighbors) } @@ -347,7 +345,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { var titleAttributedString: NSAttributedString? var statusAttributedString: NSAttributedString? - var titleColor = item.theme.list.itemPrimaryTextColor + var titleColor = item.presentationData.theme.list.itemPrimaryTextColor var hasMissed = false var hasIncoming = false var hasOutgoing = false @@ -363,7 +361,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { hasIncoming = true if let discardReason = discardReason, case .missed = discardReason { - titleColor = item.theme.list.itemDestructiveColor + titleColor = item.presentationData.theme.list.itemDestructiveColor hasMissed = true } } else { @@ -397,7 +395,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { } else if let lastName = user.lastName, !lastName.isEmpty { titleAttributedString = NSAttributedString(string: lastName, font: titleFont, textColor: titleColor) } else { - titleAttributedString = NSAttributedString(string: item.strings.User_DeletedAccount, font: titleFont, textColor: titleColor) + titleAttributedString = NSAttributedString(string: item.presentationData.strings.User_DeletedAccount, font: titleFont, textColor: titleColor) } } else if let group = peer as? TelegramGroup { titleAttributedString = NSAttributedString(string: group.title, font: titleFont, textColor: titleColor) @@ -406,20 +404,20 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { } if hasMissed { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallMissedShort, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallMissedShort, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } else if hasIncoming && hasOutgoing { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallOutgoingShort + ", " + item.strings.Notification_CallIncomingShort, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallOutgoingShort + ", " + item.presentationData.strings.Notification_CallIncomingShort, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } else if hasIncoming { if let callDuration = callDuration, callDuration != 0 { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallTimeFormat(item.strings.Notification_CallIncomingShort, callDurationString(strings: item.strings, duration: callDuration)).0, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallTimeFormat(item.presentationData.strings.Notification_CallIncomingShort, callDurationString(strings: item.presentationData.strings, duration: callDuration)).0, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } else { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallIncomingShort, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallIncomingShort, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } } else { if let callDuration = callDuration, callDuration != 0 { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallTimeFormat(item.strings.Notification_CallOutgoingShort, callDurationString(strings: item.strings, duration: callDuration)).0, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallTimeFormat(item.presentationData.strings.Notification_CallOutgoingShort, callDurationString(strings: item.presentationData.strings, duration: callDuration)).0, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } else { - statusAttributedString = NSAttributedString(string: item.strings.Notification_CallOutgoingShort, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + statusAttributedString = NSAttributedString(string: item.presentationData.strings.Notification_CallOutgoingShort, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } } } @@ -429,18 +427,21 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { localtime_r(&t, &timeinfo) let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) - let dateText = stringForRelativeTimestamp(strings: item.strings, relativeTimestamp: item.topMessage.timestamp, relativeTo: timestamp, dateTimeFormat: item.dateTimeFormat) + let dateText = stringForRelativeTimestamp(strings: item.presentationData.strings, relativeTimestamp: item.topMessage.timestamp, relativeTo: timestamp, dateTimeFormat: item.dateTimeFormat) - let (dateLayout, dateApply) = makeDateLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: dateText, font: dateFont, textColor: item.theme.list.itemSecondaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - rightInset), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (dateLayout, dateApply) = makeDateLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: dateText, font: dateFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - rightInset), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - dateRightInset - dateLayout.size.width - (item.editing ? -30.0 : 10.0)), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - rightInset), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let nodeLayout = ListViewItemNodeLayout(contentSize: CGSize(width: params.width, height: 50.0), insets: UIEdgeInsets(top: firstWithHeader ? 29.0 : 0.0, left: 0.0, bottom: 0.0, right: 0.0)) + let titleSpacing: CGFloat = -1.0 + let verticalInset: CGFloat = 6.0 - let outgoingIcon = PresentationResourcesCallList.outgoingIcon(item.theme) - let infoIcon = PresentationResourcesCallList.infoButton(item.theme) + let nodeLayout = ListViewItemNodeLayout(contentSize: CGSize(width: params.width, height: titleLayout.size.height + titleSpacing + statusLayout.size.height + verticalInset * 2.0), insets: UIEdgeInsets(top: firstWithHeader ? 29.0 : 0.0, left: 0.0, bottom: 0.0, right: 0.0)) + + let outgoingIcon = PresentationResourcesCallList.outgoingIcon(item.presentationData.theme) + let infoIcon = PresentationResourcesCallList.infoButton(item.presentationData.theme) let contentSize = nodeLayout.contentSize @@ -451,7 +452,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { if peer.isDeleted { overrideImage = .deletedIcon } - strongSelf.avatarNode.setPeer(account: item.account, theme: item.theme, peer: peer, overrideImage: overrideImage, emptyColor: item.theme.list.mediaPlaceholderColor) + strongSelf.avatarNode.setPeer(account: item.account, theme: item.presentationData.theme, peer: peer, overrideImage: overrideImage, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor) } return (strongSelf.avatarNode.ready, { [weak strongSelf] animated in @@ -471,7 +472,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { strongSelf.topStripeNode.backgroundColor = itemSeparatorColor strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } switch item.style { @@ -519,9 +520,9 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: nodeLayout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(nodeLayout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -547,13 +548,13 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { }) } - transition.updateFrameAdditive(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 52.0, y: 5.0), size: CGSize(width: 40.0, height: 40.0))) + transition.updateFrameAdditive(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 52.0, y: floor((contentSize.height - 40.0) / 2.0)), size: CGSize(width: 40.0, height: 40.0))) let _ = titleApply() - transition.updateFrameAdditive(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: 6.0), size: titleLayout.size)) + transition.updateFrameAdditive(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: verticalInset), size: titleLayout.size)) let _ = statusApply() - transition.updateFrameAdditive(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: 27.0), size: statusLayout.size)) + transition.updateFrameAdditive(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: strongSelf.titleNode.frame.maxY + titleSpacing), size: statusLayout.size)) let _ = dateApply() transition.updateFrameAdditive(node: strongSelf.dateNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + params.width - dateRightInset - dateLayout.size.width, y: floor((nodeLayout.contentSize.height - dateLayout.size.height) / 2.0) + 2.0), size: dateLayout.size)) @@ -585,11 +586,11 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { strongSelf.accessibilityArea.accessibilityValue = statusAttributedString?.string strongSelf.accessibilityArea.frame = CGRect(origin: CGPoint(), size: nodeLayout.contentSize) - strongSelf.infoButtonNode.accessibilityLabel = item.strings.Conversation_Info + strongSelf.infoButtonNode.accessibilityLabel = item.presentationData.strings.Conversation_Info - strongSelf.view.accessibilityCustomActions = [UIAccessibilityCustomAction(name: item.strings.Common_Delete, target: strongSelf, selector: #selector(strongSelf.performLocalAccessibilityCustomAction(_:)))] + strongSelf.view.accessibilityCustomActions = [UIAccessibilityCustomAction(name: item.presentationData.strings.Common_Delete, target: strongSelf, selector: #selector(strongSelf.performLocalAccessibilityCustomAction(_:)))] - strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.strings.Common_Delete, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)])) + strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)])) strongSelf.setRevealOptionsOpened(item.revealed, animated: animated) } }) @@ -667,9 +668,9 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode { transition.updateFrameAdditive(node: self.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 52.0, y: 5.0), size: CGSize(width: 40.0, height: 40.0))) - transition.updateFrameAdditive(node: self.titleNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: 6.0), size: self.titleNode.bounds.size)) + transition.updateFrameAdditive(node: self.titleNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: self.titleNode.frame.minY), size: self.titleNode.bounds.size)) - transition.updateFrameAdditive(node: self.statusNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: 27.0), size: self.statusNode.bounds.size)) + transition.updateFrameAdditive(node: self.statusNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset, y: self.statusNode.frame.minY), size: self.statusNode.bounds.size)) transition.updateFrameAdditive(node: self.dateNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + self.bounds.size.width - dateRightInset - self.dateNode.bounds.size.width, y: self.dateNode.frame.minY), size: self.dateNode.bounds.size)) diff --git a/submodules/CallListUI/Sources/CallListControllerNode.swift b/submodules/CallListUI/Sources/CallListControllerNode.swift index 90f865e94f..90f5b4b472 100644 --- a/submodules/CallListUI/Sources/CallListControllerNode.swift +++ b/submodules/CallListUI/Sources/CallListControllerNode.swift @@ -113,42 +113,42 @@ struct CallListNodeState: Equatable { } } -private func mappedInsertEntries(account: Account, showSettings: Bool, nodeInteraction: CallListNodeInteraction, entries: [CallListNodeViewTransitionInsertEntry]) -> [ListViewInsertItem] { +private func mappedInsertEntries(account: Account, presentationData: ItemListPresentationData, showSettings: Bool, nodeInteraction: CallListNodeInteraction, entries: [CallListNodeViewTransitionInsertEntry]) -> [ListViewInsertItem] { return entries.map { entry -> ListViewInsertItem in switch entry.entry { case let .displayTab(theme, text, value): - return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListSwitchItem(theme: theme, title: text, value: value, enabled: true, sectionId: 0, style: .blocks, updated: { value in + return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: 0, style: .blocks, updated: { value in nodeInteraction.updateShowCallsTab(value) }), directionHint: entry.directionHint) case let .displayTabInfo(theme, text): - return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(theme: theme, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) + return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) case let .messageEntry(topMessage, messages, theme, strings, dateTimeFormat, editing, hasActiveRevealControls): - return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, account: account, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, interaction: nodeInteraction), directionHint: entry.directionHint) + return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, account: account, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, interaction: nodeInteraction), directionHint: entry.directionHint) case let .holeEntry(_, theme): return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListHoleItem(theme: theme), directionHint: entry.directionHint) } } } -private func mappedUpdateEntries(account: Account, showSettings: Bool, nodeInteraction: CallListNodeInteraction, entries: [CallListNodeViewTransitionUpdateEntry]) -> [ListViewUpdateItem] { +private func mappedUpdateEntries(account: Account, presentationData: ItemListPresentationData, showSettings: Bool, nodeInteraction: CallListNodeInteraction, entries: [CallListNodeViewTransitionUpdateEntry]) -> [ListViewUpdateItem] { return entries.map { entry -> ListViewUpdateItem in switch entry.entry { case let .displayTab(theme, text, value): - return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListSwitchItem(theme: theme, title: text, value: value, enabled: true, sectionId: 0, style: .blocks, updated: { value in + return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: 0, style: .blocks, updated: { value in nodeInteraction.updateShowCallsTab(value) }), directionHint: entry.directionHint) case let .displayTabInfo(theme, text): - return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(theme: theme, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) + return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) case let .messageEntry(topMessage, messages, theme, strings, dateTimeFormat, editing, hasActiveRevealControls): - return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, account: account, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, interaction: nodeInteraction), directionHint: entry.directionHint) + return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListCallItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, account: account, style: showSettings ? .blocks : .plain, topMessage: topMessage, messages: messages, editing: editing, revealed: hasActiveRevealControls, interaction: nodeInteraction), directionHint: entry.directionHint) case let .holeEntry(_, theme): return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: CallListHoleItem(theme: theme), directionHint: entry.directionHint) } } } -private func mappedCallListNodeViewListTransition(account: Account, showSettings: Bool, nodeInteraction: CallListNodeInteraction, transition: CallListNodeViewTransition) -> CallListNodeListViewTransition { - return CallListNodeListViewTransition(callListView: transition.callListView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(account: account, showSettings: showSettings, nodeInteraction: nodeInteraction, entries: transition.insertEntries), updateItems: mappedUpdateEntries(account: account, showSettings: showSettings, nodeInteraction: nodeInteraction, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange) +private func mappedCallListNodeViewListTransition(account: Account, presentationData: ItemListPresentationData, showSettings: Bool, nodeInteraction: CallListNodeInteraction, transition: CallListNodeViewTransition) -> CallListNodeListViewTransition { + return CallListNodeListViewTransition(callListView: transition.callListView, deleteItems: transition.deleteItems, insertItems: mappedInsertEntries(account: account, presentationData: presentationData, showSettings: showSettings, nodeInteraction: nodeInteraction, entries: transition.insertEntries), updateItems: mappedUpdateEntries(account: account, presentationData: presentationData, showSettings: showSettings, nodeInteraction: nodeInteraction, entries: transition.updateEntries), options: transition.options, scrollToItem: transition.scrollToItem, stationaryItemRange: transition.stationaryItemRange) } private final class CallListOpaqueTransactionState { @@ -343,7 +343,7 @@ final class CallListControllerNode: ASDisplayNode { } return preparedCallListNodeViewTransition(from: previous, to: processedView, reason: reason, disableAnimations: false, account: context.account, scrollPosition: update.scrollPosition) - |> map({ mappedCallListNodeViewListTransition(account: context.account, showSettings: showSettings, nodeInteraction: nodeInteraction, transition: $0) }) + |> map({ mappedCallListNodeViewListTransition(account: context.account, presentationData: ItemListPresentationData(presentationData), showSettings: showSettings, nodeInteraction: nodeInteraction, transition: $0) }) |> runOn(prepareOnMainQueue ? Queue.mainQueue() : viewProcessingQueue) } diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index b53fb53f8e..5911bb06a7 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -1491,7 +1491,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, ]) strongSelf.present(actionSheet, in: .window(.root)) } else { - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationAction, action: { @@ -1565,7 +1565,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, guard let strongSelf = self else { return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { completion(false) }), @@ -1596,7 +1596,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, ]) self.present(actionSheet, in: .window(.root)) } else if peer.peerId == self.context.account.peerId { - self.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.presentationData.theme), title: self.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: self.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ + self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: self.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: self.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: self.presentationData.strings.Common_Cancel, action: { completion(false) }), diff --git a/submodules/ChatListUI/Sources/ChatListControllerNode.swift b/submodules/ChatListUI/Sources/ChatListControllerNode.swift index 24211ad5c8..a6002e60bd 100644 --- a/submodules/ChatListUI/Sources/ChatListControllerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListControllerNode.swift @@ -77,7 +77,7 @@ final class ChatListControllerNode: ASDisplayNode { self.groupId = groupId self.presentationData = presentationData - self.chatListNode = ChatListNode(context: context, groupId: groupId, controlsHistoryPreload: controlsHistoryPreload, mode: .chatList, theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations) + self.chatListNode = ChatListNode(context: context, groupId: groupId, controlsHistoryPreload: controlsHistoryPreload, mode: .chatList, theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations) self.controller = controller @@ -151,7 +151,7 @@ final class ChatListControllerNode: ASDisplayNode { self.backgroundColor = self.presentationData.theme.chatList.backgroundColor - self.chatListNode.updateThemeAndStrings(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) + self.chatListNode.updateThemeAndStrings(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) self.searchDisplayController?.updatePresentationData(presentationData) self.chatListEmptyNode?.updateThemeAndStrings(theme: self.presentationData.theme, strings: self.presentationData.strings) diff --git a/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift b/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift index 0208ceef80..8e27060fec 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchContainerNode.swift @@ -16,6 +16,7 @@ import ChatListSearchItemHeader import ContactListUI import ContextUI import PhoneNumberFormat +import ItemListUI private enum ChatListRecentEntryStableId: Hashable { case topPeers @@ -80,7 +81,7 @@ private enum ChatListRecentEntry: Comparable, Identifiable { } } - func item(context: AccountContext, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ListViewItem { + func item(context: AccountContext, presentationData: ChatListPresentationData, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ListViewItem { switch self { case let .topPeers(peers, theme, strings): return ChatListRecentPeersListItem(theme: theme, strings: strings, account: context.account, peers: peers, peerSelected: { peer in @@ -174,7 +175,7 @@ private enum ChatListRecentEntry: Comparable, Identifiable { badge = ContactsPeerItemBadge(count: peer.unreadCount, type: isMuted ? .inactive : .active) } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: status, badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: true, editing: false, revealed: hasRevealControls), index: nil, header: ChatListSearchItemHeader(type: .recentPeers, theme: theme, strings: strings, actionTitle: strings.WebSearch_RecentSectionClear, action: { + return ContactsPeerItem(presentationData: ItemListPresentationData(theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: status, badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: true, editing: false, revealed: hasRevealControls), index: nil, header: ChatListSearchItemHeader(type: .recentPeers, theme: theme, strings: strings, actionTitle: strings.WebSearch_RecentSectionClear, action: { clearRecentlySearchedPeers() }), action: { _ in if let chatPeer = peer.peer.peers[peer.peer.peerId] { @@ -329,7 +330,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable { } } - public func item(context: AccountContext, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?) -> ListViewItem { + public func item(context: AccountContext, presentationData: PresentationData, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?) -> ListViewItem { switch self { case let .localPeer(peer, associatedPeer, unreadBadge, _, theme, strings, nameSortOrder, nameDisplayOrder): let primaryPeer: Peer @@ -383,7 +384,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable { header = ChatListSearchItemHeader(type: .localPeers, theme: theme, strings: strings, actionTitle: nil, action: nil) } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: .none, badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: primaryPeer, chatPeer: chatPeer), status: .none, badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in interaction.peerSelected(peer) }, contextAction: peerContextAction.flatMap { peerContextAction in return { node, gesture in @@ -435,7 +436,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable { header = ChatListSearchItemHeader(type: .globalPeers, theme: theme, strings: strings, actionTitle: nil, action: nil) } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: peer.peer, chatPeer: peer.peer), status: .addressName(suffixString), badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: peer.peer, chatPeer: peer.peer), status: .addressName(suffixString), badge: badge, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in interaction.peerSelected(peer.peer) }, contextAction: peerContextAction.flatMap { peerContextAction in return { node, gesture in @@ -472,22 +473,22 @@ public struct ChatListSearchContainerTransition { } } -private func chatListSearchContainerPreparedRecentTransition(from fromEntries: [ChatListRecentEntry], to toEntries: [ChatListRecentEntry], context: AccountContext, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ChatListSearchContainerRecentTransition { +private func chatListSearchContainerPreparedRecentTransition(from fromEntries: [ChatListRecentEntry], to toEntries: [ChatListRecentEntry], context: AccountContext, presentationData: ChatListPresentationData, filter: ChatListNodePeersFilter, peerSelected: @escaping (Peer) -> Void, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?, clearRecentlySearchedPeers: @escaping () -> Void, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, deletePeer: @escaping (PeerId) -> Void) -> ChatListSearchContainerRecentTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, filter: filter, peerSelected: peerSelected, peerContextAction: peerContextAction, clearRecentlySearchedPeers: clearRecentlySearchedPeers, setPeerIdWithRevealedOptions: setPeerIdWithRevealedOptions, deletePeer: deletePeer), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, filter: filter, peerSelected: peerSelected, peerContextAction: peerContextAction, clearRecentlySearchedPeers: clearRecentlySearchedPeers, setPeerIdWithRevealedOptions: setPeerIdWithRevealedOptions, deletePeer: deletePeer), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, presentationData: presentationData, filter: filter, peerSelected: peerSelected, peerContextAction: peerContextAction, clearRecentlySearchedPeers: clearRecentlySearchedPeers, setPeerIdWithRevealedOptions: setPeerIdWithRevealedOptions, deletePeer: deletePeer), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, presentationData: presentationData, filter: filter, peerSelected: peerSelected, peerContextAction: peerContextAction, clearRecentlySearchedPeers: clearRecentlySearchedPeers, setPeerIdWithRevealedOptions: setPeerIdWithRevealedOptions, deletePeer: deletePeer), directionHint: nil) } return ChatListSearchContainerRecentTransition(deletions: deletions, insertions: insertions, updates: updates) } -public func chatListSearchContainerPreparedTransition(from fromEntries: [ChatListSearchEntry], to toEntries: [ChatListSearchEntry], displayingResults: Bool, context: AccountContext, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?) -> ChatListSearchContainerTransition { +public func chatListSearchContainerPreparedTransition(from fromEntries: [ChatListSearchEntry], to toEntries: [ChatListSearchEntry], displayingResults: Bool, context: AccountContext, presentationData: PresentationData, enableHeaders: Bool, filter: ChatListNodePeersFilter, interaction: ChatListNodeInteraction, peerContextAction: ((Peer, ChatListSearchContextActionSource, ASDisplayNode, ContextGesture?) -> Void)?) -> ChatListSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, enableHeaders: enableHeaders, filter: filter, interaction: interaction, peerContextAction: peerContextAction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, enableHeaders: enableHeaders, filter: filter, interaction: interaction, peerContextAction: peerContextAction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, presentationData: presentationData, enableHeaders: enableHeaders, filter: filter, interaction: interaction, peerContextAction: peerContextAction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(context: context, presentationData: presentationData, enableHeaders: enableHeaders, filter: filter, interaction: interaction, peerContextAction: peerContextAction), directionHint: nil) } return ChatListSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, displayingResults: displayingResults) } @@ -585,7 +586,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo self.dimNode = ASDisplayNode() self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.presentationDataPromise = Promise(ChatListPresentationData(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations)) + self.presentationDataPromise = Promise(ChatListPresentationData(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations)) self.recentListNode = ListView() self.recentListNode.verticalScrollIndicatorColor = self.presentationData.theme.list.scrollIndicatorColor @@ -970,13 +971,16 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo self.updatedRecentPeersDisposable.set(managedUpdatedRecentPeers(accountPeerId: context.account.peerId, postbox: context.account.postbox, network: context.account.network).start()) - self.recentDisposable.set((recentItems - |> deliverOnMainQueue).start(next: { [weak self] entries in + self.recentDisposable.set((combineLatest(queue: .mainQueue(), + presentationDataPromise.get(), + recentItems + ) + |> deliverOnMainQueue).start(next: { [weak self] presentationData, entries in if let strongSelf = self { let previousEntries = previousRecentItems.swap(entries) let firstTime = previousEntries == nil - let transition = chatListSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries, context: context, filter: filter, peerSelected: { peer in + let transition = chatListSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries, context: context, presentationData: presentationData, filter: filter, peerSelected: { peer in openPeer(peer, true) let _ = addRecentlySearchedPeer(postbox: context.account.postbox, peerId: peer.id).start() self?.recentListNode.clearHighlightAnimated(true) @@ -1002,7 +1006,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo let previousEntries = previousSearchItems.swap(entriesAndFlags?.0) let firstTime = previousEntries == nil - let transition = chatListSearchContainerPreparedTransition(from: previousEntries ?? [], to: entriesAndFlags?.0 ?? [], displayingResults: entriesAndFlags?.0 != nil, context: context, enableHeaders: true, filter: filter, interaction: interaction, peerContextAction: peerContextAction) + let transition = chatListSearchContainerPreparedTransition(from: previousEntries ?? [], to: entriesAndFlags?.0 ?? [], displayingResults: entriesAndFlags?.0 != nil, context: context, presentationData: strongSelf.presentationData, enableHeaders: true, filter: filter, interaction: interaction, peerContextAction: peerContextAction) strongSelf.enqueueTransition(transition, firstTime: firstTime) } })) @@ -1012,7 +1016,7 @@ public final class ChatListSearchContainerNode: SearchDisplayControllerContentNo if let strongSelf = self { let previousTheme = strongSelf.presentationData.theme strongSelf.presentationData = presentationData - strongSelf.presentationDataPromise.set(.single(ChatListPresentationData(theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations))) + strongSelf.presentationDataPromise.set(.single(ChatListPresentationData(theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations))) if previousTheme !== presentationData.theme { strongSelf.updateTheme(theme: presentationData.theme) diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 731b89e90b..66c24098d5 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -163,11 +163,6 @@ public class ChatListItem: ListViewItem, ChatListSearchItemNeighbour { } } -private let titleFont = Font.medium(16.0) -private let textFont = Font.regular(15.0) -private let dateFont = Font.regular(14.0) -private let badgeFont = Font.regular(14.0) - private let pinIcon = ItemListRevealOptionIcon.animation(animation: "anim_pin", scale: 0.33333, offset: 0.0, keysToColor: nil, flip: false) private let unpinIcon = ItemListRevealOptionIcon.animation(animation: "anim_unpin", scale: 0.33333, offset: 0.0, keysToColor: ["un Outlines.Group 1.Stroke 1"], flip: false) private let muteIcon = ItemListRevealOptionIcon.animation(animation: "anim_mute", scale: 0.33333, offset: 0.0, keysToColor: ["un Outlines.Group 1.Stroke 1"], flip: false) @@ -197,8 +192,6 @@ private enum RevealOptionKey: Int32 { case unhide } -private let itemHeight: CGFloat = 76.0 - private func canArchivePeer(id: PeerId, accountPeerId: PeerId) -> Bool { if id.namespace == Namespaces.Peer.CloudUser && id.id == 777000 { return false @@ -653,6 +646,11 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { let currentChatListSearchResult = self.cachedChatListSearchResult return { item, params, first, last, firstWithHeader, nextIsPinned in + let titleFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 16.0 / 17.0)) + let textFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + let dateFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + let badgeFont = Font.regular(14.0) + let account = item.context.account var message: Message? enum ContentPeer { @@ -749,7 +747,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { var currentSecretIconImage: UIImage? var selectableControlSizeAndApply: (CGFloat, (CGSize, Bool) -> ItemListSelectableControlNode)? - var reorderControlSizeAndApply: (CGSize, (Bool) -> ItemListEditableReorderControlNode)? + var reorderControlSizeAndApply: (CGFloat, (CGFloat, Bool) -> ItemListEditableReorderControlNode)? let editingOffset: CGFloat var reorderInset: CGFloat = 0.0 @@ -761,9 +759,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { editingOffset = sizeAndApply.0 if item.index.pinningIndex != nil && !isAd && !isPeerGroup { - let sizeAndApply = reorderControlLayout(itemHeight, item.presentationData.theme) + let sizeAndApply = reorderControlLayout(item.presentationData.theme) reorderControlSizeAndApply = sizeAndApply - reorderInset = sizeAndApply.0.width + reorderInset = sizeAndApply.0 } } else { editingOffset = 0.0 @@ -1076,13 +1074,14 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { let layoutOffset: CGFloat = 0.0 - let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: params.width - leftInset - params.rightInset - 10.0 - 1.0 - editingOffset, height: itemHeight - 12.0 - 9.0)) + let rawContentOriginX = 2.0 + let rawContentWidth = params.width - leftInset - params.rightInset - 10.0 - let (dateLayout, dateApply) = dateLayout(TextNodeLayoutArguments(attributedString: dateAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentRect.width, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (dateLayout, dateApply) = dateLayout(TextNodeLayoutArguments(attributedString: dateAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentWidth, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (badgeLayout, badgeApply) = badgeLayout(CGSize(width: rawContentRect.width, height: CGFloat.greatestFiniteMagnitude), currentBadgeBackgroundImage, badgeContent) + let (badgeLayout, badgeApply) = badgeLayout(CGSize(width: rawContentWidth, height: CGFloat.greatestFiniteMagnitude), currentBadgeBackgroundImage, badgeContent) - let (mentionBadgeLayout, mentionBadgeApply) = mentionBadgeLayout(CGSize(width: rawContentRect.width, height: CGFloat.greatestFiniteMagnitude), currentMentionBadgeImage, mentionBadgeContent) + let (mentionBadgeLayout, mentionBadgeApply) = mentionBadgeLayout(CGSize(width: rawContentWidth, height: CGFloat.greatestFiniteMagnitude), currentMentionBadgeImage, mentionBadgeContent) var badgeSize: CGFloat = 0.0 if !badgeLayout.width.isZero { @@ -1106,21 +1105,21 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } badgeSize = max(badgeSize, reorderInset) - let (authorLayout, authorApply) = authorLayout(TextNodeLayoutArguments(attributedString: hideAuthor ? nil : authorAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentRect.width - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) + let (authorLayout, authorApply) = authorLayout(TextNodeLayoutArguments(attributedString: hideAuthor ? nil : authorAttributedString, backgroundColor: nil, minimumNumberOfLines: 1, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: rawContentWidth - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) var textCutout: TextNodeCutout? if !textLeftCutout.isZero { textCutout = TextNodeCutout(topLeft: CGSize(width: textLeftCutout, height: 4.0), topRight: nil, bottomRight: nil) } - let (textLayout, textApply) = textLayout(TextNodeLayoutArguments(attributedString: textAttributedString, backgroundColor: nil, maximumNumberOfLines: authorAttributedString == nil ? 2 : 1, truncationType: .end, constrainedSize: CGSize(width: rawContentRect.width - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: textCutout, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) + let (textLayout, textApply) = textLayout(TextNodeLayoutArguments(attributedString: textAttributedString, backgroundColor: nil, minimumNumberOfLines: authorAttributedString == nil ? 2 : 1, maximumNumberOfLines: authorAttributedString == nil ? 2 : 1, truncationType: .end, constrainedSize: CGSize(width: rawContentWidth - badgeSize, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: textCutout, insets: UIEdgeInsets(top: 2.0, left: 1.0, bottom: 2.0, right: 1.0))) - let titleRect = CGRect(origin: rawContentRect.origin, size: CGSize(width: rawContentRect.width - dateLayout.size.width - 10.0 - statusWidth - titleIconsWidth, height: rawContentRect.height)) - let (titleLayout, titleApply) = titleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: titleRect.width, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let titleRectWidth = rawContentWidth - dateLayout.size.width - 10.0 - statusWidth - titleIconsWidth + let (titleLayout, titleApply) = titleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, minimumNumberOfLines: 1, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: titleRectWidth, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) var inputActivitiesSize: CGSize? var inputActivitiesApply: (() -> Void)? if let inputActivities = inputActivities, !inputActivities.isEmpty { - let (size, apply) = inputActivitiesLayout(CGSize(width: rawContentRect.width - badgeSize, height: 40.0), item.presentationData.strings, item.presentationData.theme.chatList.messageTextColor, item.index.messageIndex.id.peerId, inputActivities) + let (size, apply) = inputActivitiesLayout(CGSize(width: rawContentWidth - badgeSize, height: 40.0), item.presentationData.strings, item.presentationData.theme.chatList.messageTextColor, item.index.messageIndex.id.peerId, inputActivities) inputActivitiesSize = size inputActivitiesApply = apply } @@ -1178,6 +1177,18 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { animateContent = true } + let titleSpacing: CGFloat = -1.0 + let authorSpacing: CGFloat = -3.0 + var itemHeight: CGFloat = 8.0 * 2.0 + titleLayout.size.height + titleSpacing + if authorLayout.size.height.isZero { + itemHeight += textLayout.size.height + } else { + itemHeight += authorLayout.size.height + itemHeight += authorSpacing + textLayout.size.height + } + + let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: rawContentWidth, height: itemHeight - 12.0 - 9.0)) + let insets = ChatListItemNode.insets(first: first, last: last, firstWithHeader: firstWithHeader) var heightOffset: CGFloat = 0.0 if item.hiddenOffset { @@ -1282,9 +1293,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { var animateBadges = animateContent if let reorderControlSizeAndApply = reorderControlSizeAndApply { - let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0.width, y: layoutOffset), size: reorderControlSizeAndApply.0) + let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0, y: layoutOffset), size: CGSize(width: reorderControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.reorderControlNode == nil { - let reorderControlNode = reorderControlSizeAndApply.1(false) + let reorderControlNode = reorderControlSizeAndApply.1(layout.contentSize.height, false) strongSelf.reorderControlNode = reorderControlNode strongSelf.addSubnode(reorderControlNode) reorderControlNode.frame = reorderControlFrame @@ -1297,7 +1308,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { transition.updateAlpha(node: strongSelf.pinnedIconNode, alpha: 0.0) transition.updateAlpha(node: strongSelf.statusNode, alpha: 0.0) } else if let reorderControlNode = strongSelf.reorderControlNode { - let _ = reorderControlSizeAndApply.1(false) + let _ = reorderControlSizeAndApply.1(layout.contentSize.height, false) transition.updateFrame(node: reorderControlNode, frame: reorderControlFrame) } } else if let reorderControlNode = strongSelf.reorderControlNode { @@ -1313,7 +1324,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { transition.updateAlpha(node: strongSelf.statusNode, alpha: 1.0) } - let avatarFrame = CGRect(origin: CGPoint(x: leftInset - 78.0 + editingOffset + 10.0 + revealOffset, y: layoutOffset + 7.0), size: CGSize(width: 60.0, height: 60.0)) + let avatarFrame = CGRect(origin: CGPoint(x: leftInset - 78.0 + editingOffset + 10.0 + revealOffset, y: floor((layout.contentSize.height - 60.0) / 2.0)), size: CGSize(width: 60.0, height: 60.0)) transition.updateFrame(node: strongSelf.avatarNode, frame: avatarFrame) let onlineFrame = CGRect(origin: CGPoint(x: avatarFrame.maxX - onlineLayout.width - 2.0, y: avatarFrame.maxY - onlineLayout.height - 2.0), size: onlineLayout) @@ -1611,7 +1622,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { let leftInset: CGFloat = params.leftInset + 78.0 - let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: params.width - leftInset - params.rightInset - 10.0 - 1.0 - editingOffset, height: itemHeight - 12.0 - 9.0)) + let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: params.width - leftInset - params.rightInset - 10.0 - 1.0 - editingOffset, height: self.bounds.size.height - 12.0 - 9.0)) let contentRect = rawContentRect.offsetBy(dx: editingOffset + leftInset + offset, dy: 0.0) @@ -1806,7 +1817,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { if let item = self.item { if case .groupReference = item.content { - self.layer.sublayerTransform = CATransform3DMakeTranslation(0.0, currentValue - itemHeight, 0.0) + self.layer.sublayerTransform = CATransform3DMakeTranslation(0.0, currentValue - self.bounds.size.height, 0.0) } else { var separatorFrame = self.separatorNode.frame separatorFrame.origin.y = currentValue - UIScreenPixel diff --git a/submodules/ChatListUI/Sources/Node/ChatListNode.swift b/submodules/ChatListUI/Sources/Node/ChatListNode.swift index f1bf72fee4..4866dcfba5 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNode.swift @@ -12,6 +12,7 @@ import AccountContext import TelegramNotices import ContactsPeerItem import ContextUI +import ItemListUI public enum ChatListNodeMode { case chatList @@ -202,7 +203,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL } } - return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ContactsPeerItem(theme: presentationData.theme, strings: presentationData.strings, sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: itemPeer, chatPeer: chatPeer), status: .none, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in + return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ContactsPeerItem(presentationData: ItemListPresentationData(theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings), sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: itemPeer, chatPeer: chatPeer), status: .none, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in if let chatPeer = chatPeer { nodeInteraction.peerSelected(chatPeer) } @@ -241,7 +242,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL enabled = false } } - return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ContactsPeerItem(theme: presentationData.theme, strings: presentationData.strings, sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: itemPeer, chatPeer: chatPeer), status: .none, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in + return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ContactsPeerItem(presentationData: ItemListPresentationData(theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings), sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, account: context.account, peerMode: .generalSearch, peer: .peer(peer: itemPeer, chatPeer: chatPeer), status: .none, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in if let chatPeer = chatPeer { nodeInteraction.peerSelected(chatPeer) } @@ -378,13 +379,13 @@ public final class ChatListNode: ListView { private var hapticFeedback: HapticFeedback? - public init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, mode: ChatListNodeMode, theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { + public init(context: AccountContext, groupId: PeerGroupId, controlsHistoryPreload: Bool, mode: ChatListNodeMode, theme: PresentationTheme, fontSize: PresentationFontSize, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { self.context = context self.groupId = groupId self.controlsHistoryPreload = controlsHistoryPreload self.mode = mode - self.currentState = ChatListNodeState(presentationData: ChatListPresentationData(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, disableAnimations: disableAnimations), editing: false, peerIdWithRevealedOptions: nil, selectedPeerIds: Set(), peerInputActivities: nil, pendingRemovalPeerIds: Set(), pendingClearHistoryPeerIds: Set(), archiveShouldBeTemporaryRevealed: false) + self.currentState = ChatListNodeState(presentationData: ChatListPresentationData(theme: theme, fontSize: fontSize, strings: strings, dateTimeFormat: dateTimeFormat, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, disableAnimations: disableAnimations), editing: false, peerIdWithRevealedOptions: nil, selectedPeerIds: Set(), peerInputActivities: nil, pendingRemovalPeerIds: Set(), pendingClearHistoryPeerIds: Set(), archiveShouldBeTemporaryRevealed: false) self.statePromise = ValuePromise(self.currentState, ignoreRepeated: true) self.theme = theme @@ -1070,7 +1071,7 @@ public final class ChatListNode: ListView { self.activityStatusesDisposable?.dispose() } - public func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { + public func updateThemeAndStrings(theme: PresentationTheme, fontSize: PresentationFontSize, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { if theme !== self.currentState.presentationData.theme || strings !== self.currentState.presentationData.strings || dateTimeFormat != self.currentState.presentationData.dateTimeFormat || disableAnimations != self.currentState.presentationData.disableAnimations { self.theme = theme if self.keepTopItemOverscrollBackground != nil { @@ -1080,7 +1081,7 @@ public final class ChatListNode: ListView { self.updateState { state in var state = state - state.presentationData = ChatListPresentationData(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, disableAnimations: disableAnimations) + state.presentationData = ChatListPresentationData(theme: theme, fontSize: fontSize, strings: strings, dateTimeFormat: dateTimeFormat, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, disableAnimations: disableAnimations) return state } } diff --git a/submodules/ChatListUI/Sources/Node/ChatListPresentationData.swift b/submodules/ChatListUI/Sources/Node/ChatListPresentationData.swift index da0d405e97..5c7f1190b2 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListPresentationData.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListPresentationData.swift @@ -5,14 +5,16 @@ import TelegramUIPreferences public final class ChatListPresentationData { public let theme: PresentationTheme + public let fontSize: PresentationFontSize public let strings: PresentationStrings public let dateTimeFormat: PresentationDateTimeFormat public let nameSortOrder: PresentationPersonNameOrder public let nameDisplayOrder: PresentationPersonNameOrder public let disableAnimations: Bool - public init(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { + public init(theme: PresentationTheme, fontSize: PresentationFontSize, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, disableAnimations: Bool) { self.theme = theme + self.fontSize = fontSize self.strings = strings self.dateTimeFormat = dateTimeFormat self.nameSortOrder = nameSortOrder diff --git a/submodules/ComposePollUI/Sources/CreatePollController.swift b/submodules/ComposePollUI/Sources/CreatePollController.swift index a1b13f6384..cbf36c2929 100644 --- a/submodules/ComposePollUI/Sources/CreatePollController.swift +++ b/submodules/ComposePollUI/Sources/CreatePollController.swift @@ -131,17 +131,17 @@ private enum CreatePollEntry: ItemListNodeEntry { return lhs.sortId < rhs.sortId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! CreatePollControllerArguments switch self { case let .textHeader(theme, text, accessoryText): - return ItemListSectionHeaderItem(theme: theme, text: text, accessoryText: accessoryText, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, accessoryText: accessoryText, sectionId: self.section) case let .text(theme, placeholder, text, maxLength): - return ItemListMultilineInputItem(theme: theme, text: text, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: maxLength, display: false), sectionId: self.section, style: .blocks, textUpdated: { value in + return ItemListMultilineInputItem(presentationData: presentationData, text: text, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: maxLength, display: false), sectionId: self.section, style: .blocks, textUpdated: { value in arguments.updatePollText(value) }, tag: CreatePollEntryTag.text) case let .optionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .option(theme, strings, id, _, placeholder, text, revealed, hasNext): return CreatePollOptionItem(theme: theme, strings: strings, id: id, placeholder: placeholder, value: text, maxLength: maxOptionLength, editing: CreatePollOptionItemEditing(editable: true, hasActiveRevealControls: revealed), sectionId: self.section, setItemIdWithRevealedOptions: { id, fromId in arguments.setItemIdWithRevealedOptions(id, fromId) @@ -159,7 +159,7 @@ private enum CreatePollEntry: ItemListNodeEntry { arguments.addOption() }) case let .optionsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -381,8 +381,8 @@ public func createPollController(context: AccountContext, peerId: PeerId, comple ensureVisibleItemTag = focusItemTag } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.CreatePoll_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: createPollControllerEntries(presentationData: presentationData, state: state, limitsConfiguration: limitsConfiguration), style: .blocks, focusItemTag: focusItemTag, ensureVisibleItemTag: ensureVisibleItemTag, animateChanges: previousIds != nil && previousIds != optionIds) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.CreatePoll_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: createPollControllerEntries(presentationData: presentationData, state: state, limitsConfiguration: limitsConfiguration), style: .blocks, focusItemTag: focusItemTag, ensureVisibleItemTag: ensureVisibleItemTag, animateChanges: previousIds != nil && previousIds != optionIds) return (controllerState, (listState, arguments)) } diff --git a/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift b/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift index 6b076495d3..f322e1c478 100644 --- a/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift +++ b/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift @@ -235,8 +235,8 @@ class CreatePollOptionItemNode: ItemListRevealOptionsItemNode, ItemListItemNode, updatedTheme = item.theme } - let controlSizeAndApply = editableControlLayout(44.0, item.theme, false) - let reorderSizeAndApply = reorderControlLayout(44.0, item.theme) + let controlSizeAndApply = editableControlLayout(item.theme, false) + let reorderSizeAndApply = reorderControlLayout(item.theme) let separatorHeight = UIScreenPixel @@ -370,12 +370,12 @@ class CreatePollOptionItemNode: ItemListRevealOptionsItemNode, ItemListItemNode, strongSelf.topStripeNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: layout.contentSize.width, height: separatorHeight)) strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height - UIScreenPixel), size: CGSize(width: layout.contentSize.width - bottomStripeInset, height: separatorHeight)) - let _ = controlSizeAndApply.1() - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + 6.0 + revealOffset, y: 0.0), size: controlSizeAndApply.0) + let _ = controlSizeAndApply.1(layout.contentSize.height) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + 6.0 + revealOffset, y: 0.0), size: CGSize(width: controlSizeAndApply.0, height: contentSize.height)) strongSelf.editableControlNode.frame = editableControlFrame - let _ = reorderSizeAndApply.1(displayTextLimit && layout.contentSize.height <= 44.0) - let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderSizeAndApply.0.width, y: 0.0), size: reorderSizeAndApply.0) + let _ = reorderSizeAndApply.1(layout.contentSize.height, displayTextLimit && layout.contentSize.height <= 44.0) + let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderSizeAndApply.0, y: 0.0), size: CGSize(width: reorderSizeAndApply.0, height: layout.contentSize.height)) strongSelf.reorderControlNode.frame = reorderControlFrame let _ = textLimitApply() diff --git a/submodules/ContactListUI/Sources/ContactListActionItem.swift b/submodules/ContactListUI/Sources/ContactListActionItem.swift index 27e30043b4..7107ceb8f7 100644 --- a/submodules/ContactListUI/Sources/ContactListActionItem.swift +++ b/submodules/ContactListUI/Sources/ContactListActionItem.swift @@ -15,7 +15,7 @@ public enum ContactListActionItemHighlight { } class ContactListActionItem: ListViewItem, ListViewItemWithHeader { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: String let icon: ContactListActionItemIcon let highlight: ContactListActionItemHighlight @@ -23,8 +23,8 @@ class ContactListActionItem: ListViewItem, ListViewItemWithHeader { let action: () -> Void let header: ListViewItemHeader? - init(theme: PresentationTheme, title: String, icon: ContactListActionItemIcon, highlight: ContactListActionItemHighlight = .cell, clearHighlightAutomatically: Bool = true, header: ListViewItemHeader?, action: @escaping () -> Void) { - self.theme = theme + init(presentationData: ItemListPresentationData, title: String, icon: ContactListActionItemIcon, highlight: ContactListActionItemHighlight = .cell, clearHighlightAutomatically: Bool = true, header: ListViewItemHeader?, action: @escaping () -> Void) { + self.presentationData = presentationData self.title = title self.icon = icon self.highlight = highlight @@ -110,8 +110,6 @@ class ContactListActionItem: ListViewItem, ListViewItemWithHeader { } } -private let titleFont = Font.regular(17.0) - class ContactListActionItemNode: ListViewItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -123,8 +121,6 @@ class ContactListActionItemNode: ListViewItemNode { private let activateArea: AccessibilityAreaNode - private var theme: PresentationTheme? - private var item: ContactListActionItem? init() { @@ -167,23 +163,25 @@ class ContactListActionItemNode: ListViewItemNode { func asyncLayout() -> (_ item: ContactListActionItem, _ params: ListViewItemLayoutParams, _ firstWithHeader: Bool, _ last: Bool) -> (ListViewItemNodeLayout, () -> Void) { let makeTitleLayout = TextNode.asyncLayout(self.titleNode) - let currentTheme = self.theme + let currentItem = self.item return { item, params, firstWithHeader, last in var updatedTheme: PresentationTheme? - if currentTheme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + var leftInset: CGFloat = 16.0 + params.leftInset if case .generic = item.icon { leftInset += 49.0 } - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemAccentColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - 10.0 - leftInset - params.rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemAccentColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - 10.0 - leftInset - params.rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let contentSize = CGSize(width: params.width, height: 50.0) + let contentSize = CGSize(width: params.width, height: 12.0 * 2.0 + titleLayout.size.height) let insets = UIEdgeInsets(top: firstWithHeader ? 29.0 : 0.0, left: 0.0, bottom: 0.0, right: 0.0) let separatorHeight = UIScreenPixel @@ -192,18 +190,17 @@ class ContactListActionItemNode: ListViewItemNode { return (layout, { [weak self] in if let strongSelf = self { strongSelf.item = item - strongSelf.theme = item.theme strongSelf.activateArea.accessibilityLabel = item.title strongSelf.activateArea.frame = CGRect(origin: CGPoint(x: params.leftInset, y: 0.0), size: CGSize(width: layout.contentSize.width - params.leftInset - params.rightInset, height: layout.contentSize.height)) if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemPlainSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemPlainSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.plainBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemPlainSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemPlainSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.plainBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor - strongSelf.iconNode.image = generateTintedImage(image: item.icon.image, color: item.theme.list.itemAccentColor) + strongSelf.iconNode.image = generateTintedImage(image: item.icon.image, color: item.presentationData.theme.list.itemAccentColor) } let _ = titleApply() @@ -218,12 +215,12 @@ class ContactListActionItemNode: ListViewItemNode { let iconSpacing: CGFloat = 4.0 let totalWidth: CGFloat = titleLayout.size.width + image.size.width + iconSpacing switch position { - case .left: - iconFrame = CGRect(origin: CGPoint(x: params.leftInset + floor((contentSize.width - params.leftInset - params.rightInset - totalWidth) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) - titleOffset = iconFrame.minX + iconSpacing - case .right: - iconFrame = CGRect(origin: CGPoint(x: params.leftInset + floor((contentSize.width - params.leftInset - params.rightInset - totalWidth) / 2.0) + totalWidth - image.size.width, y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) - titleOffset = iconFrame.maxX - totalWidth + case .left: + iconFrame = CGRect(origin: CGPoint(x: params.leftInset + floor((contentSize.width - params.leftInset - params.rightInset - totalWidth) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) + titleOffset = iconFrame.minX + iconSpacing + case .right: + iconFrame = CGRect(origin: CGPoint(x: params.leftInset + floor((contentSize.width - params.leftInset - params.rightInset - totalWidth) / 2.0) + totalWidth - image.size.width, y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) + titleOffset = iconFrame.maxX - totalWidth } default: iconFrame = CGRect(origin: CGPoint(x: params.leftInset + floor((leftInset - params.leftInset - image.size.width) / 2.0) + 3.0, y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) diff --git a/submodules/ContactListUI/Sources/ContactListNode.swift b/submodules/ContactListUI/Sources/ContactListNode.swift index fd789bc2dd..e95c6f0e12 100644 --- a/submodules/ContactListUI/Sources/ContactListNode.swift +++ b/submodules/ContactListUI/Sources/ContactListNode.swift @@ -152,9 +152,7 @@ private enum ContactListNodeEntry: Comparable, Identifiable { } } - - - func item(account: Account, interaction: ContactListNodeInteraction) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, interaction: ContactListNodeInteraction) -> ListViewItem { switch self { case let .search(theme, strings): return ChatListSearchItem(theme: theme, placeholder: strings.Contacts_SearchLabel, activate: { @@ -165,19 +163,19 @@ private enum ContactListNodeEntry: Comparable, Identifiable { if case .presence = sortOrder { text = strings.Contacts_SortedByPresence } - return ContactListActionItem(theme: theme, title: text, icon: .inline(dropDownIcon, .right), highlight: .alpha, header: nil, action: { + return ContactListActionItem(presentationData: ItemListPresentationData(presentationData), title: text, icon: .inline(dropDownIcon, .right), highlight: .alpha, header: nil, action: { interaction.openSortMenu() }) case let .permissionInfo(theme, title, text, suppressed): - return InfoListItem(theme: theme, title: title, text: .plain(text), style: .plain, closeAction: suppressed ? nil : { + return InfoListItem(presentationData: ItemListPresentationData(presentationData), title: title, text: .plain(text), style: .plain, closeAction: suppressed ? nil : { interaction.suppressWarning() }) case let .permissionEnable(theme, text): - return ContactListActionItem(theme: theme, title: text, icon: .none, header: nil, action: { + return ContactListActionItem(presentationData: ItemListPresentationData(presentationData), title: text, icon: .none, header: nil, action: { interaction.authorize() }) case let .option(_, option, header, theme, _): - return ContactListActionItem(theme: theme, title: option.title, icon: option.icon, clearHighlightAutomatically: false, header: header, action: option.action) + return ContactListActionItem(presentationData: ItemListPresentationData(presentationData), title: option.title, icon: option.icon, clearHighlightAutomatically: false, header: header, action: option.action) case let .peer(_, peer, presence, header, selection, theme, strings, dateTimeFormat, nameSortOrder, nameDisplayOrder, enabled): let status: ContactsPeerItemStatus let itemPeer: ContactsPeerItemPeer @@ -221,7 +219,7 @@ private enum ContactListNodeEntry: Comparable, Identifiable { } } } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: itemPeer, status: status, enabled: enabled, selection: selection, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: itemPeer, status: status, enabled: enabled, selection: selection, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in interaction.openPeer(peer) }, itemHighlighting: interaction.itemHighlighting, contextAction: itemContextAction) } @@ -602,12 +600,12 @@ private func contactListNodeEntries(accountPeer: Peer?, peers: [ContactListPeer] return entries } -private func preparedContactListNodeTransition(account: Account, from fromEntries: [ContactListNodeEntry], to toEntries: [ContactListNodeEntry], interaction: ContactListNodeInteraction, firstTime: Bool, isEmpty: Bool, generateIndexSections: Bool, animation: ContactListAnimation) -> ContactsListNodeTransition { +private func preparedContactListNodeTransition(account: Account, presentationData: PresentationData, from fromEntries: [ContactListNodeEntry], to toEntries: [ContactListNodeEntry], interaction: ContactListNodeInteraction, firstTime: Bool, isEmpty: Bool, generateIndexSections: Bool, animation: ContactListAnimation) -> ContactsListNodeTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, interaction: interaction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, interaction: interaction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } var shouldFixScroll = false var indexSections: [String] = [] @@ -772,7 +770,7 @@ public final class ContactListNode: ASDisplayNode { private var presentationData: PresentationData private var presentationDataDisposable: Disposable? - private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationDateTimeFormat, PresentationPersonNameOrder, PresentationPersonNameOrder, Bool)> + private let presentationDataPromise: Promise private var authorizationNode: PermissionContentNode private let displayPermissionPlaceholder: Bool @@ -790,7 +788,7 @@ public final class ContactListNode: ASDisplayNode { self.indexNode = CollectionIndexNode() - self.themeAndStringsPromise = Promise((self.presentationData.theme, self.presentationData.strings, self.presentationData.dateTimeFormat, self.presentationData.nameSortOrder, self.presentationData.nameDisplayOrder, self.presentationData.disableAnimations)) + self.presentationDataPromise = Promise(self.presentationData) let contactsAuthorization = Promise() contactsAuthorization.set(.single(.allowed) @@ -900,7 +898,7 @@ public final class ContactListNode: ASDisplayNode { var firstTime: Int32 = 1 let selectionStateSignal = self.selectionStatePromise.get() let transition: Signal - let themeAndStringsPromise = self.themeAndStringsPromise + let presentationDataPromise = self.presentationDataPromise transition = presentation |> mapToSignal { presentation in @@ -980,8 +978,8 @@ public final class ContactListNode: ASDisplayNode { foundDeviceContacts = .single([:]) } - return combineLatest(foundLocalContacts, foundRemoteContacts, foundDeviceContacts, selectionStateSignal, themeAndStringsPromise.get()) - |> mapToQueue { localPeersAndStatuses, remotePeers, deviceContacts, selectionState, themeAndStrings -> Signal in + return combineLatest(foundLocalContacts, foundRemoteContacts, foundDeviceContacts, selectionStateSignal, presentationDataPromise.get()) + |> mapToQueue { localPeersAndStatuses, remotePeers, deviceContacts, selectionState, presentationData -> Signal in let signal = deferred { () -> Signal in var existingPeerIds = Set() var disabledPeerIds = Set() @@ -1084,9 +1082,9 @@ public final class ContactListNode: ASDisplayNode { peers.append(.deviceContact(stableId, contact.0)) } - let entries = contactListNodeEntries(accountPeer: nil, peers: peers, presences: localPeersAndStatuses.1, presentation: presentation, selectionState: selectionState, theme: themeAndStrings.0, strings: themeAndStrings.1, dateTimeFormat: themeAndStrings.2, sortOrder: themeAndStrings.3, displayOrder: themeAndStrings.4, disabledPeerIds: disabledPeerIds, authorizationStatus: .allowed, warningSuppressed: (true, true), displaySortOptions: false) + let entries = contactListNodeEntries(accountPeer: nil, peers: peers, presences: localPeersAndStatuses.1, presentation: presentation, selectionState: selectionState, theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, disabledPeerIds: disabledPeerIds, authorizationStatus: .allowed, warningSuppressed: (true, true), displaySortOptions: false) let previous = previousEntries.swap(entries) - return .single(preparedContactListNodeTransition(account: context.account, from: previous ?? [], to: entries, interaction: interaction, firstTime: previous == nil, isEmpty: false, generateIndexSections: generateSections, animation: .none)) + return .single(preparedContactListNodeTransition(account: context.account, presentationData: presentationData, from: previous ?? [], to: entries, interaction: interaction, firstTime: previous == nil, isEmpty: false, generateIndexSections: generateSections, animation: .none)) } if OSAtomicCompareAndSwap32(1, 0, &firstTime) { @@ -1129,8 +1127,8 @@ public final class ContactListNode: ASDisplayNode { chatListSignal = .single([]) } - return (combineLatest(self.contactPeersViewPromise.get(), chatListSignal, selectionStateSignal, themeAndStringsPromise.get(), contactsAuthorization.get(), contactsWarningSuppressed.get()) - |> mapToQueue { view, chatListPeers, selectionState, themeAndStrings, authorizationStatus, warningSuppressed -> Signal in + return (combineLatest(self.contactPeersViewPromise.get(), chatListSignal, selectionStateSignal, presentationDataPromise.get(), contactsAuthorization.get(), contactsWarningSuppressed.get()) + |> mapToQueue { view, chatListPeers, selectionState, presentationData, authorizationStatus, warningSuppressed -> Signal in let signal = deferred { () -> Signal in var peers = view.peers.map({ ContactListPeer.peer(peer: $0, isGlobal: false, participantCount: nil) }) for (peer, memberCount) in chatListPeers { @@ -1162,7 +1160,7 @@ public final class ContactListNode: ASDisplayNode { if (authorizationStatus == .notDetermined || authorizationStatus == .denied) && peers.isEmpty { isEmpty = true } - let entries = contactListNodeEntries(accountPeer: view.accountPeer, peers: peers, presences: view.peerPresences, presentation: presentation, selectionState: selectionState, theme: themeAndStrings.0, strings: themeAndStrings.1, dateTimeFormat: themeAndStrings.2, sortOrder: themeAndStrings.3, displayOrder: themeAndStrings.4, disabledPeerIds: disabledPeerIds, authorizationStatus: authorizationStatus, warningSuppressed: warningSuppressed, displaySortOptions: displaySortOptions) + let entries = contactListNodeEntries(accountPeer: view.accountPeer, peers: peers, presences: view.peerPresences, presentation: presentation, selectionState: selectionState, theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, disabledPeerIds: disabledPeerIds, authorizationStatus: authorizationStatus, warningSuppressed: warningSuppressed, displaySortOptions: displaySortOptions) let previous = previousEntries.swap(entries) var hadPermissionInfo = false @@ -1186,13 +1184,13 @@ public final class ContactListNode: ASDisplayNode { if hadPermissionInfo != hasPermissionInfo { animation = .insertion } - else if let previous = previous, !themeAndStrings.5, (entries.count - previous.count) < 20 { + else if let previous = previous, !presentationData.disableAnimations, (entries.count - previous.count) < 20 { animation = .default } else { animation = .none } - return .single(preparedContactListNodeTransition(account: context.account, from: previous ?? [], to: entries, interaction: interaction, firstTime: previous == nil, isEmpty: isEmpty, generateIndexSections: generateSections, animation: animation)) + return .single(preparedContactListNodeTransition(account: context.account, presentationData: presentationData, from: previous ?? [], to: entries, interaction: interaction, firstTime: previous == nil, isEmpty: isEmpty, generateIndexSections: generateSections, animation: animation)) } if OSAtomicCompareAndSwap32(1, 0, &firstTime) { @@ -1221,7 +1219,7 @@ public final class ContactListNode: ASDisplayNode { if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings || previousDisableAnimations != presentationData.disableAnimations { strongSelf.backgroundColor = presentationData.theme.chatList.backgroundColor strongSelf.listNode.verticalScrollIndicatorColor = presentationData.theme.list.scrollIndicatorColor - strongSelf.themeAndStringsPromise.set(.single((presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, presentationData.nameSortOrder, presentationData.nameDisplayOrder, presentationData.disableAnimations))) + strongSelf.presentationDataPromise.set(.single(presentationData)) let authorizationPreviousHidden = strongSelf.authorizationNode.isHidden strongSelf.authorizationNode.removeFromSupernode() diff --git a/submodules/ContactListUI/Sources/ContactsSearchContainerNode.swift b/submodules/ContactListUI/Sources/ContactsSearchContainerNode.swift index 8a23d9bdaf..7d051b7ff6 100644 --- a/submodules/ContactListUI/Sources/ContactsSearchContainerNode.swift +++ b/submodules/ContactListUI/Sources/ContactsSearchContainerNode.swift @@ -15,6 +15,7 @@ import ChatListSearchItemHeader import ContactsPeerItem import ContextUI import PhoneNumberFormat +import ItemListUI private enum ContactListSearchGroup { case contacts @@ -68,7 +69,7 @@ private struct ContactListSearchEntry: Identifiable, Comparable { return lhs.index < rhs.index } - func item(account: Account, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, timeFormat: PresentationDateTimeFormat, openPeer: @escaping (ContactListPeer) -> Void, contextAction: ((Peer, ASDisplayNode, ContextGesture?) -> Void)?) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, timeFormat: PresentationDateTimeFormat, openPeer: @escaping (ContactListPeer) -> Void, contextAction: ((Peer, ASDisplayNode, ContextGesture?) -> Void)?) -> ListViewItem { let header: ListViewItemHeader let status: ContactsPeerItemStatus switch self.group { @@ -100,7 +101,7 @@ private struct ContactListSearchEntry: Identifiable, Comparable { case let .deviceContact(stableId, contact): peerItem = .deviceContact(stableId: stableId, contact: contact) } - return ContactsPeerItem(theme: self.theme, strings: self.strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: peerItem, status: status, enabled: self.enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: peerItem, status: status, enabled: self.enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: header, action: { _ in openPeer(peer) }, contextAction: contextAction.flatMap { contextAction in return nativePeer.flatMap { nativePeer in @@ -119,12 +120,12 @@ struct ContactListSearchContainerTransition { let isSearching: Bool } -private func contactListSearchContainerPreparedRecentTransition(from fromEntries: [ContactListSearchEntry], to toEntries: [ContactListSearchEntry], isSearching: Bool, account: Account, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, timeFormat: PresentationDateTimeFormat, openPeer: @escaping (ContactListPeer) -> Void, contextAction: ((Peer, ASDisplayNode, ContextGesture?) -> Void)?) -> ContactListSearchContainerTransition { +private func contactListSearchContainerPreparedRecentTransition(from fromEntries: [ContactListSearchEntry], to toEntries: [ContactListSearchEntry], isSearching: Bool, account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, timeFormat: PresentationDateTimeFormat, openPeer: @escaping (ContactListPeer) -> Void, contextAction: ((Peer, ASDisplayNode, ContextGesture?) -> Void)?) -> ContactListSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, timeFormat: timeFormat, openPeer: openPeer, contextAction: contextAction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, timeFormat: timeFormat, openPeer: openPeer, contextAction: contextAction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, timeFormat: timeFormat, openPeer: openPeer, contextAction: contextAction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, timeFormat: timeFormat, openPeer: openPeer, contextAction: contextAction), directionHint: nil) } return ContactListSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, isSearching: isSearching) } @@ -323,7 +324,7 @@ public final class ContactsSearchContainerNode: SearchDisplayControllerContentNo if let strongSelf = self { let previousItems = previousSearchItems.swap(items ?? []) - let transition = contactListSearchContainerPreparedRecentTransition(from: previousItems, to: items ?? [], isSearching: items != nil, account: context.account, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, timeFormat: strongSelf.presentationData.dateTimeFormat, openPeer: { peer in self?.listNode.clearHighlightAnimated(true) + let transition = contactListSearchContainerPreparedRecentTransition(from: previousItems, to: items ?? [], isSearching: items != nil, account: context.account, presentationData: strongSelf.presentationData, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, timeFormat: strongSelf.presentationData.dateTimeFormat, openPeer: { peer in self?.listNode.clearHighlightAnimated(true) self?.openPeer(peer) }, contextAction: strongSelf.contextAction) diff --git a/submodules/ContactListUI/Sources/InviteContactsControllerNode.swift b/submodules/ContactListUI/Sources/InviteContactsControllerNode.swift index 59d791b2cb..60097e8b61 100644 --- a/submodules/ContactListUI/Sources/InviteContactsControllerNode.swift +++ b/submodules/ContactListUI/Sources/InviteContactsControllerNode.swift @@ -17,6 +17,7 @@ import ContactsPeerItem import ChatListSearchItemHeader import AppBundle import PhoneNumberFormat +import ItemListUI private enum InviteContactsEntryId: Hashable { case option(index: Int) @@ -46,10 +47,10 @@ private enum InviteContactsEntry: Comparable, Identifiable { } } - func item(account: Account, interaction: InviteContactsInteraction) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, interaction: InviteContactsInteraction) -> ListViewItem { switch self { case let .option(_, option, theme, _): - return ContactListActionItem(theme: theme, title: option.title, icon: option.icon, header: nil, action: option.action) + return ContactListActionItem(presentationData: ItemListPresentationData(presentationData), title: option.title, icon: option.icon, header: nil, action: option.action) case let .peer(_, id, contact, count, selection, theme, strings, nameSortOrder, nameDisplayOrder): let status: ContactsPeerItemStatus if count != 0 { @@ -58,7 +59,7 @@ private enum InviteContactsEntry: Comparable, Identifiable { status = .none } let peer = TelegramUser(id: PeerId(namespace: -1, id: 0), accessHash: nil, firstName: contact.firstName, lastName: contact.lastName, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: status, enabled: true, selection: selection, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: ChatListSearchItemHeader(type: .contacts, theme: theme, strings: strings, actionTitle: nil, action: nil), action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: status, enabled: true, selection: selection, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: ChatListSearchItemHeader(type: .contacts, theme: theme, strings: strings, actionTitle: nil, action: nil), action: { _ in interaction.toggleContact(id) }) } @@ -201,12 +202,12 @@ private func inviteContactsEntries(accountPeer: Peer?, sortedContacts: [(DeviceC return entries } -private func preparedInviteContactsTransition(account: Account, from fromEntries: [InviteContactsEntry], to toEntries: [InviteContactsEntry], sortedContacts: [(DeviceContactStableId, DeviceContactBasicData, Int32)]?, interaction: InviteContactsInteraction, isLoading: Bool, firstTime: Bool, crossfade: Bool) -> InviteContactsTransition { +private func preparedInviteContactsTransition(account: Account, presentationData: PresentationData, from fromEntries: [InviteContactsEntry], to toEntries: [InviteContactsEntry], sortedContacts: [(DeviceContactStableId, DeviceContactBasicData, Int32)]?, interaction: InviteContactsInteraction, isLoading: Bool, firstTime: Bool, crossfade: Bool) -> InviteContactsTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, interaction: interaction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, interaction: interaction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } return InviteContactsTransition(deletions: deletions, insertions: insertions, updates: updates, sortedContacts: sortedContacts, isLoading: isLoading, firstTime: firstTime, crossfade: crossfade) } @@ -263,7 +264,7 @@ final class InviteContactsControllerNode: ASDisplayNode { private var presentationData: PresentationData private var presentationDataDisposable: Disposable? - private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder)> + private let presentationDataPromise: Promise private let _ready = Promise() private var readyValue = false { @@ -288,7 +289,7 @@ final class InviteContactsControllerNode: ASDisplayNode { self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.themeAndStringsPromise = Promise((self.presentationData.theme, self.presentationData.strings, self.presentationData.nameSortOrder, self.presentationData.nameDisplayOrder)) + self.presentationDataPromise = Promise(self.presentationData) self.listNode = ListView() @@ -316,7 +317,7 @@ final class InviteContactsControllerNode: ASDisplayNode { let previousStrings = strongSelf.presentationData.strings strongSelf.presentationData = presentationData - strongSelf.themeAndStringsPromise.set(.single((presentationData.theme, presentationData.strings, presentationData.nameSortOrder, presentationData.nameDisplayOrder))) + strongSelf.presentationDataPromise.set(.single(presentationData)) if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings { strongSelf.updateThemeAndStrings() @@ -327,7 +328,7 @@ final class InviteContactsControllerNode: ASDisplayNode { let account = self.context.account let selectionStateSignal = self.selectionStatePromise.get() let transition: Signal - let themeAndStringsPromise = self.themeAndStringsPromise + let presentationDataPromise = self.presentationDataPromise let previousEntries = Atomic<[InviteContactsEntry]?>(value: nil) let interaction = InviteContactsInteraction(toggleContact: { [weak self] id in @@ -403,19 +404,19 @@ final class InviteContactsControllerNode: ASDisplayNode { } let processingQueue = Queue() - transition = (combineLatest(.single(nil) |> then(sortedContacts), selectionStateSignal, themeAndStringsPromise.get(), .single(true) |> delay(0.2, queue: Queue.mainQueue())) - |> mapToQueue { sortedContacts, selectionState, themeAndStrings, ready -> Signal in + transition = (combineLatest(.single(nil) |> then(sortedContacts), selectionStateSignal, presentationDataPromise.get(), .single(true) |> delay(0.2, queue: Queue.mainQueue())) + |> mapToQueue { sortedContacts, selectionState, presentationData, ready -> Signal in guard sortedContacts != nil || ready else { return .never() } let signal = deferred { () -> Signal in - let entries = inviteContactsEntries(accountPeer: nil, sortedContacts: sortedContacts, selectionState: selectionState, theme: themeAndStrings.0, strings: themeAndStrings.1, nameSortOrder: themeAndStrings.2, nameDisplayOrder: themeAndStrings.3, interaction: interaction) + let entries = inviteContactsEntries(accountPeer: nil, sortedContacts: sortedContacts, selectionState: selectionState, theme: presentationData.theme, strings: presentationData.strings, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, interaction: interaction) let previous = previousEntries.swap(entries) let previousContacts = currentSortedContacts.with { $0 } let crossfade = previous != nil && previousContacts == nil - return .single(preparedInviteContactsTransition(account: context.account, from: previous ?? [], to: entries, sortedContacts: sortedContacts, interaction: interaction, isLoading: sortedContacts == nil, firstTime: previous == nil, crossfade: crossfade)) + return .single(preparedInviteContactsTransition(account: context.account, presentationData: presentationData, from: previous ?? [], to: entries, sortedContacts: sortedContacts, interaction: interaction, isLoading: sortedContacts == nil, firstTime: previous == nil, crossfade: crossfade)) } return signal |> runOn(processingQueue) diff --git a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift index 98c6650255..e12b099d7f 100644 --- a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift +++ b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift @@ -27,11 +27,6 @@ public final class ContactItemHighlighting { } } -private let titleFont = Font.regular(17.0) -private let titleBoldFont = Font.medium(17.0) -private let statusFont = Font.regular(13.0) -private let badgeFont = Font.regular(14.0) - public enum ContactsPeerItemStatus { case none case presence(PeerPresence, PresentationDateTimeFormat) @@ -110,8 +105,7 @@ public enum ContactsPeerItemPeer: Equatable { } public class ContactsPeerItem: ListViewItem, ListViewItemWithHeader { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let sortOrder: PresentationPersonNameOrder let displayOrder: PresentationPersonNameOrder let account: Account @@ -136,9 +130,8 @@ public class ContactsPeerItem: ListViewItem, ListViewItemWithHeader { public let header: ListViewItemHeader? - public init(theme: PresentationTheme, strings: PresentationStrings, sortOrder: PresentationPersonNameOrder, displayOrder: PresentationPersonNameOrder, account: Account, peerMode: ContactsPeerItemPeerMode, peer: ContactsPeerItemPeer, status: ContactsPeerItemStatus, badge: ContactsPeerItemBadge? = nil, enabled: Bool, selection: ContactsPeerItemSelection, editing: ContactsPeerItemEditing, options: [ItemListPeerItemRevealOption] = [], actionIcon: ContactsPeerItemActionIcon = .none, index: PeerNameIndex?, header: ListViewItemHeader?, action: @escaping (ContactsPeerItemPeer) -> Void, setPeerIdWithRevealedOptions: ((PeerId?, PeerId?) -> Void)? = nil, deletePeer: ((PeerId) -> Void)? = nil, itemHighlighting: ContactItemHighlighting? = nil, contextAction: ((ASDisplayNode, ContextGesture?) -> Void)? = nil) { - self.theme = theme - self.strings = strings + public init(presentationData: ItemListPresentationData, sortOrder: PresentationPersonNameOrder, displayOrder: PresentationPersonNameOrder, account: Account, peerMode: ContactsPeerItemPeerMode, peer: ContactsPeerItemPeer, status: ContactsPeerItemStatus, badge: ContactsPeerItemBadge? = nil, enabled: Bool, selection: ContactsPeerItemSelection, editing: ContactsPeerItemEditing, options: [ItemListPeerItemRevealOption] = [], actionIcon: ContactsPeerItemActionIcon = .none, index: PeerNameIndex?, header: ListViewItemHeader?, action: @escaping (ContactsPeerItemPeer) -> Void, setPeerIdWithRevealedOptions: ((PeerId?, PeerId?) -> Void)? = nil, deletePeer: ((PeerId) -> Void)? = nil, itemHighlighting: ContactItemHighlighting? = nil, contextAction: ((ASDisplayNode, ContextGesture?) -> Void)? = nil) { + self.presentationData = presentationData self.sortOrder = sortOrder self.displayOrder = displayOrder self.account = account @@ -203,7 +196,7 @@ public class ContactsPeerItem: ListViewItem, ListViewItemWithHeader { } } } - self.headerAccessoryItem = ContactsSectionHeaderAccessoryItem(sectionHeader: .letter(letter), theme: theme) + self.headerAccessoryItem = ContactsSectionHeaderAccessoryItem(sectionHeader: .letter(letter), theme: presentationData.theme) } else { self.headerAccessoryItem = nil } @@ -439,8 +432,13 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { return { [weak self] item, params, first, last, firstWithHeader in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + let titleBoldFont = Font.medium(item.presentationData.fontSize.itemListBaseFontSize) + let statusFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 13.0 / 17.0)) + let badgeFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } var leftInset: CGFloat = 65.0 + params.leftInset let rightInset: CGFloat = 10.0 + params.rightInset @@ -448,39 +446,39 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let updatedSelectionNode: CheckNode? var isSelected = false switch item.selection { - case .none: - updatedSelectionNode = nil - case let .selectable(selected): - leftInset += 28.0 - isSelected = selected - - let selectionNode: CheckNode - if let current = currentSelectionNode { - selectionNode = current - updatedSelectionNode = selectionNode - } else { - selectionNode = CheckNode(strokeColor: item.theme.list.itemCheckColors.strokeColor, fillColor: item.theme.list.itemCheckColors.fillColor, foregroundColor: item.theme.list.itemCheckColors.foregroundColor, style: .plain) - selectionNode.isUserInteractionEnabled = false - updatedSelectionNode = selectionNode - } + case .none: + updatedSelectionNode = nil + case let .selectable(selected): + leftInset += 28.0 + isSelected = selected + + let selectionNode: CheckNode + if let current = currentSelectionNode { + selectionNode = current + updatedSelectionNode = selectionNode + } else { + selectionNode = CheckNode(strokeColor: item.presentationData.theme.list.itemCheckColors.strokeColor, fillColor: item.presentationData.theme.list.itemCheckColors.fillColor, foregroundColor: item.presentationData.theme.list.itemCheckColors.foregroundColor, style: .plain) + selectionNode.isUserInteractionEnabled = false + updatedSelectionNode = selectionNode + } } var verificationIconImage: UIImage? switch item.peer { - case let .peer(peer, _): - if let peer = peer, peer.isVerified { - verificationIconImage = PresentationResourcesChatList.verifiedIcon(item.theme) - } - case .deviceContact: - break + case let .peer(peer, _): + if let peer = peer, peer.isVerified { + verificationIconImage = PresentationResourcesChatList.verifiedIcon(item.presentationData.theme) + } + case .deviceContact: + break } let actionIconImage: UIImage? switch item.actionIcon { - case .none: - actionIconImage = nil - case .add: - actionIconImage = PresentationResourcesItemList.plusIconImage(item.theme) + case .none: + actionIconImage = nil + case .add: + actionIconImage = PresentationResourcesItemList.plusIconImage(item.presentationData.theme) } var titleAttributedString: NSAttributedString? @@ -488,94 +486,94 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { var userPresence: TelegramUserPresence? switch item.peer { - case let .peer(peer, chatPeer): - if let peer = peer { - let textColor: UIColor - if let _ = chatPeer as? TelegramSecretChat { - textColor = item.theme.chatList.secretTitleColor - } else { - textColor = item.theme.list.itemPrimaryTextColor - } - if let user = peer as? TelegramUser { - if peer.id == item.account.peerId, case .generalSearch = item.peerMode { - titleAttributedString = NSAttributedString(string: item.strings.DialogList_SavedMessages, font: titleBoldFont, textColor: textColor) - } else if let firstName = user.firstName, let lastName = user.lastName, !firstName.isEmpty, !lastName.isEmpty { - let string = NSMutableAttributedString() - switch item.displayOrder { - case .firstLast: - string.append(NSAttributedString(string: firstName, font: item.sortOrder == .firstLast ? titleBoldFont : titleFont, textColor: textColor)) - string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) - string.append(NSAttributedString(string: lastName, font: item.sortOrder == .firstLast ? titleFont : titleBoldFont, textColor: textColor)) - case .lastFirst: - string.append(NSAttributedString(string: lastName, font: item.sortOrder == .firstLast ? titleFont : titleBoldFont, textColor: textColor)) - string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) - string.append(NSAttributedString(string: firstName, font: item.sortOrder == .firstLast ? titleBoldFont : titleFont, textColor: textColor)) - } - titleAttributedString = string - } else if let firstName = user.firstName, !firstName.isEmpty { - titleAttributedString = NSAttributedString(string: firstName, font: titleBoldFont, textColor: textColor) - } else if let lastName = user.lastName, !lastName.isEmpty { - titleAttributedString = NSAttributedString(string: lastName, font: titleBoldFont, textColor: textColor) - } else { - titleAttributedString = NSAttributedString(string: item.strings.User_DeletedAccount, font: titleBoldFont, textColor: textColor) - } - } else if let group = peer as? TelegramGroup { - titleAttributedString = NSAttributedString(string: group.title, font: titleBoldFont, textColor: item.theme.list.itemPrimaryTextColor) - } else if let channel = peer as? TelegramChannel { - titleAttributedString = NSAttributedString(string: channel.title, font: titleBoldFont, textColor: item.theme.list.itemPrimaryTextColor) - } - - switch item.status { - case .none: - break - case let .presence(presence, dateTimeFormat): - let presence = (presence as? TelegramUserPresence) ?? TelegramUserPresence(status: .none, lastActivity: 0) - userPresence = presence - let timestamp = CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 - let (string, activity) = stringAndActivityForUserPresence(strings: item.strings, dateTimeFormat: dateTimeFormat, presence: presence, relativeTo: Int32(timestamp)) - statusAttributedString = NSAttributedString(string: string, font: statusFont, textColor: activity ? item.theme.list.itemAccentColor : item.theme.list.itemSecondaryTextColor) - case let .addressName(suffix): - if let addressName = peer.addressName { - let addressNameString = NSAttributedString(string: "@" + addressName, font: statusFont, textColor: item.theme.list.itemAccentColor) - if !suffix.isEmpty { - let suffixString = NSAttributedString(string: suffix, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - let finalString = NSMutableAttributedString() - finalString.append(addressNameString) - finalString.append(suffixString) - statusAttributedString = finalString - } else { - statusAttributedString = addressNameString - } - } else if !suffix.isEmpty { - statusAttributedString = NSAttributedString(string: suffix, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - } - case let .custom(text): - statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - } - } - case let .deviceContact(_, contact): - let textColor: UIColor = item.theme.list.itemPrimaryTextColor - - if !contact.firstName.isEmpty, !contact.lastName.isEmpty { - let string = NSMutableAttributedString() - string.append(NSAttributedString(string: contact.firstName, font: titleFont, textColor: textColor)) - string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) - string.append(NSAttributedString(string: contact.lastName, font: titleBoldFont, textColor: textColor)) - titleAttributedString = string - } else if !contact.firstName.isEmpty { - titleAttributedString = NSAttributedString(string: contact.firstName, font: titleBoldFont, textColor: textColor) - } else if !contact.lastName.isEmpty { - titleAttributedString = NSAttributedString(string: contact.lastName, font: titleBoldFont, textColor: textColor) + case let .peer(peer, chatPeer): + if let peer = peer { + let textColor: UIColor + if let _ = chatPeer as? TelegramSecretChat { + textColor = item.presentationData.theme.chatList.secretTitleColor } else { - titleAttributedString = NSAttributedString(string: item.strings.User_DeletedAccount, font: titleBoldFont, textColor: textColor) + textColor = item.presentationData.theme.list.itemPrimaryTextColor + } + if let user = peer as? TelegramUser { + if peer.id == item.account.peerId, case .generalSearch = item.peerMode { + titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: titleBoldFont, textColor: textColor) + } else if let firstName = user.firstName, let lastName = user.lastName, !firstName.isEmpty, !lastName.isEmpty { + let string = NSMutableAttributedString() + switch item.displayOrder { + case .firstLast: + string.append(NSAttributedString(string: firstName, font: item.sortOrder == .firstLast ? titleBoldFont : titleFont, textColor: textColor)) + string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) + string.append(NSAttributedString(string: lastName, font: item.sortOrder == .firstLast ? titleFont : titleBoldFont, textColor: textColor)) + case .lastFirst: + string.append(NSAttributedString(string: lastName, font: item.sortOrder == .firstLast ? titleFont : titleBoldFont, textColor: textColor)) + string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) + string.append(NSAttributedString(string: firstName, font: item.sortOrder == .firstLast ? titleBoldFont : titleFont, textColor: textColor)) + } + titleAttributedString = string + } else if let firstName = user.firstName, !firstName.isEmpty { + titleAttributedString = NSAttributedString(string: firstName, font: titleBoldFont, textColor: textColor) + } else if let lastName = user.lastName, !lastName.isEmpty { + titleAttributedString = NSAttributedString(string: lastName, font: titleBoldFont, textColor: textColor) + } else { + titleAttributedString = NSAttributedString(string: item.presentationData.strings.User_DeletedAccount, font: titleBoldFont, textColor: textColor) + } + } else if let group = peer as? TelegramGroup { + titleAttributedString = NSAttributedString(string: group.title, font: titleBoldFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) + } else if let channel = peer as? TelegramChannel { + titleAttributedString = NSAttributedString(string: channel.title, font: titleBoldFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) } switch item.status { - case let .custom(text): - statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - default: - break + case .none: + break + case let .presence(presence, dateTimeFormat): + let presence = (presence as? TelegramUserPresence) ?? TelegramUserPresence(status: .none, lastActivity: 0) + userPresence = presence + let timestamp = CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 + let (string, activity) = stringAndActivityForUserPresence(strings: item.presentationData.strings, dateTimeFormat: dateTimeFormat, presence: presence, relativeTo: Int32(timestamp)) + statusAttributedString = NSAttributedString(string: string, font: statusFont, textColor: activity ? item.presentationData.theme.list.itemAccentColor : item.presentationData.theme.list.itemSecondaryTextColor) + case let .addressName(suffix): + if let addressName = peer.addressName { + let addressNameString = NSAttributedString(string: "@" + addressName, font: statusFont, textColor: item.presentationData.theme.list.itemAccentColor) + if !suffix.isEmpty { + let suffixString = NSAttributedString(string: suffix, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + let finalString = NSMutableAttributedString() + finalString.append(addressNameString) + finalString.append(suffixString) + statusAttributedString = finalString + } else { + statusAttributedString = addressNameString + } + } else if !suffix.isEmpty { + statusAttributedString = NSAttributedString(string: suffix, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + } + case let .custom(text): + statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } + } + case let .deviceContact(_, contact): + let textColor: UIColor = item.presentationData.theme.list.itemPrimaryTextColor + + if !contact.firstName.isEmpty, !contact.lastName.isEmpty { + let string = NSMutableAttributedString() + string.append(NSAttributedString(string: contact.firstName, font: titleFont, textColor: textColor)) + string.append(NSAttributedString(string: " ", font: titleFont, textColor: textColor)) + string.append(NSAttributedString(string: contact.lastName, font: titleBoldFont, textColor: textColor)) + titleAttributedString = string + } else if !contact.firstName.isEmpty { + titleAttributedString = NSAttributedString(string: contact.firstName, font: titleBoldFont, textColor: textColor) + } else if !contact.lastName.isEmpty { + titleAttributedString = NSAttributedString(string: contact.lastName, font: titleBoldFont, textColor: textColor) + } else { + titleAttributedString = NSAttributedString(string: item.presentationData.strings.User_DeletedAccount, font: titleBoldFont, textColor: textColor) + } + + switch item.status { + case let .custom(text): + statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + default: + break + } } var badgeTextLayoutAndApply: (TextNodeLayout, () -> TextNode)? @@ -584,11 +582,11 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let badgeTextColor: UIColor switch badge.type { case .inactive: - currentBadgeBackgroundImage = PresentationResourcesChatList.badgeBackgroundInactive(item.theme) - badgeTextColor = item.theme.chatList.unreadBadgeInactiveTextColor + currentBadgeBackgroundImage = PresentationResourcesChatList.badgeBackgroundInactive(item.presentationData.theme) + badgeTextColor = item.presentationData.theme.chatList.unreadBadgeInactiveTextColor case .active: - currentBadgeBackgroundImage = PresentationResourcesChatList.badgeBackgroundActive(item.theme) - badgeTextColor = item.theme.chatList.unreadBadgeActiveTextColor + currentBadgeBackgroundImage = PresentationResourcesChatList.badgeBackgroundActive(item.presentationData.theme) + badgeTextColor = item.presentationData.theme.chatList.unreadBadgeActiveTextColor } let badgeAttributedString = NSAttributedString(string: badge.count > 0 ? "\(badge.count)" : " ", font: badgeFont, textColor: badgeTextColor) badgeTextLayoutAndApply = makeBadgeTextLayout(TextNodeLayoutArguments(attributedString: badgeAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: 50.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) @@ -613,13 +611,22 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: max(0.0, params.width - leftInset - rightInset - badgeSize), height: CGFloat.infinity), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let nodeLayout = ListViewItemNodeLayout(contentSize: CGSize(width: params.width, height: 50.0), insets: UIEdgeInsets(top: firstWithHeader ? 29.0 : 0.0, left: 0.0, bottom: 0.0, right: 0.0)) + let verticalInset: CGFloat = statusAttributedString == nil ? 11.0 : 6.0 + + let statusHeightComponent: CGFloat + if statusAttributedString == nil { + statusHeightComponent = 0.0 + } else { + statusHeightComponent = -1.0 + statusLayout.size.height + } + + let nodeLayout = ListViewItemNodeLayout(contentSize: CGSize(width: params.width, height: verticalInset * 2.0 + titleLayout.size.height + statusHeightComponent), insets: UIEdgeInsets(top: firstWithHeader ? 29.0 : 0.0, left: 0.0, bottom: 0.0, right: 0.0)) let titleFrame: CGRect if statusAttributedString != nil { - titleFrame = CGRect(origin: CGPoint(x: leftInset, y: 6.0), size: titleLayout.size) + titleFrame = CGRect(origin: CGPoint(x: leftInset, y: verticalInset), size: titleLayout.size) } else { - titleFrame = CGRect(origin: CGPoint(x: leftInset, y: 14.0), size: titleLayout.size) + titleFrame = CGRect(origin: CGPoint(x: leftInset, y: floor((nodeLayout.contentSize.height - titleLayout.size.height) / 2.0)), size: titleLayout.size) } let peerRevealOptions: [ItemListRevealOption] @@ -631,14 +638,14 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let textColor: UIColor switch option.type { case .neutral: - color = item.theme.list.itemDisclosureActions.constructive.fillColor - textColor = item.theme.list.itemDisclosureActions.constructive.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.constructive.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.constructive.foregroundColor case .warning: - color = item.theme.list.itemDisclosureActions.warning.fillColor - textColor = item.theme.list.itemDisclosureActions.warning.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.warning.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.warning.foregroundColor case .destructive: - color = item.theme.list.itemDisclosureActions.destructive.fillColor - textColor = item.theme.list.itemDisclosureActions.destructive.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor } mappedOptions.append(ItemListRevealOption(key: index, title: option.title, icon: .none, color: color, textColor: textColor)) index += 1 @@ -669,7 +676,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { } else if peer.isDeleted { overrideImage = .deletedIcon } - strongSelf.avatarNode.setPeer(account: item.account, theme: item.theme, peer: peer, overrideImage: overrideImage, emptyColor: item.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoads) + strongSelf.avatarNode.setPeer(account: item.account, theme: item.presentationData.theme, peer: peer, overrideImage: overrideImage, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoads) } case let .deviceContact(_, contact): let letters: [String] @@ -695,12 +702,12 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { let revealOffset = strongSelf.revealOffset if let _ = updatedTheme { - strongSelf.separatorNode.backgroundColor = item.theme.list.itemPlainSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.plainBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.separatorNode.backgroundColor = item.presentationData.theme.list.itemPlainSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.plainBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } - transition.updateFrame(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 50.0, y: 5.0), size: CGSize(width: 40.0, height: 40.0))) + transition.updateFrame(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 50.0, y: floor((nodeLayout.contentSize.height - 40.0) / 2.0)), size: CGSize(width: 40.0, height: 40.0))) let _ = titleApply() transition.updateFrame(node: strongSelf.titleNode, frame: titleFrame.offsetBy(dx: revealOffset, dy: 0.0)) @@ -709,7 +716,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { strongSelf.statusNode.alpha = item.enabled ? 1.0 : 1.0 let _ = statusApply() - let statusFrame = CGRect(origin: CGPoint(x: revealOffset + leftInset, y: 27.0), size: statusLayout.size) + let statusFrame = CGRect(origin: CGPoint(x: revealOffset + leftInset, y: strongSelf.titleNode.frame.maxY - 1.0), size: statusLayout.size) let previousStatusFrame = strongSelf.statusNode.frame strongSelf.statusNode.frame = statusFrame @@ -826,7 +833,7 @@ public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { strongSelf.updateLayout(size: nodeLayout.contentSize, leftInset: params.leftInset, rightInset: params.rightInset) if item.editing.editable { - strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.strings.Common_Delete, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)])) + strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)])) strongSelf.setRevealOptionsOpened(item.editing.revealed, animated: animated) } else { strongSelf.setRevealOptions((left: [], right: peerRevealOptions)) diff --git a/submodules/DeviceAccess/Sources/DeviceAccess.swift b/submodules/DeviceAccess/Sources/DeviceAccess.swift index 27b198765b..07ead01aa2 100644 --- a/submodules/DeviceAccess/Sources/DeviceAccess.swift +++ b/submodules/DeviceAccess/Sources/DeviceAccess.swift @@ -254,7 +254,7 @@ public final class DeviceAccess { completion(response) if !response, let presentationData = presentationData { let text = presentationData.strings.AccessDenied_Camera - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } @@ -268,7 +268,7 @@ public final class DeviceAccess { text = presentationData.strings.AccessDenied_Camera } completion(false) - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } else if status == PGCameraAuthorizationStatusAuthorized { @@ -296,7 +296,7 @@ public final class DeviceAccess { case .voiceCall: text = presentationData.strings.AccessDenied_CallMicrophone } - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) if case .voiceCall = microphoneSubject { @@ -322,7 +322,7 @@ public final class DeviceAccess { case .wallpaper: text = presentationData.strings.AccessDenied_Wallpapers } - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } @@ -358,7 +358,7 @@ public final class DeviceAccess { completion(false) if let presentationData = presentationData { let text = presentationData.strings.AccessDenied_LocationAlwaysDenied - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } @@ -377,7 +377,7 @@ public final class DeviceAccess { } else { text = presentationData.strings.AccessDenied_LocationDisabled } - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.AccessDenied_Title, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } @@ -450,7 +450,7 @@ public final class DeviceAccess { } case .cellularData: if let presentationData = presentationData { - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.Permissions_CellularDataTitle_v0, text: presentationData.strings.Permissions_CellularDataText_v0, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.Permissions_CellularDataTitle_v0, text: presentationData.strings.Permissions_CellularDataText_v0, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_NotNow, action: {}), TextAlertAction(type: .genericAction, title: presentationData.strings.AccessDenied_Settings, action: { openSettings() })]), nil) } diff --git a/submodules/Display/Display/AlertController.swift b/submodules/Display/Display/AlertController.swift index 870c1a2a14..f60748ddf7 100644 --- a/submodules/Display/Display/AlertController.swift +++ b/submodules/Display/Display/AlertController.swift @@ -17,8 +17,9 @@ public final class AlertControllerTheme: Equatable { public let accentColor: UIColor public let destructiveColor: UIColor public let disabledColor: UIColor + public let baseFontSize: CGFloat - public init(backgroundType: ActionSheetControllerThemeBackgroundType, backgroundColor: UIColor, separatorColor: UIColor, highlightedItemColor: UIColor, primaryColor: UIColor, secondaryColor: UIColor, accentColor: UIColor, destructiveColor: UIColor, disabledColor: UIColor) { + public init(backgroundType: ActionSheetControllerThemeBackgroundType, backgroundColor: UIColor, separatorColor: UIColor, highlightedItemColor: UIColor, primaryColor: UIColor, secondaryColor: UIColor, accentColor: UIColor, destructiveColor: UIColor, disabledColor: UIColor, baseFontSize: CGFloat) { self.backgroundType = backgroundType self.backgroundColor = backgroundColor self.separatorColor = separatorColor @@ -28,6 +29,7 @@ public final class AlertControllerTheme: Equatable { self.accentColor = accentColor self.destructiveColor = destructiveColor self.disabledColor = disabledColor + self.baseFontSize = baseFontSize } public static func ==(lhs: AlertControllerTheme, rhs: AlertControllerTheme) -> Bool { @@ -58,6 +60,9 @@ public final class AlertControllerTheme: Equatable { if lhs.disabledColor != rhs.disabledColor { return false } + if lhs.baseFontSize != rhs.baseFontSize { + return false + } return true } } diff --git a/submodules/Display/Display/TextAlertController.swift b/submodules/Display/Display/TextAlertController.swift index 6590697d5c..c6369e1d7b 100644 --- a/submodules/Display/Display/TextAlertController.swift +++ b/submodules/Display/Display/TextAlertController.swift @@ -73,7 +73,7 @@ public final class TextAlertContentActionNode: HighlightableButtonNode { } private func updateTitle() { - var font = Font.regular(17.0) + var font = Font.regular(theme.baseFontSize) var color: UIColor switch self.action.type { case .defaultAction, .genericAction: @@ -83,7 +83,7 @@ public final class TextAlertContentActionNode: HighlightableButtonNode { } switch self.action.type { case .defaultAction: - font = Font.semibold(17.0) + font = Font.semibold(theme.baseFontSize) case .destructiveAction, .genericAction: break } @@ -360,15 +360,15 @@ public func standardTextAlertController(theme: AlertControllerTheme, title: Stri var dismissImpl: (() -> Void)? let attributedText: NSAttributedString if parseMarkdown { - let font = title == nil ? Font.semibold(17.0) : Font.regular(13.0) - let boldFont = title == nil ? Font.bold(17.0) : Font.semibold(13.0) + let font = title == nil ? Font.semibold(theme.baseFontSize) : Font.regular(floor(theme.baseFontSize * 13.0 / 17.0)) + let boldFont = title == nil ? Font.bold(theme.baseFontSize) : Font.semibold(floor(theme.baseFontSize * 13.0 / 17.0)) let body = MarkdownAttributeSet(font: font, textColor: theme.primaryColor) let bold = MarkdownAttributeSet(font: boldFont, textColor: theme.primaryColor) attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: body, bold: bold, link: body, linkAttribute: { _ in nil }), textAlignment: .center) } else { - attributedText = NSAttributedString(string: text, font: title == nil ? Font.semibold(17.0) : Font.regular(13.0), textColor: theme.primaryColor, paragraphAlignment: .center) + attributedText = NSAttributedString(string: text, font: title == nil ? Font.semibold(theme.baseFontSize) : Font.regular(floor(theme.baseFontSize * 13.0 / 17.0)), textColor: theme.primaryColor, paragraphAlignment: .center) } - let controller = AlertController(theme: theme, contentNode: TextAlertContentNode(theme: theme, title: title != nil ? NSAttributedString(string: title!, font: Font.semibold(17.0), textColor: theme.primaryColor, paragraphAlignment: .center) : nil, text: attributedText, actions: actions.map { action in + let controller = AlertController(theme: theme, contentNode: TextAlertContentNode(theme: theme, title: title != nil ? NSAttributedString(string: title!, font: Font.semibold(theme.baseFontSize), textColor: theme.primaryColor, paragraphAlignment: .center) : nil, text: attributedText, actions: actions.map { action in return TextAlertAction(type: action.type, title: action.title, action: { dismissImpl?() action.action() diff --git a/submodules/Display/Display/TextNode.swift b/submodules/Display/Display/TextNode.swift index 718b750e72..3edfa6c4b3 100644 --- a/submodules/Display/Display/TextNode.swift +++ b/submodules/Display/Display/TextNode.swift @@ -85,6 +85,7 @@ private func displayLineFrame(frame: CGRect, isRTL: Bool, boundingRect: CGRect, public final class TextNodeLayoutArguments { public let attributedString: NSAttributedString? public let backgroundColor: UIColor? + public let minimumNumberOfLines: Int public let maximumNumberOfLines: Int public let truncationType: CTLineTruncationType public let constrainedSize: CGSize @@ -95,9 +96,10 @@ public final class TextNodeLayoutArguments { public let lineColor: UIColor? public let textShadowColor: UIColor? - public init(attributedString: NSAttributedString?, backgroundColor: UIColor? = nil, maximumNumberOfLines: Int, truncationType: CTLineTruncationType, constrainedSize: CGSize, alignment: NSTextAlignment = .natural, lineSpacing: CGFloat = 0.12, cutout: TextNodeCutout? = nil, insets: UIEdgeInsets = UIEdgeInsets(), lineColor: UIColor? = nil, textShadowColor: UIColor? = nil) { + public init(attributedString: NSAttributedString?, backgroundColor: UIColor? = nil, minimumNumberOfLines: Int = 0, maximumNumberOfLines: Int, truncationType: CTLineTruncationType, constrainedSize: CGSize, alignment: NSTextAlignment = .natural, lineSpacing: CGFloat = 0.12, cutout: TextNodeCutout? = nil, insets: UIEdgeInsets = UIEdgeInsets(), lineColor: UIColor? = nil, textShadowColor: UIColor? = nil) { self.attributedString = attributedString self.backgroundColor = backgroundColor + self.minimumNumberOfLines = minimumNumberOfLines self.maximumNumberOfLines = maximumNumberOfLines self.truncationType = truncationType self.constrainedSize = constrainedSize @@ -778,7 +780,7 @@ public class TextNode: ASDisplayNode { } } - private class func calculateLayout(attributedString: NSAttributedString?, maximumNumberOfLines: Int, truncationType: CTLineTruncationType, backgroundColor: UIColor?, constrainedSize: CGSize, alignment: NSTextAlignment, lineSpacingFactor: CGFloat, cutout: TextNodeCutout?, insets: UIEdgeInsets, lineColor: UIColor?, textShadowColor: UIColor?) -> TextNodeLayout { + private class func calculateLayout(attributedString: NSAttributedString?, minimumNumberOfLines: Int, maximumNumberOfLines: Int, truncationType: CTLineTruncationType, backgroundColor: UIColor?, constrainedSize: CGSize, alignment: NSTextAlignment, lineSpacingFactor: CGFloat, cutout: TextNodeCutout?, insets: UIEdgeInsets, lineColor: UIColor?, textShadowColor: UIColor?) -> TextNodeLayout { if let attributedString = attributedString { let stringLength = attributedString.length @@ -997,6 +999,17 @@ public class TextNode: ASDisplayNode { } } + if lines.count < minimumNumberOfLines { + var lineCount = lines.count + while lineCount < minimumNumberOfLines { + if lineCount != 0 { + layoutSize.height += fontLineSpacing + } + layoutSize.height += fontLineHeight + lineCount += 1 + } + } + return TextNodeLayout(attributedString: attributedString, maximumNumberOfLines: maximumNumberOfLines, truncationType: truncationType, constrainedSize: constrainedSize, alignment: alignment, lineSpacing: lineSpacingFactor, cutout: cutout, insets: insets, size: CGSize(width: ceil(layoutSize.width) + insets.left + insets.right, height: ceil(layoutSize.height) + insets.top + insets.bottom), rawTextSize: CGSize(width: ceil(rawLayoutSize.width) + insets.left + insets.right, height: ceil(rawLayoutSize.height) + insets.top + insets.bottom), truncated: truncated, firstLineOffset: firstLineOffset, lines: lines, blockQuotes: blockQuotes, backgroundColor: backgroundColor, lineColor: lineColor, textShadowColor: textShadowColor) } else { return TextNodeLayout(attributedString: attributedString, maximumNumberOfLines: maximumNumberOfLines, truncationType: truncationType, constrainedSize: constrainedSize, alignment: alignment, lineSpacing: lineSpacingFactor, cutout: cutout, insets: insets, size: CGSize(), rawTextSize: CGSize(), truncated: false, firstLineOffset: 0.0, lines: [], blockQuotes: [], backgroundColor: backgroundColor, lineColor: lineColor, textShadowColor: textShadowColor) @@ -1143,11 +1156,11 @@ public class TextNode: ASDisplayNode { if stringMatch { layout = existingLayout } else { - layout = TextNode.calculateLayout(attributedString: arguments.attributedString, maximumNumberOfLines: arguments.maximumNumberOfLines, truncationType: arguments.truncationType, backgroundColor: arguments.backgroundColor, constrainedSize: arguments.constrainedSize, alignment: arguments.alignment, lineSpacingFactor: arguments.lineSpacing, cutout: arguments.cutout, insets: arguments.insets, lineColor: arguments.lineColor, textShadowColor: arguments.textShadowColor) + layout = TextNode.calculateLayout(attributedString: arguments.attributedString, minimumNumberOfLines: arguments.minimumNumberOfLines, maximumNumberOfLines: arguments.maximumNumberOfLines, truncationType: arguments.truncationType, backgroundColor: arguments.backgroundColor, constrainedSize: arguments.constrainedSize, alignment: arguments.alignment, lineSpacingFactor: arguments.lineSpacing, cutout: arguments.cutout, insets: arguments.insets, lineColor: arguments.lineColor, textShadowColor: arguments.textShadowColor) updated = true } } else { - layout = TextNode.calculateLayout(attributedString: arguments.attributedString, maximumNumberOfLines: arguments.maximumNumberOfLines, truncationType: arguments.truncationType, backgroundColor: arguments.backgroundColor, constrainedSize: arguments.constrainedSize, alignment: arguments.alignment, lineSpacingFactor: arguments.lineSpacing, cutout: arguments.cutout, insets: arguments.insets, lineColor: arguments.lineColor, textShadowColor: arguments.textShadowColor) + layout = TextNode.calculateLayout(attributedString: arguments.attributedString, minimumNumberOfLines: arguments.minimumNumberOfLines, maximumNumberOfLines: arguments.maximumNumberOfLines, truncationType: arguments.truncationType, backgroundColor: arguments.backgroundColor, constrainedSize: arguments.constrainedSize, alignment: arguments.alignment, lineSpacingFactor: arguments.lineSpacing, cutout: arguments.cutout, insets: arguments.insets, lineColor: arguments.lineColor, textShadowColor: arguments.textShadowColor) updated = true } diff --git a/submodules/HashtagSearchUI/Sources/HashtagSearchController.swift b/submodules/HashtagSearchUI/Sources/HashtagSearchController.swift index b353e21f39..5138d94415 100644 --- a/submodules/HashtagSearchUI/Sources/HashtagSearchController.swift +++ b/submodules/HashtagSearchUI/Sources/HashtagSearchController.swift @@ -39,7 +39,7 @@ public final class HashtagSearchController: TelegramBaseController { self.title = query self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Back, style: .plain, target: nil, action: nil) - let chatListPresentationData = ChatListPresentationData(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) + let chatListPresentationData = ChatListPresentationData(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) let location: SearchMessagesLocation = .general let search = searchMessages(account: context.account, location: location, query: query, state: nil) @@ -79,7 +79,7 @@ public final class HashtagSearchController: TelegramBaseController { let previousEntries = previousSearchItems.swap(entries) let firstTime = previousEntries == nil - let transition = chatListSearchContainerPreparedTransition(from: previousEntries ?? [], to: entries, displayingResults: true, context: strongSelf.context, enableHeaders: false, filter: [], interaction: interaction, peerContextAction: nil) + let transition = chatListSearchContainerPreparedTransition(from: previousEntries ?? [], to: entries, displayingResults: true, context: strongSelf.context, presentationData: strongSelf.presentationData, enableHeaders: false, filter: [], interaction: interaction, peerContextAction: nil) strongSelf.controllerNode.enqueueTransition(transition, firstTime: firstTime) } }) diff --git a/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift b/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift index 843d576668..e8a87aff3b 100644 --- a/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift +++ b/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift @@ -139,8 +139,7 @@ public enum ItemListAvatarAndNameInfoItemMode { public class ItemListAvatarAndNameInfoItem: ListViewItem, ItemListItem { let account: Account - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let dateTimeFormat: PresentationDateTimeFormat let mode: ItemListAvatarAndNameInfoItemMode let peer: Peer? @@ -162,10 +161,9 @@ public class ItemListAvatarAndNameInfoItem: ListViewItem, ItemListItem { public let selectable: Bool - public init(account: Account, theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, mode: ItemListAvatarAndNameInfoItemMode, peer: Peer?, presence: PeerPresence?, label: String? = nil, cachedData: CachedPeerData?, state: ItemListAvatarAndNameInfoItemState, sectionId: ItemListSectionId, style: ItemListAvatarAndNameInfoItemStyle, editingNameUpdated: @escaping (ItemListAvatarAndNameInfoItemName) -> Void, editingNameCompleted: @escaping () -> Void = {}, avatarTapped: @escaping () -> Void, context: ItemListAvatarAndNameInfoItemContext? = nil, updatingImage: ItemListAvatarAndNameInfoItemUpdatingAvatar? = nil, call: (() -> Void)? = nil, action: (() -> Void)? = nil, longTapAction: (() -> Void)? = nil, tag: ItemListItemTag? = nil) { + public init(account: Account, presentationData: ItemListPresentationData, dateTimeFormat: PresentationDateTimeFormat, mode: ItemListAvatarAndNameInfoItemMode, peer: Peer?, presence: PeerPresence?, label: String? = nil, cachedData: CachedPeerData?, state: ItemListAvatarAndNameInfoItemState, sectionId: ItemListSectionId, style: ItemListAvatarAndNameInfoItemStyle, editingNameUpdated: @escaping (ItemListAvatarAndNameInfoItemName) -> Void, editingNameCompleted: @escaping () -> Void = {}, avatarTapped: @escaping () -> Void, context: ItemListAvatarAndNameInfoItemContext? = nil, updatingImage: ItemListAvatarAndNameInfoItemUpdatingAvatar? = nil, call: (() -> Void)? = nil, action: (() -> Void)? = nil, longTapAction: (() -> Void)? = nil, tag: ItemListItemTag? = nil) { self.account = account - self.theme = theme - self.strings = strings + self.presentationData = presentationData self.dateTimeFormat = dateTimeFormat self.mode = mode self.peer = peer @@ -234,8 +232,6 @@ public class ItemListAvatarAndNameInfoItem: ListViewItem, ItemListItem { } private let avatarFont = avatarPlaceholderFont(size: 28.0) -private let nameFont = Font.medium(19.0) -private let statusFont = Font.regular(15.0) public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNode, ItemListItemFocusableNode, UITextFieldDelegate { private let backgroundNode: ASDisplayNode @@ -362,20 +358,23 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo return { item, params, neighbors in let baseWidth = params.width - params.leftInset - params.rightInset + let nameFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 19.0 / 17.0)) + let statusFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } var credibilityIconImage: UIImage? var credibilityIconOffset: CGFloat = 4.0 if let peer = item.peer { if peer.isScam { - credibilityIconImage = PresentationResourcesChatList.scamIcon(item.theme, type: .regular) + credibilityIconImage = PresentationResourcesChatList.scamIcon(item.presentationData.theme, type: .regular) credibilityIconOffset = 6.0 } else if peer.isVerified { - credibilityIconImage = PresentationResourcesItemList.verifiedPeerIcon(item.theme) + credibilityIconImage = PresentationResourcesItemList.verifiedPeerIcon(item.presentationData.theme) } } @@ -398,7 +397,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo nameMaximumNumberOfLines = 2 } - let (nameNodeLayout, nameNodeApply) = layoutNameNode(TextNodeLayoutArguments(attributedString: NSAttributedString(string: displayTitle.composedDisplayTitle(strings: item.strings), font: nameFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: nameMaximumNumberOfLines, truncationType: .end, constrainedSize: CGSize(width: baseWidth - 20 - 94.0 - (item.call != nil ? 36.0 : 0.0) - additionalTitleInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (nameNodeLayout, nameNodeApply) = layoutNameNode(TextNodeLayoutArguments(attributedString: NSAttributedString(string: displayTitle.composedDisplayTitle(strings: item.presentationData.strings), font: nameFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: nameMaximumNumberOfLines, truncationType: .end, constrainedSize: CGSize(width: baseWidth - 20 - 94.0 - (item.call != nil ? 36.0 : 0.0) - additionalTitleInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) var statusText: String = "" let statusColor: UIColor @@ -415,64 +414,64 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo } statusText += "@\(username)" } - statusColor = item.theme.list.itemSecondaryTextColor + statusColor = item.presentationData.theme.list.itemSecondaryTextColor case .generic, .contact, .editSettings: if let label = item.label { statusText = label - statusColor = item.theme.list.itemSecondaryTextColor + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } else if peer.flags.contains(.isSupport), !servicePeer { - statusText = item.strings.Bot_GenericSupportStatus - statusColor = item.theme.list.itemSecondaryTextColor + statusText = item.presentationData.strings.Bot_GenericSupportStatus + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } else if let _ = peer.botInfo { - statusText = item.strings.Bot_GenericBotStatus - statusColor = item.theme.list.itemSecondaryTextColor + statusText = item.presentationData.strings.Bot_GenericBotStatus + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } else if case .generic = item.mode, !servicePeer { let presence = (item.presence as? TelegramUserPresence) ?? TelegramUserPresence(status: .none, lastActivity: 0) let timestamp = CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 - let (string, activity) = stringAndActivityForUserPresence(strings: item.strings, dateTimeFormat: item.dateTimeFormat, presence: presence, relativeTo: Int32(timestamp), expanded: true) + let (string, activity) = stringAndActivityForUserPresence(strings: item.presentationData.strings, dateTimeFormat: item.dateTimeFormat, presence: presence, relativeTo: Int32(timestamp), expanded: true) statusText = string if activity { - statusColor = item.theme.list.itemAccentColor + statusColor = item.presentationData.theme.list.itemAccentColor } else { - statusColor = item.theme.list.itemSecondaryTextColor + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } } else { statusText = "" - statusColor = item.theme.list.itemPrimaryTextColor + statusColor = item.presentationData.theme.list.itemPrimaryTextColor } } } else if let channel = item.peer as? TelegramChannel { if let cachedChannelData = item.cachedData as? CachedChannelData, let memberCount = cachedChannelData.participantsSummary.memberCount { if case .group = channel.info { if memberCount == 0 { - statusText = item.strings.Group_Status + statusText = item.presentationData.strings.Group_Status } else { - statusText = item.strings.Conversation_StatusMembers(memberCount) + statusText = item.presentationData.strings.Conversation_StatusMembers(memberCount) } } else { if memberCount == 0 { - statusText = item.strings.Channel_Status + statusText = item.presentationData.strings.Channel_Status } else { - statusText = item.strings.Conversation_StatusSubscribers(memberCount) + statusText = item.presentationData.strings.Conversation_StatusSubscribers(memberCount) } } - statusColor = item.theme.list.itemSecondaryTextColor + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } else { switch channel.info { case .broadcast: - statusText = item.strings.Channel_Status - statusColor = item.theme.list.itemSecondaryTextColor + statusText = item.presentationData.strings.Channel_Status + statusColor = item.presentationData.theme.list.itemSecondaryTextColor case .group: - statusText = item.strings.Group_Status - statusColor = item.theme.list.itemSecondaryTextColor + statusText = item.presentationData.strings.Group_Status + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } } } else if let group = item.peer as? TelegramGroup { - statusText = item.strings.GroupInfo_ParticipantCount(Int32(group.participantCount)) - statusColor = item.theme.list.itemSecondaryTextColor + statusText = item.presentationData.strings.GroupInfo_ParticipantCount(Int32(group.participantCount)) + statusColor = item.presentationData.theme.list.itemSecondaryTextColor } else { statusText = "" - statusColor = item.theme.list.itemPrimaryTextColor + statusColor = item.presentationData.theme.list.itemPrimaryTextColor } var availableStatusWidth = baseWidth - 20 @@ -484,36 +483,42 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo let separatorHeight = UIScreenPixel + let nameSpacing: CGFloat = 3.0 + let hasCorners = itemListHasRoundedBlockLayout(params) let contentSize: CGSize var insets: UIEdgeInsets let itemBackgroundColor: UIColor let itemSeparatorColor: UIColor switch item.style { - case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor - contentSize = CGSize(width: params.width, height: 96.0) - insets = itemListNeighborsPlainInsets(neighbors) - case let .blocks(withTopInset, withExtendedBottomInset): - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor - contentSize = CGSize(width: params.width, height: 92.0) - if withTopInset || hasCorners { - insets = itemListNeighborsGroupedInsets(neighbors) - } else { - let topInset: CGFloat - switch neighbors.top { - case .sameSection, .none: - topInset = 0.0 - case .otherSection: - topInset = separatorHeight + 35.0 - } - insets = UIEdgeInsets(top: topInset, left: 0.0, bottom: separatorHeight, right: 0.0) - if withExtendedBottomInset { - insets.bottom += 12.0 - } + case .plain: + let verticalInset: CGFloat = 15.0 + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor + let baseHeight = nameNodeLayout.size.height + nameSpacing + statusNodeLayout.size.height + 40.0 + contentSize = CGSize(width: params.width, height: max(baseHeight, verticalInset * 2.0 + 66.0)) + insets = itemListNeighborsPlainInsets(neighbors) + case let .blocks(withTopInset, withExtendedBottomInset): + let verticalInset: CGFloat = 13.0 + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor + let baseHeight = nameNodeLayout.size.height + nameSpacing + statusNodeLayout.size.height + 30.0 + contentSize = CGSize(width: params.width, height: max(baseHeight, verticalInset * 2.0 + 66.0)) + if withTopInset || hasCorners { + insets = itemListNeighborsGroupedInsets(neighbors) + } else { + let topInset: CGFloat + switch neighbors.top { + case .sameSection, .none: + topInset = 0.0 + case .otherSection: + topInset = separatorHeight + 35.0 } + insets = UIEdgeInsets(top: topInset, left: 0.0, bottom: separatorHeight, right: 0.0) + if withExtendedBottomInset { + insets.bottom += 12.0 + } + } } var updateAvatarOverlayImage: UIImage? @@ -538,15 +543,15 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.topStripeNode.backgroundColor = itemSeparatorColor strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor strongSelf.inputSeparator?.backgroundColor = itemSeparatorColor - strongSelf.callButton.setImage(PresentationResourcesChat.chatInfoCallButtonImage(item.theme), for: []) + strongSelf.callButton.setImage(PresentationResourcesChat.chatInfoCallButtonImage(item.presentationData.theme), for: []) - strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.theme.list.inputClearButtonColor), for: []) - strongSelf.inputSecondClearButton?.setImage(generateClearIcon(color: item.theme.list.inputClearButtonColor), for: []) + strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.presentationData.theme.list.inputClearButtonColor), for: []) + strongSelf.inputSecondClearButton?.setImage(generateClearIcon(color: item.presentationData.theme.list.inputClearButtonColor), for: []) - updatedArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.theme) + updatedArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.presentationData.theme) } if item.updatingImage != nil { @@ -584,11 +589,8 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.callButton.removeFromSupernode() } - let avatarOriginY: CGFloat switch item.style { case .plain: - avatarOriginY = 15.0 - if strongSelf.backgroundNode.supernode != nil { strongSelf.backgroundNode.removeFromSupernode() } @@ -602,8 +604,6 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.maskNode.removeFromSupernode() } case .blocks: - avatarOriginY = 13.0 - if strongSelf.backgroundNode.supernode == nil { strongSelf.insertSubnode(strongSelf.backgroundNode, at: 0) } @@ -637,7 +637,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: params.width, height: contentSize.height)) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -668,10 +668,10 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo overrideImage = .deletedIcon } - strongSelf.avatarNode.setPeer(account: item.account, theme: item.theme, peer: peer, overrideImage: overrideImage, emptyColor: ignoreEmpty ? nil : item.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoads) + strongSelf.avatarNode.setPeer(account: item.account, theme: item.presentationData.theme, peer: peer, overrideImage: overrideImage, emptyColor: ignoreEmpty ? nil : item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoads) } - let avatarFrame = CGRect(origin: CGPoint(x: params.leftInset + 15.0, y: avatarOriginY), size: CGSize(width: 66.0, height: 66.0)) + let avatarFrame = CGRect(origin: CGPoint(x: params.leftInset + 15.0, y: floor((layout.contentSize.height - 66.0) / 2.0)), size: CGSize(width: 66.0, height: 66.0)) strongSelf.avatarNode.frame = avatarFrame strongSelf.updatingAvatarOverlay.frame = avatarFrame @@ -711,7 +711,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo if strongSelf.inputSeparator == nil { animateIn = true } - let keyboardAppearance = item.theme.rootController.keyboardColor.keyboardAppearance + let keyboardAppearance = item.presentationData.theme.rootController.keyboardColor.keyboardAppearance switch editingName { case let .personName(firstName, lastName, _): if strongSelf.inputSeparator == nil { @@ -725,10 +725,10 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo if strongSelf.inputFirstField == nil { let inputFirstField = TextFieldNodeView() inputFirstField.delegate = self - inputFirstField.font = Font.regular(17.0) + inputFirstField.font = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) inputFirstField.autocorrectionType = .no inputFirstField.returnKeyType = .next - inputFirstField.attributedText = NSAttributedString(string: firstName, font: Font.regular(17.0), textColor: item.theme.list.itemPrimaryTextColor) + inputFirstField.attributedText = NSAttributedString(string: firstName, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPrimaryTextColor) strongSelf.inputFirstField = inputFirstField strongSelf.view.addSubview(inputFirstField) inputFirstField.addTarget(self, action: #selector(strongSelf.textFieldDidChange(_:)), for: .editingChanged) @@ -736,8 +736,8 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.inputFirstField?.text = firstName } - strongSelf.inputFirstField?.textColor = item.theme.list.itemPrimaryTextColor - strongSelf.inputFirstField?.attributedPlaceholder = NSAttributedString(string: item.strings.UserInfo_FirstNamePlaceholder, font: Font.regular(17.0), textColor: item.theme.list.itemPlaceholderTextColor) + strongSelf.inputFirstField?.textColor = item.presentationData.theme.list.itemPrimaryTextColor + strongSelf.inputFirstField?.attributedPlaceholder = NSAttributedString(string: item.presentationData.strings.UserInfo_FirstNamePlaceholder, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPlaceholderTextColor) if strongSelf.inputFirstField?.keyboardAppearance != keyboardAppearance { strongSelf.inputFirstField?.keyboardAppearance = keyboardAppearance } @@ -747,7 +747,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.inputFirstClearButton?.imageNode.displaysAsynchronously = false strongSelf.inputFirstClearButton?.imageNode.displayWithoutProcessing = true strongSelf.inputFirstClearButton?.displaysAsynchronously = false - strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.theme.list.inputClearButtonColor), for: []) + strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.presentationData.theme.list.inputClearButtonColor), for: []) strongSelf.inputFirstClearButton?.addTarget(strongSelf, action: #selector(strongSelf.firstClearPressed), forControlEvents: .touchUpInside) strongSelf.inputFirstClearButton?.isHidden = true strongSelf.addSubnode(strongSelf.inputFirstClearButton!) @@ -756,10 +756,10 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo if strongSelf.inputSecondField == nil { let inputSecondField = TextFieldNodeView() inputSecondField.delegate = self - inputSecondField.font = Font.regular(17.0) + inputSecondField.font = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) inputSecondField.autocorrectionType = .no inputSecondField.returnKeyType = .done - inputSecondField.attributedText = NSAttributedString(string: lastName, font: Font.regular(17.0), textColor: item.theme.list.itemPrimaryTextColor) + inputSecondField.attributedText = NSAttributedString(string: lastName, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPrimaryTextColor) strongSelf.inputSecondField = inputSecondField strongSelf.view.addSubview(inputSecondField) inputSecondField.addTarget(self, action: #selector(strongSelf.textFieldDidChange(_:)), for: .editingChanged) @@ -767,8 +767,8 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.inputSecondField?.text = lastName } - strongSelf.inputSecondField?.textColor = item.theme.list.itemPrimaryTextColor - strongSelf.inputSecondField?.attributedPlaceholder = NSAttributedString(string: item.strings.UserInfo_LastNamePlaceholder, font: Font.regular(17.0), textColor: item.theme.list.itemPlaceholderTextColor) + strongSelf.inputSecondField?.textColor = item.presentationData.theme.list.itemPrimaryTextColor + strongSelf.inputSecondField?.attributedPlaceholder = NSAttributedString(string: item.presentationData.strings.UserInfo_LastNamePlaceholder, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPlaceholderTextColor) if strongSelf.inputSecondField?.keyboardAppearance != keyboardAppearance { strongSelf.inputSecondField?.keyboardAppearance = keyboardAppearance } @@ -778,7 +778,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.inputSecondClearButton?.imageNode.displaysAsynchronously = false strongSelf.inputSecondClearButton?.imageNode.displayWithoutProcessing = true strongSelf.inputSecondClearButton?.displaysAsynchronously = false - strongSelf.inputSecondClearButton?.setImage(generateClearIcon(color: item.theme.list.inputClearButtonColor), for: []) + strongSelf.inputSecondClearButton?.setImage(generateClearIcon(color: item.presentationData.theme.list.inputClearButtonColor), for: []) strongSelf.inputSecondClearButton?.addTarget(strongSelf, action: #selector(strongSelf.secondClearPressed), forControlEvents: .touchUpInside) strongSelf.inputSecondClearButton?.isHidden = true strongSelf.addSubnode(strongSelf.inputSecondClearButton!) @@ -812,24 +812,24 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo if strongSelf.inputFirstField == nil { let inputFirstField = TextFieldNodeView() inputFirstField.delegate = self - inputFirstField.font = Font.regular(19.0) + inputFirstField.font = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 19.0 / 17.0)) inputFirstField.autocorrectionType = .no - inputFirstField.attributedText = NSAttributedString(string: title, font: Font.regular(19.0), textColor: item.theme.list.itemPrimaryTextColor) + inputFirstField.attributedText = NSAttributedString(string: title, font: Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 19.0 / 17.0)), textColor: item.presentationData.theme.list.itemPrimaryTextColor) strongSelf.inputFirstField = inputFirstField strongSelf.view.addSubview(inputFirstField) inputFirstField.addTarget(self, action: #selector(strongSelf.textFieldDidChange(_:)), for: .editingChanged) } else if strongSelf.inputFirstField?.text != title { strongSelf.inputFirstField?.text = title } - strongSelf.inputFirstField?.textColor = item.theme.list.itemPrimaryTextColor + strongSelf.inputFirstField?.textColor = item.presentationData.theme.list.itemPrimaryTextColor let placeholder: String switch type { case .group: - placeholder = item.strings.GroupInfo_GroupNamePlaceholder + placeholder = item.presentationData.strings.GroupInfo_GroupNamePlaceholder case .channel: - placeholder = item.strings.GroupInfo_ChannelListNamePlaceholder + placeholder = item.presentationData.strings.GroupInfo_ChannelListNamePlaceholder } - strongSelf.inputFirstField?.attributedPlaceholder = NSAttributedString(string: placeholder, font: Font.regular(19.0), textColor: item.theme.list.itemPlaceholderTextColor) + strongSelf.inputFirstField?.attributedPlaceholder = NSAttributedString(string: placeholder, font: Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 19.0 / 17.0)), textColor: item.presentationData.theme.list.itemPlaceholderTextColor) if strongSelf.inputFirstField?.keyboardAppearance != keyboardAppearance { strongSelf.inputFirstField?.keyboardAppearance = keyboardAppearance } @@ -839,7 +839,7 @@ public class ItemListAvatarAndNameInfoItemNode: ListViewItemNode, ItemListItemNo strongSelf.inputFirstClearButton?.imageNode.displaysAsynchronously = false strongSelf.inputFirstClearButton?.imageNode.displayWithoutProcessing = true strongSelf.inputFirstClearButton?.displaysAsynchronously = false - strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.theme.list.inputClearButtonColor), for: []) + strongSelf.inputFirstClearButton?.setImage(generateClearIcon(color: item.presentationData.theme.list.inputClearButtonColor), for: []) strongSelf.inputFirstClearButton?.addTarget(strongSelf, action: #selector(strongSelf.firstClearPressed), forControlEvents: .touchUpInside) strongSelf.inputFirstClearButton?.isHidden = true strongSelf.addSubnode(strongSelf.inputFirstClearButton!) diff --git a/submodules/ItemListPeerActionItem/Sources/ItemListPeerActionItem.swift b/submodules/ItemListPeerActionItem/Sources/ItemListPeerActionItem.swift index 96ccdaf7dd..91e9fdf027 100644 --- a/submodules/ItemListPeerActionItem/Sources/ItemListPeerActionItem.swift +++ b/submodules/ItemListPeerActionItem/Sources/ItemListPeerActionItem.swift @@ -13,7 +13,7 @@ public enum ItemListPeerActionItemHeight { } public class ItemListPeerActionItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let icon: UIImage? let title: String public let alwaysPlain: Bool @@ -22,8 +22,8 @@ public class ItemListPeerActionItem: ListViewItem, ItemListItem { public let sectionId: ItemListSectionId let action: () -> Void - public init(theme: PresentationTheme, icon: UIImage?, title: String, alwaysPlain: Bool = false, sectionId: ItemListSectionId, height: ItemListPeerActionItemHeight = .peerList, editing: Bool, action: @escaping () -> Void) { - self.theme = theme + public init(presentationData: ItemListPresentationData, icon: UIImage?, title: String, alwaysPlain: Bool = false, sectionId: ItemListSectionId, height: ItemListPeerActionItemHeight = .peerList, editing: Bool, action: @escaping () -> Void) { + self.presentationData = presentationData self.icon = icon self.title = title self.alwaysPlain = alwaysPlain @@ -87,8 +87,6 @@ public class ItemListPeerActionItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - class ItemListPeerActionItemNode: ListViewItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -146,31 +144,33 @@ class ItemListPeerActionItemNode: ListViewItemNode { return { item, params, neighbors in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } let leftInset: CGFloat - let height: CGFloat + let vertcalInset: CGFloat let verticalOffset: CGFloat switch item.height { case .generic: - height = 44.0 - verticalOffset = -3.0 + vertcalInset = 11.0 + verticalOffset = 0.0 leftInset = 59.0 + params.leftInset case .peerList: - height = 50.0 + vertcalInset = 14.0 verticalOffset = 0.0 leftInset = 65.0 + params.leftInset } let editingOffset: CGFloat = (item.editing ? 38.0 : 0.0) - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemAccentColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - editingOffset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemAccentColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - editingOffset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let separatorHeight = UIScreenPixel let insets = itemListNeighborsGroupedInsets(neighbors) - let contentSize = CGSize(width: params.width, height: height) + let contentSize = CGSize(width: params.width, height: titleLayout.size.height + vertcalInset * 2.0) let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) let layoutSize = layout.size @@ -183,10 +183,10 @@ class ItemListPeerActionItemNode: ListViewItemNode { strongSelf.activateArea.accessibilityLabel = item.title if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() @@ -240,16 +240,16 @@ class ItemListPeerActionItemNode: ListViewItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) strongSelf.topStripeNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: layoutSize.width, height: separatorHeight)) transition.updateFrame(node: strongSelf.bottomStripeNode, frame: CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height + bottomStripeOffset), size: CGSize(width: layoutSize.width - bottomStripeInset, height: separatorHeight))) - transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + editingOffset, y: 14.0 + verticalOffset), size: titleLayout.size)) + transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + editingOffset, y: vertcalInset + verticalOffset), size: titleLayout.size)) - strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: height + UIScreenPixel + UIScreenPixel)) + strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: layout.contentSize.height + UIScreenPixel + UIScreenPixel)) } }) } diff --git a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift index 015efd1e7b..89e2a88d1e 100644 --- a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift +++ b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift @@ -107,8 +107,7 @@ public struct ItemListPeerItemRevealOptions { } public final class ItemListPeerItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let dateTimeFormat: PresentationDateTimeFormat let nameDisplayOrder: PresentationPersonNameOrder let account: Account @@ -136,9 +135,8 @@ public final class ItemListPeerItem: ListViewItem, ItemListItem { let noInsets: Bool public let tag: ItemListItemTag? - public init(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, account: Account, peer: Peer, height: ItemListPeerItemHeight = .peerList, aliasHandling: ItemListPeerItemAliasHandling = .standard, nameColor: ItemListPeerItemNameColor = .primary, nameStyle: ItemListPeerItemNameStyle = .distinctBold, presence: PeerPresence?, text: ItemListPeerItemText, label: ItemListPeerItemLabel, editing: ItemListPeerItemEditing, revealOptions: ItemListPeerItemRevealOptions? = nil, switchValue: ItemListPeerItemSwitch?, enabled: Bool, selectable: Bool, sectionId: ItemListSectionId, action: (() -> Void)?, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, removePeer: @escaping (PeerId) -> Void, toggleUpdated: ((Bool) -> Void)? = nil, contextAction: ((ASDisplayNode, ContextGesture?) -> Void)? = nil, hasTopStripe: Bool = true, hasTopGroupInset: Bool = true, noInsets: Bool = false, tag: ItemListItemTag? = nil) { - self.theme = theme - self.strings = strings + public init(presentationData: ItemListPresentationData, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, account: Account, peer: Peer, height: ItemListPeerItemHeight = .peerList, aliasHandling: ItemListPeerItemAliasHandling = .standard, nameColor: ItemListPeerItemNameColor = .primary, nameStyle: ItemListPeerItemNameStyle = .distinctBold, presence: PeerPresence?, text: ItemListPeerItemText, label: ItemListPeerItemLabel, editing: ItemListPeerItemEditing, revealOptions: ItemListPeerItemRevealOptions? = nil, switchValue: ItemListPeerItemSwitch?, enabled: Bool, selectable: Bool, sectionId: ItemListSectionId, action: (() -> Void)?, setPeerIdWithRevealedOptions: @escaping (PeerId?, PeerId?) -> Void, removePeer: @escaping (PeerId) -> Void, toggleUpdated: ((Bool) -> Void)? = nil, contextAction: ((ASDisplayNode, ContextGesture?) -> Void)? = nil, hasTopStripe: Bool = true, hasTopGroupInset: Bool = true, noInsets: Bool = false, tag: ItemListItemTag? = nil) { + self.presentationData = presentationData self.dateTimeFormat = dateTimeFormat self.nameDisplayOrder = nameDisplayOrder self.account = account @@ -211,11 +209,6 @@ public final class ItemListPeerItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) -private let titleBoldFont = Font.medium(17.0) -private let statusFont = Font.regular(14.0) -private let labelFont = Font.regular(13.0) -private let labelDisclosureFont = Font.regular(17.0) private let avatarFont = avatarPlaceholderFont(size: 15.0) private let badgeFont = Font.regular(15.0) @@ -344,17 +337,26 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo var updateArrowImage: UIImage? var updatedTheme: PresentationTheme? + let statusFontSize: CGFloat = floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0) + let labelFontSize: CGFloat = floor(item.presentationData.fontSize.itemListBaseFontSize * 13.0 / 17.0) + + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + let titleBoldFont = Font.medium(item.presentationData.fontSize.itemListBaseFontSize) + let statusFont = Font.regular(statusFontSize) + let labelFont = Font.regular(labelFontSize) + let labelDisclosureFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + var updatedLabelBadgeImage: UIImage? var badgeColor: UIColor? if case .badge = item.label { - badgeColor = item.theme.list.itemAccentColor + badgeColor = item.presentationData.theme.list.itemAccentColor } let badgeDiameter: CGFloat = 20.0 - if currentItem?.theme !== item.theme { - updatedTheme = item.theme - updateArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.theme) + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme + updateArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.presentationData.theme) if let badgeColor = badgeColor { updatedLabelBadgeImage = generateStretchableFilledCircleImage(diameter: badgeDiameter, color: badgeColor) } @@ -376,21 +378,21 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo let textColor: UIColor switch option.type { case .neutral: - color = item.theme.list.itemDisclosureActions.constructive.fillColor - textColor = item.theme.list.itemDisclosureActions.constructive.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.constructive.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.constructive.foregroundColor case .warning: - color = item.theme.list.itemDisclosureActions.warning.fillColor - textColor = item.theme.list.itemDisclosureActions.warning.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.warning.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.warning.foregroundColor case .destructive: - color = item.theme.list.itemDisclosureActions.destructive.fillColor - textColor = item.theme.list.itemDisclosureActions.destructive.foregroundColor + color = item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor + textColor = item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor } mappedOptions.append(ItemListRevealOption(key: index, title: option.title, icon: .none, color: color, textColor: textColor)) index += 1 } peerRevealOptions = mappedOptions } else { - peerRevealOptions = [ItemListRevealOption(key: 0, title: item.strings.Common_Delete, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)] + peerRevealOptions = [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)] } } else { peerRevealOptions = [] @@ -402,19 +404,19 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo if let switchValue = item.switchValue { switch switchValue.style { - case .standard: - if currentSwitchNode == nil { - currentSwitchNode = SwitchNode() - } - rightInset += switchSize.width - currentCheckNode = nil - case .check: - checkImage = PresentationResourcesItemList.checkIconImage(item.theme) - if currentCheckNode == nil { - currentCheckNode = ASImageNode() - } - rightInset += 24.0 - currentSwitchNode = nil + case .standard: + if currentSwitchNode == nil { + currentSwitchNode = SwitchNode() + } + rightInset += switchSize.width + currentCheckNode = nil + case .check: + checkImage = PresentationResourcesItemList.checkIconImage(item.presentationData.theme) + if currentCheckNode == nil { + currentCheckNode = ASImageNode() + } + rightInset += 24.0 + currentSwitchNode = nil } } else { currentSwitchNode = nil @@ -423,34 +425,34 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo let titleColor: UIColor switch item.nameColor { - case .primary: - titleColor = item.theme.list.itemPrimaryTextColor - case .secret: - titleColor = item.theme.chatList.secretTitleColor + case .primary: + titleColor = item.presentationData.theme.list.itemPrimaryTextColor + case .secret: + titleColor = item.presentationData.theme.chatList.secretTitleColor } let currentBoldFont: UIFont switch item.nameStyle { - case .distinctBold: - currentBoldFont = titleBoldFont - case .plain: - currentBoldFont = titleFont + case .distinctBold: + currentBoldFont = titleBoldFont + case .plain: + currentBoldFont = titleFont } if item.peer.id == item.account.peerId, case .threatSelfAsSaved = item.aliasHandling { - titleAttributedString = NSAttributedString(string: item.strings.DialogList_SavedMessages, font: currentBoldFont, textColor: titleColor) + titleAttributedString = NSAttributedString(string: item.presentationData.strings.DialogList_SavedMessages, font: currentBoldFont, textColor: titleColor) } else if let user = item.peer as? TelegramUser { if let firstName = user.firstName, let lastName = user.lastName, !firstName.isEmpty, !lastName.isEmpty { let string = NSMutableAttributedString() switch item.nameDisplayOrder { - case .firstLast: - string.append(NSAttributedString(string: firstName, font: titleFont, textColor: titleColor)) - string.append(NSAttributedString(string: " ", font: titleFont, textColor: titleColor)) - string.append(NSAttributedString(string: lastName, font: currentBoldFont, textColor: titleColor)) - case .lastFirst: - string.append(NSAttributedString(string: lastName, font: currentBoldFont, textColor: titleColor)) - string.append(NSAttributedString(string: " ", font: titleFont, textColor: titleColor)) - string.append(NSAttributedString(string: firstName, font: titleFont, textColor: titleColor)) + case .firstLast: + string.append(NSAttributedString(string: firstName, font: titleFont, textColor: titleColor)) + string.append(NSAttributedString(string: " ", font: titleFont, textColor: titleColor)) + string.append(NSAttributedString(string: lastName, font: currentBoldFont, textColor: titleColor)) + case .lastFirst: + string.append(NSAttributedString(string: lastName, font: currentBoldFont, textColor: titleColor)) + string.append(NSAttributedString(string: " ", font: titleFont, textColor: titleColor)) + string.append(NSAttributedString(string: firstName, font: titleFont, textColor: titleColor)) } titleAttributedString = string } else if let firstName = user.firstName, !firstName.isEmpty { @@ -458,7 +460,7 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo } else if let lastName = user.lastName, !lastName.isEmpty { titleAttributedString = NSAttributedString(string: lastName, font: currentBoldFont, textColor: titleColor) } else { - titleAttributedString = NSAttributedString(string: item.strings.User_DeletedAccount, font: currentBoldFont, textColor: titleColor) + titleAttributedString = NSAttributedString(string: item.presentationData.strings.User_DeletedAccount, font: currentBoldFont, textColor: titleColor) } } else if let group = item.peer as? TelegramGroup { titleAttributedString = NSAttributedString(string: group.title, font: currentBoldFont, textColor: titleColor) @@ -467,52 +469,60 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo } switch item.text { - case .presence: - if let user = item.peer as? TelegramUser, let botInfo = user.botInfo { - let botStatus: String - if botInfo.flags.contains(.hasAccessToChatHistory) { - botStatus = item.strings.Bot_GroupStatusReadsHistory - } else { - botStatus = item.strings.Bot_GroupStatusDoesNotReadHistory - } - statusAttributedString = NSAttributedString(string: botStatus, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - } else if let presence = item.presence as? TelegramUserPresence { - let timestamp = CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 - let (string, activity) = stringAndActivityForUserPresence(strings: item.strings, dateTimeFormat: item.dateTimeFormat, presence: presence, relativeTo: Int32(timestamp)) - statusAttributedString = NSAttributedString(string: string, font: statusFont, textColor: activity ? item.theme.list.itemAccentColor : item.theme.list.itemSecondaryTextColor) + case .presence: + if let user = item.peer as? TelegramUser, let botInfo = user.botInfo { + let botStatus: String + if botInfo.flags.contains(.hasAccessToChatHistory) { + botStatus = item.presentationData.strings.Bot_GroupStatusReadsHistory } else { - statusAttributedString = NSAttributedString(string: item.strings.LastSeen_Offline, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + botStatus = item.presentationData.strings.Bot_GroupStatusDoesNotReadHistory } - case let .text(text): - statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) - case .none: - break + statusAttributedString = NSAttributedString(string: botStatus, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + } else if let presence = item.presence as? TelegramUserPresence { + let timestamp = CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 + let (string, activity) = stringAndActivityForUserPresence(strings: item.presentationData.strings, dateTimeFormat: item.dateTimeFormat, presence: presence, relativeTo: Int32(timestamp)) + statusAttributedString = NSAttributedString(string: string, font: statusFont, textColor: activity ? item.presentationData.theme.list.itemAccentColor : item.presentationData.theme.list.itemSecondaryTextColor) + } else { + statusAttributedString = NSAttributedString(string: item.presentationData.strings.LastSeen_Offline, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + } + case let .text(text): + statusAttributedString = NSAttributedString(string: text, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) + case .none: + break } let leftInset: CGFloat - let height: CGFloat + let verticalInset: CGFloat let verticalOffset: CGFloat let avatarSize: CGFloat switch item.height { - case .generic: - height = 44.0 - verticalOffset = -3.0 - avatarSize = 31.0 - leftInset = 59.0 + params.leftInset - case .peerList: - height = 50.0 - verticalOffset = 0.0 - avatarSize = 40.0 - leftInset = 65.0 + params.leftInset + case .generic: + if case .none = item.text { + verticalInset = 11.0 + } else { + verticalInset = 6.0 + } + verticalOffset = 0.0 + avatarSize = 31.0 + leftInset = 59.0 + params.leftInset + case .peerList: + if case .none = item.text { + verticalInset = 14.0 + } else { + verticalInset = 8.0 + } + verticalOffset = 0.0 + avatarSize = 40.0 + leftInset = 65.0 + params.leftInset } - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? let editingOffset: CGFloat if item.editing.editing { - let sizeAndApply = editableControlLayout(50.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.presentationData.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 } else { editingOffset = 0.0 } @@ -530,7 +540,7 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo case let .custom(value): selectedFont = value } - labelAttributedString = NSAttributedString(string: text, font: selectedFont, textColor: item.theme.list.itemSecondaryTextColor) + labelAttributedString = NSAttributedString(string: text, font: selectedFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) labelInset += 15.0 case let .disclosure(text): if let currentLabelArrowNode = currentLabelArrowNode { @@ -540,28 +550,28 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo arrowNode.isLayerBacked = true arrowNode.displayWithoutProcessing = true arrowNode.displaysAsynchronously = false - arrowNode.image = PresentationResourcesItemList.disclosureArrowImage(item.theme) + arrowNode.image = PresentationResourcesItemList.disclosureArrowImage(item.presentationData.theme) updatedLabelArrowNode = arrowNode } labelInset += 40.0 - labelAttributedString = NSAttributedString(string: text, font: labelDisclosureFont, textColor: item.theme.list.itemSecondaryTextColor) + labelAttributedString = NSAttributedString(string: text, font: labelDisclosureFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) case let .badge(text): - labelAttributedString = NSAttributedString(string: text, font: badgeFont, textColor: item.theme.list.itemCheckColors.foregroundColor) + labelAttributedString = NSAttributedString(string: text, font: badgeFont, textColor: item.presentationData.theme.list.itemCheckColors.foregroundColor) labelInset += 15.0 } let (labelLayout, labelApply) = makeLabelLayout(TextNodeLayoutArguments(attributedString: labelAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 16.0 - editingOffset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 12.0 - labelLayout.size.width - editingOffset - rightInset - labelInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - editingOffset - rightInset - labelInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 12.0 - labelLayout.size.width - editingOffset - rightInset - labelLayout.size.width, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - editingOffset - rightInset - labelLayout.size.width, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) var insets = itemListNeighborsGroupedInsets(neighbors) if !item.hasTopGroupInset { switch neighbors.top { - case .none: - insets.top = 0.0 - default: - break + case .none: + insets.top = 0.0 + default: + break } } if item.noInsets { @@ -569,7 +579,12 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo insets.bottom = 0.0 } - let contentSize = CGSize(width: params.width, height: height) + let titleSpacing: CGFloat = 1.0 + + let minHeight: CGFloat = titleLayout.size.height + verticalInset * 2.0 + let rawHeight: CGFloat = verticalInset * 2.0 + titleLayout.size.height + titleSpacing + statusLayout.size.height + + let contentSize = CGSize(width: params.width, height: max(minHeight, rawHeight)) let separatorHeight = UIScreenPixel let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) @@ -578,7 +593,7 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo if !item.enabled { if currentDisabledOverlayNode == nil { currentDisabledOverlayNode = ASDisplayNode() - currentDisabledOverlayNode?.backgroundColor = item.theme.list.itemBlocksBackgroundColor.withAlphaComponent(0.5) + currentDisabledOverlayNode?.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor.withAlphaComponent(0.5) } } else { currentDisabledOverlayNode = nil @@ -607,10 +622,10 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo } if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let revealOffset = strongSelf.revealOffset @@ -640,9 +655,9 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -692,34 +707,34 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo var hasTopCorners = false var hasBottomCorners = false switch neighbors.top { - case .sameSection(false): - strongSelf.topStripeNode.isHidden = true - default: - hasTopCorners = true - strongSelf.topStripeNode.isHidden = hasCorners || !item.hasTopStripe + case .sameSection(false): + strongSelf.topStripeNode.isHidden = true + default: + hasTopCorners = true + strongSelf.topStripeNode.isHidden = hasCorners || !item.hasTopStripe } let bottomStripeInset: CGFloat let bottomStripeOffset: CGFloat switch neighbors.bottom { - case .sameSection(false): - bottomStripeInset = leftInset + editingOffset - bottomStripeOffset = -separatorHeight - default: - bottomStripeInset = 0.0 - bottomStripeOffset = 0.0 - hasBottomCorners = true - strongSelf.bottomStripeNode.isHidden = hasCorners + case .sameSection(false): + bottomStripeInset = leftInset + editingOffset + bottomStripeOffset = -separatorHeight + default: + bottomStripeInset = 0.0 + bottomStripeOffset = 0.0 + hasBottomCorners = true + strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) transition.updateFrame(node: strongSelf.topStripeNode, frame: CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: layoutSize.width, height: separatorHeight))) transition.updateFrame(node: strongSelf.bottomStripeNode, frame: CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height + bottomStripeOffset), size: CGSize(width: layoutSize.width - bottomStripeInset, height: separatorHeight))) - transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: (statusAttributedString == nil ? 14.0 : 6.0) + verticalOffset), size: titleLayout.size)) - transition.updateFrame(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: 27.0 + verticalOffset), size: statusLayout.size)) + transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: verticalInset + verticalOffset), size: titleLayout.size)) + transition.updateFrame(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: strongSelf.titleNode.frame.maxY + titleSpacing), size: statusLayout.size)) if let currentSwitchNode = currentSwitchNode { if currentSwitchNode !== strongSelf.switchNode { @@ -795,19 +810,19 @@ public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNo strongSelf.labelBadgeNode.frame = CGRect(origin: CGPoint(x: revealOffset + params.width - rightLabelInset - badgeWidth, y: labelFrame.minY - 1.0), size: CGSize(width: badgeWidth, height: badgeDiameter)) - transition.updateFrame(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: params.leftInset + revealOffset + editingOffset + 15.0, y: floorToScreenPixels((height - avatarSize) / 2.0)), size: CGSize(width: avatarSize, height: avatarSize))) + transition.updateFrame(node: strongSelf.avatarNode, frame: CGRect(origin: CGPoint(x: params.leftInset + revealOffset + editingOffset + 15.0, y: floorToScreenPixels((layout.contentSize.height - avatarSize) / 2.0)), size: CGSize(width: avatarSize, height: avatarSize))) if item.peer.id == item.account.peerId, case .threatSelfAsSaved = item.aliasHandling { - strongSelf.avatarNode.setPeer(account: item.account, theme: item.theme, peer: item.peer, overrideImage: .savedMessagesIcon, emptyColor: item.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoad) + strongSelf.avatarNode.setPeer(account: item.account, theme: item.presentationData.theme, peer: item.peer, overrideImage: .savedMessagesIcon, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoad) } else { var overrideImage: AvatarNodeImageOverride? if item.peer.isDeleted { overrideImage = .deletedIcon } - strongSelf.avatarNode.setPeer(account: item.account, theme: item.theme, peer: item.peer, overrideImage: overrideImage, emptyColor: item.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoad) + strongSelf.avatarNode.setPeer(account: item.account, theme: item.presentationData.theme, peer: item.peer, overrideImage: overrideImage, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoad) } - strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: height + UIScreenPixel + UIScreenPixel)) + strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: layout.contentSize.height + UIScreenPixel + UIScreenPixel)) if let presence = item.presence as? TelegramUserPresence { strongSelf.peerPresenceManager?.reset(presence: presence) diff --git a/submodules/ItemListStickerPackItem/Sources/ItemListStickerPackItem.swift b/submodules/ItemListStickerPackItem/Sources/ItemListStickerPackItem.swift index eb2f813259..73d8fb9f35 100644 --- a/submodules/ItemListStickerPackItem/Sources/ItemListStickerPackItem.swift +++ b/submodules/ItemListStickerPackItem/Sources/ItemListStickerPackItem.swift @@ -34,8 +34,7 @@ public enum ItemListStickerPackItemControl: Equatable { } public final class ItemListStickerPackItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let account: Account let packInfo: StickerPackCollectionInfo let itemCount: String @@ -51,9 +50,8 @@ public final class ItemListStickerPackItem: ListViewItem, ItemListItem { let addPack: () -> Void let removePack: () -> Void - public init(theme: PresentationTheme, strings: PresentationStrings, account: Account, packInfo: StickerPackCollectionInfo, itemCount: String, topItem: StickerPackItem?, unread: Bool, control: ItemListStickerPackItemControl, editing: ItemListStickerPackItemEditing, enabled: Bool, playAnimatedStickers: Bool, sectionId: ItemListSectionId, action: (() -> Void)?, setPackIdWithRevealedOptions: @escaping (ItemCollectionId?, ItemCollectionId?) -> Void, addPack: @escaping () -> Void, removePack: @escaping () -> Void) { - self.theme = theme - self.strings = strings + public init(presentationData: ItemListPresentationData, account: Account, packInfo: StickerPackCollectionInfo, itemCount: String, topItem: StickerPackItem?, unread: Bool, control: ItemListStickerPackItemControl, editing: ItemListStickerPackItemEditing, enabled: Bool, playAnimatedStickers: Bool, sectionId: ItemListSectionId, action: (() -> Void)?, setPackIdWithRevealedOptions: @escaping (ItemCollectionId?, ItemCollectionId?) -> Void, addPack: @escaping () -> Void, removePack: @escaping () -> Void) { + self.presentationData = presentationData self.account = account self.packInfo = packInfo self.itemCount = itemCount @@ -116,9 +114,6 @@ public final class ItemListStickerPackItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.bold(15.0) -private let statusFont = Font.regular(14.0) - public enum StickerPackThumbnailItem: Equatable { case still(TelegramMediaImageRepresentation) case animated(MediaResource) @@ -274,18 +269,21 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { let currentItem = self.layoutParams?.0 return { item, params, neighbors in + let titleFont = Font.bold(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + let statusFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + var titleAttributedString: NSAttributedString? var statusAttributedString: NSAttributedString? var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } let packRevealOptions: [ItemListRevealOption] if item.editing.editable && item.enabled { - packRevealOptions = [ItemListRevealOption(key: 0, title: item.strings.Common_Delete, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)] + packRevealOptions = [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)] } else { packRevealOptions = [] } @@ -300,57 +298,60 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { case let .installation(installed): rightInset += 50.0 if installed { - installationActionImage = PresentationResourcesItemList.secondaryCheckIconImage(item.theme) + installationActionImage = PresentationResourcesItemList.secondaryCheckIconImage(item.presentationData.theme) } else { - installationActionImage = PresentationResourcesItemList.plusIconImage(item.theme) + installationActionImage = PresentationResourcesItemList.plusIconImage(item.presentationData.theme) } case .selection: rightInset += 16.0 - checkImage = PresentationResourcesItemList.checkIconImage(item.theme) + checkImage = PresentationResourcesItemList.checkIconImage(item.presentationData.theme) } var unreadImage: UIImage? if item.unread { - unreadImage = PresentationResourcesItemList.stickerUnreadDotImage(item.theme) + unreadImage = PresentationResourcesItemList.stickerUnreadDotImage(item.presentationData.theme) } - titleAttributedString = NSAttributedString(string: item.packInfo.title, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor) - statusAttributedString = NSAttributedString(string: item.itemCount, font: statusFont, textColor: item.theme.list.itemSecondaryTextColor) + titleAttributedString = NSAttributedString(string: item.packInfo.title, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) + statusAttributedString = NSAttributedString(string: item.itemCount, font: statusFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) let leftInset: CGFloat = 65.0 + params.leftInset + let verticalInset: CGFloat = 11.0 + let titleSpacing: CGFloat = 2.0 + let insets = itemListNeighborsGroupedInsets(neighbors) - let contentSize = CGSize(width: params.width, height: 59.0) let separatorHeight = UIScreenPixel - let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) - let layoutSize = layout.size - - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? - var reorderControlSizeAndApply: (CGSize, (Bool) -> ItemListEditableReorderControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? + var reorderControlSizeAndApply: (CGFloat, (CGFloat, Bool) -> ItemListEditableReorderControlNode)? var editingOffset: CGFloat = 0.0 var reorderInset: CGFloat = 0.0 if item.editing.editing { - let sizeAndApply = editableControlLayout(59.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.presentationData.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 if item.editing.reorderable { - let sizeAndApply = reorderControlLayout(contentSize.height, item.theme) + let sizeAndApply = reorderControlLayout(item.presentationData.theme) reorderControlSizeAndApply = sizeAndApply - reorderInset = sizeAndApply.0.width + reorderInset = sizeAndApply.0 } } let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - editingOffset - rightInset - 10.0 - reorderInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (statusLayout, statusApply) = makeStatusLayout(TextNodeLayoutArguments(attributedString: statusAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - editingOffset - rightInset - reorderInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let contentSize = CGSize(width: params.width, height: verticalInset * 2.0 + titleLayout.size.height + titleSpacing + statusLayout.size.height) + let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) + let layoutSize = layout.size + if !item.enabled { if currentDisabledOverlayNode == nil { currentDisabledOverlayNode = ASDisplayNode() - currentDisabledOverlayNode?.backgroundColor = item.theme.list.itemBlocksBackgroundColor.withAlphaComponent(0.5) + currentDisabledOverlayNode?.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor.withAlphaComponent(0.5) } } else { currentDisabledOverlayNode = nil @@ -420,10 +421,10 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { } if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let revealOffset = strongSelf.revealOffset @@ -453,9 +454,9 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.size.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.size.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -484,13 +485,13 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { if let reorderControlSizeAndApply = reorderControlSizeAndApply { if strongSelf.reorderControlNode == nil { - let reorderControlNode = reorderControlSizeAndApply.1(false) + let reorderControlNode = reorderControlSizeAndApply.1(layout.contentSize.height, false) strongSelf.reorderControlNode = reorderControlNode strongSelf.addSubnode(reorderControlNode) reorderControlNode.alpha = 0.0 transition.updateAlpha(node: reorderControlNode, alpha: 1.0) } - let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0.width, y: 0.0), size: reorderControlSizeAndApply.0) + let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0, y: 0.0), size: CGSize(width: reorderControlSizeAndApply.0, height: layout.contentSize.height)) strongSelf.reorderControlNode?.frame = reorderControlFrame } else if let reorderControlNode = strongSelf.reorderControlNode { strongSelf.reorderControlNode = nil @@ -568,7 +569,7 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -583,12 +584,12 @@ class ItemListStickerPackItemNode: ItemListRevealOptionsItemNode { strongSelf.unreadNode.isHidden = true } - transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: (strongSelf.unreadNode.isHidden ? 0.0 : 10.0) + leftInset + revealOffset + editingOffset, y: 11.0), size: titleLayout.size)) - transition.updateFrame(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: 32.0), size: statusLayout.size)) + transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: (strongSelf.unreadNode.isHidden ? 0.0 : 10.0) + leftInset + revealOffset + editingOffset, y: verticalInset), size: titleLayout.size)) + transition.updateFrame(node: strongSelf.statusNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: strongSelf.titleNode.frame.maxY + titleSpacing), size: statusLayout.size)) let boundingSize = CGSize(width: 34.0, height: 34.0) if let thumbnailItem = thumbnailItem, let imageSize = imageSize { - let imageFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset + editingOffset + 15.0 + floor((boundingSize.width - imageSize.width) / 2.0), y: 11.0 + floor((boundingSize.height - imageSize.height) / 2.0)), size: imageSize) + let imageFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset + editingOffset + 15.0 + floor((boundingSize.width - imageSize.width) / 2.0), y: floor((layout.size.height - imageSize.height) / 2.0)), size: imageSize) switch thumbnailItem { case .still: transition.updateFrame(node: strongSelf.imageNode, frame: imageFrame) diff --git a/submodules/ItemListUI/Sources/ItemListController.swift b/submodules/ItemListUI/Sources/ItemListController.swift index d6ccf5ff40..2648d65737 100644 --- a/submodules/ItemListUI/Sources/ItemListController.swift +++ b/submodules/ItemListUI/Sources/ItemListController.swift @@ -80,7 +80,7 @@ public final class ItemListControllerTabBarItem: Equatable { } public struct ItemListControllerState { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: ItemListControllerTitle let leftNavigationButton: ItemListNavigationButton? let rightNavigationButton: ItemListNavigationButton? @@ -89,8 +89,8 @@ public struct ItemListControllerState { let tabBarItem: ItemListControllerTabBarItem? let animateChanges: Bool - public init(theme: PresentationTheme, title: ItemListControllerTitle, leftNavigationButton: ItemListNavigationButton?, rightNavigationButton: ItemListNavigationButton?, secondaryRightNavigationButton: ItemListNavigationButton? = nil, backNavigationButton: ItemListBackButton?, tabBarItem: ItemListControllerTabBarItem? = nil, animateChanges: Bool = true) { - self.theme = theme + public init(presentationData: ItemListPresentationData, title: ItemListControllerTitle, leftNavigationButton: ItemListNavigationButton?, rightNavigationButton: ItemListNavigationButton?, secondaryRightNavigationButton: ItemListNavigationButton? = nil, backNavigationButton: ItemListBackButton?, tabBarItem: ItemListControllerTabBarItem? = nil, animateChanges: Bool = true) { + self.presentationData = presentationData self.title = title self.leftNavigationButton = leftNavigationButton self.rightNavigationButton = rightNavigationButton @@ -111,8 +111,7 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable private var navigationButtonActions: (left: (() -> Void)?, right: (() -> Void)?, secondaryRight: (() -> Void)?) = (nil, nil, nil) private var segmentedTitleView: ItemListControllerSegmentedTitleView? - private var theme: PresentationTheme - private var strings: PresentationStrings + private var presentationData: ItemListPresentationData private var validLayout: ContainerViewLayout? @@ -228,21 +227,20 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable public var willDisappear: ((Bool) -> Void)? public var didDisappear: ((Bool) -> Void)? - public init(theme: PresentationTheme, strings: PresentationStrings, updatedPresentationData: Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError>, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal?) { + public init(presentationData: ItemListPresentationData, updatedPresentationData: Signal, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal?) { self.state = state |> map { controllerState, nodeStateAndArgument -> (ItemListControllerState, (ItemListNodeState, Any)) in return (controllerState, (nodeStateAndArgument.0, nodeStateAndArgument.1)) } - self.theme = theme - self.strings = strings + self.presentationData = presentationData - super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: theme), strings: NavigationBarStrings(presentationStrings: strings))) + super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme), strings: NavigationBarStrings(presentationStrings: presentationData.strings))) self.isOpaqueWhenInOverlay = true self.blocksBackgroundWhenInOverlay = true - self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style + self.statusBar.statusBarStyle = presentationData.theme.rootController.statusBarStyle.style self.scrollToTop = { [weak self] in self?.willScrollToTop?() @@ -292,7 +290,7 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable if let segmentedTitleView = strongSelf.segmentedTitleView, segmentedTitleView.segments == sections { segmentedTitleView.index = index } else { - let segmentedTitleView = ItemListControllerSegmentedTitleView(theme: controllerState.theme, segments: sections, selectedIndex: index) + let segmentedTitleView = ItemListControllerSegmentedTitleView(theme: controllerState.presentationData.theme, segments: sections, selectedIndex: index) strongSelf.segmentedTitleView = segmentedTitleView strongSelf.navigationItem.titleView = strongSelf.segmentedTitleView segmentedTitleView.indexUpdated = { index in @@ -305,7 +303,7 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable } strongSelf.navigationButtonActions = (left: controllerState.leftNavigationButton?.action, right: controllerState.rightNavigationButton?.action, secondaryRight: controllerState.secondaryRightNavigationButton?.action) - let themeUpdated = strongSelf.theme !== controllerState.theme + let themeUpdated = strongSelf.presentationData != controllerState.presentationData if strongSelf.leftNavigationButtonTitleAndStyle?.0 != controllerState.leftNavigationButton?.content || strongSelf.leftNavigationButtonTitleAndStyle?.1 != controllerState.leftNavigationButton?.style || themeUpdated { if let leftNavigationButton = controllerState.leftNavigationButton { let item: UIBarButtonItem @@ -318,11 +316,11 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable var image: UIImage? switch icon { case .search: - image = PresentationResourcesRootController.navigationCompactSearchIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationCompactSearchIcon(controllerState.presentationData.theme) case .add: - image = PresentationResourcesRootController.navigationAddIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationAddIcon(controllerState.presentationData.theme) case .action: - image = PresentationResourcesRootController.navigationShareIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationShareIcon(controllerState.presentationData.theme) } item = UIBarButtonItem(image: image, style: leftNavigationButton.style.barButtonItemStyle, target: strongSelf, action: #selector(strongSelf.leftNavigationButtonPressed)) } @@ -363,7 +361,7 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable for (content, style, _) in rightNavigationButtonTitleAndStyle { let item: UIBarButtonItem if case .activity = style { - item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: controllerState.theme.rootController.navigationBar.controlColor)) + item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: controllerState.presentationData.theme.rootController.navigationBar.controlColor)) } else { let action: Selector = (index == 0 && rightNavigationButtonTitleAndStyle.count > 1) ? #selector(strongSelf.secondaryRightNavigationButtonPressed) : #selector(strongSelf.rightNavigationButtonPressed) switch content { @@ -375,11 +373,11 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable var image: UIImage? switch icon { case .search: - image = PresentationResourcesRootController.navigationCompactSearchIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationCompactSearchIcon(controllerState.presentationData.theme) case .add: - image = PresentationResourcesRootController.navigationAddIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationAddIcon(controllerState.presentationData.theme) case .action: - image = PresentationResourcesRootController.navigationShareIcon(controllerState.theme) + image = PresentationResourcesRootController.navigationShareIcon(controllerState.presentationData.theme) } item = UIBarButtonItem(image: image, style: style.barButtonItemStyle, target: strongSelf, action: action) } @@ -409,25 +407,27 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable } } - if strongSelf.theme !== controllerState.theme { - strongSelf.theme = controllerState.theme + if strongSelf.presentationData != controllerState.presentationData { + strongSelf.presentationData = controllerState.presentationData - strongSelf.navigationBar?.updatePresentationData(NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: strongSelf.theme), strings: NavigationBarStrings(presentationStrings: strongSelf.strings))) - strongSelf.statusBar.updateStatusBarStyle(strongSelf.theme.rootController.statusBarStyle.style, animated: true) + strongSelf.navigationBar?.updatePresentationData(NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: strongSelf.presentationData.theme), strings: NavigationBarStrings(presentationStrings: strongSelf.presentationData.strings))) + strongSelf.statusBar.updateStatusBarStyle(strongSelf.presentationData.theme.rootController.statusBarStyle.style, animated: true) - strongSelf.segmentedTitleView?.theme = controllerState.theme + strongSelf.segmentedTitleView?.theme = controllerState.presentationData.theme var items = strongSelf.navigationItem.rightBarButtonItems ?? [] for i in 0 ..< strongSelf.rightNavigationButtonTitleAndStyle.count { if case .activity = strongSelf.rightNavigationButtonTitleAndStyle[i].1 { - items[i] = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: controllerState.theme.rootController.navigationBar.controlColor))! + items[i] = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: controllerState.presentationData.theme.rootController.navigationBar.controlColor))! } } strongSelf.navigationItem.setRightBarButtonItems(items, animated: false) } } } - } |> map { ($0.theme, $1) } + } + |> map { ($0.presentationData, $1) } + let displayNode = ItemListControllerNode(controller: self, navigationBar: self.navigationBar!, updateNavigationOffset: { [weak self] offset in if let strongSelf = self { strongSelf.navigationOffset = offset diff --git a/submodules/ItemListUI/Sources/ItemListControllerNode.swift b/submodules/ItemListUI/Sources/ItemListControllerNode.swift index 4bd1eb822c..5be3394696 100644 --- a/submodules/ItemListUI/Sources/ItemListControllerNode.swift +++ b/submodules/ItemListUI/Sources/ItemListControllerNode.swift @@ -15,7 +15,7 @@ public protocol ItemListNodeAnyEntry { var tag: ItemListItemTag? { get } func isLessThan(_ rhs: ItemListNodeAnyEntry) -> Bool func isEqual(_ rhs: ItemListNodeAnyEntry) -> Bool - func item(_ arguments: Any) -> ListViewItem + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem } public protocol ItemListNodeEntry: Comparable, Identifiable, ItemListNodeAnyEntry { @@ -46,18 +46,18 @@ private struct ItemListNodeEntryTransition { let updates: [ListViewUpdateItem] } -private func preparedItemListNodeEntryTransition(from fromEntries: [ItemListNodeAnyEntry], to toEntries: [ItemListNodeAnyEntry], arguments: Any) -> ItemListNodeEntryTransition { +private func preparedItemListNodeEntryTransition(from fromEntries: [ItemListNodeAnyEntry], to toEntries: [ItemListNodeAnyEntry], presentationData: ItemListPresentationData, arguments: Any, presentationDataUpdated: Bool) -> ItemListNodeEntryTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries, isLess: { lhs, rhs in return lhs.isLessThan(rhs) }, isEqual: { lhs, rhs in return lhs.isEqual(rhs) }, getId: { value in return value.anyId - }) + }, allUpdated: presentationDataUpdated) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } return ItemListNodeEntryTransition(deletions: deletions, insertions: insertions, updates: updates) } @@ -85,6 +85,7 @@ private struct ItemListNodeTransition { } public final class ItemListNodeState { + let presentationData: ItemListPresentationData let entries: [ItemListNodeAnyEntry] let style: ItemListStyle let emptyStateItem: ItemListControllerEmptyStateItem? @@ -96,7 +97,8 @@ public final class ItemListNodeState { let ensureVisibleItemTag: ItemListItemTag? let initialScrollToItem: ListViewScrollToItem? - public init(entries: [T], style: ItemListStyle, focusItemTag: ItemListItemTag? = nil, ensureVisibleItemTag: ItemListItemTag? = nil, emptyStateItem: ItemListControllerEmptyStateItem? = nil, searchItem: ItemListControllerSearch? = nil, initialScrollToItem: ListViewScrollToItem? = nil, crossfadeState: Bool = false, animateChanges: Bool = true, scrollEnabled: Bool = true) { + public init(presentationData: ItemListPresentationData, entries: [T], style: ItemListStyle, focusItemTag: ItemListItemTag? = nil, ensureVisibleItemTag: ItemListItemTag? = nil, emptyStateItem: ItemListControllerEmptyStateItem? = nil, searchItem: ItemListControllerSearch? = nil, initialScrollToItem: ListViewScrollToItem? = nil, crossfadeState: Bool = false, animateChanges: Bool = true, scrollEnabled: Bool = true) { + self.presentationData = presentationData self.entries = entries.map { $0 } self.style = style self.emptyStateItem = emptyStateItem @@ -226,7 +228,7 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate { var alwaysSynchronous = false - public init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, state: Signal<(PresentationTheme, (ItemListNodeState, Any)), NoError>) { + public init(controller: ItemListController?, navigationBar: NavigationBar, updateNavigationOffset: @escaping (CGFloat) -> Void, state: Signal<(ItemListPresentationData, (ItemListNodeState, Any)), NoError>) { self.navigationBar = navigationBar self.updateNavigationOffset = updateNavigationOffset @@ -298,7 +300,8 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate { } let previousState = Atomic(value: nil) - self.transitionDisposable.set(((state |> map { theme, stateAndArguments -> ItemListNodeTransition in + self.transitionDisposable.set(((state + |> map { presentationData, stateAndArguments -> ItemListNodeTransition in let (state, arguments) = stateAndArguments if state.entries.count > 1 { for i in 1 ..< state.entries.count { @@ -306,7 +309,7 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate { } } let previous = previousState.swap(state) - let transition = preparedItemListNodeEntryTransition(from: previous?.entries ?? [], to: state.entries, arguments: arguments) + let transition = preparedItemListNodeEntryTransition(from: previous?.entries ?? [], to: state.entries, presentationData: presentationData, arguments: arguments, presentationDataUpdated: previous?.presentationData != presentationData) var updatedStyle: ItemListStyle? if previous?.style != state.style { updatedStyle = state.style @@ -317,8 +320,9 @@ open class ItemListControllerNode: ASDisplayNode, UIScrollViewDelegate { scrollToItem = state.initialScrollToItem } - return ItemListNodeTransition(theme: theme, entries: transition, updateStyle: updatedStyle, emptyStateItem: state.emptyStateItem, searchItem: state.searchItem, focusItemTag: state.focusItemTag, ensureVisibleItemTag: state.ensureVisibleItemTag, scrollToItem: scrollToItem, firstTime: previous == nil, animated: previous != nil && state.animateChanges, animateAlpha: previous != nil && state.animateChanges, crossfade: state.crossfadeState, mergedEntries: state.entries, scrollEnabled: state.scrollEnabled) - }) |> deliverOnMainQueue).start(next: { [weak self] transition in + return ItemListNodeTransition(theme: presentationData.theme, entries: transition, updateStyle: updatedStyle, emptyStateItem: state.emptyStateItem, searchItem: state.searchItem, focusItemTag: state.focusItemTag, ensureVisibleItemTag: state.ensureVisibleItemTag, scrollToItem: scrollToItem, firstTime: previous == nil, animated: previous != nil && state.animateChanges, animateAlpha: previous != nil && state.animateChanges, crossfade: state.crossfadeState, mergedEntries: state.entries, scrollEnabled: state.scrollEnabled) + }) + |> deliverOnMainQueue).start(next: { [weak self] transition in if let strongSelf = self { strongSelf.enqueueTransition(transition) } diff --git a/submodules/ItemListUI/Sources/ItemListEditableDeleteControlNode.swift b/submodules/ItemListUI/Sources/ItemListEditableDeleteControlNode.swift index 92a88917fa..815b6f77d7 100644 --- a/submodules/ItemListUI/Sources/ItemListEditableDeleteControlNode.swift +++ b/submodules/ItemListUI/Sources/ItemListEditableDeleteControlNode.swift @@ -23,8 +23,8 @@ public final class ItemListEditableControlNode: ASDisplayNode { self.view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.tapGesture(_:)))) } - public static func asyncLayout(_ node: ItemListEditableControlNode?) -> (_ height: CGFloat, _ theme: PresentationTheme, _ hidden: Bool) -> (CGSize, () -> ItemListEditableControlNode) { - return { height, theme, hidden in + public static func asyncLayout(_ node: ItemListEditableControlNode?) -> (_ theme: PresentationTheme, _ hidden: Bool) -> (CGFloat, (CGFloat) -> ItemListEditableControlNode) { + return { theme, hidden in let image = PresentationResourcesItemList.itemListDeleteIndicatorIcon(theme) let resultNode: ItemListEditableControlNode @@ -35,7 +35,7 @@ public final class ItemListEditableControlNode: ASDisplayNode { } resultNode.iconNode.image = image - return (CGSize(width: 38.0, height: height), { + return (38.0, { height in if let image = image { resultNode.iconNode.frame = CGRect(origin: CGPoint(x: 12.0, y: floor((height - image.size.height) / 2.0)), size: image.size) resultNode.iconNode.isHidden = hidden diff --git a/submodules/ItemListUI/Sources/ItemListEditableReorderControlNode.swift b/submodules/ItemListUI/Sources/ItemListEditableReorderControlNode.swift index 5c2c5d6c13..ce53c7ca5c 100644 --- a/submodules/ItemListUI/Sources/ItemListEditableReorderControlNode.swift +++ b/submodules/ItemListUI/Sources/ItemListEditableReorderControlNode.swift @@ -19,8 +19,8 @@ public final class ItemListEditableReorderControlNode: ASDisplayNode { self.addSubnode(self.iconNode) } - public static func asyncLayout(_ node: ItemListEditableReorderControlNode?) -> (_ height: CGFloat, _ theme: PresentationTheme) -> (CGSize, (Bool) -> ItemListEditableReorderControlNode) { - return { height, theme in + public static func asyncLayout(_ node: ItemListEditableReorderControlNode?) -> (_ theme: PresentationTheme) -> (CGFloat, (CGFloat, Bool) -> ItemListEditableReorderControlNode) { + return { theme in let image = PresentationResourcesItemList.itemListReorderIndicatorIcon(theme) let resultNode: ItemListEditableReorderControlNode @@ -31,7 +31,7 @@ public final class ItemListEditableReorderControlNode: ASDisplayNode { } resultNode.iconNode.image = image - return (CGSize(width: 40.0, height: height), { offsetForLabel in + return (40.0, { height, offsetForLabel in if let image = image { resultNode.iconNode.frame = CGRect(origin: CGPoint(x: 7.0, y: floor((height - image.size.height) / 2.0) - (offsetForLabel ? 6.0 : 0.0)), size: image.size) } diff --git a/submodules/ItemListUI/Sources/ItemListItem.swift b/submodules/ItemListUI/Sources/ItemListItem.swift index 6cb50af62e..d9f8746046 100644 --- a/submodules/ItemListUI/Sources/ItemListItem.swift +++ b/submodules/ItemListUI/Sources/ItemListItem.swift @@ -1,6 +1,8 @@ import Foundation import UIKit import Display +import TelegramUIPreferences +import TelegramPresentationData public protocol ItemListItemTag { func isEqual(to other: ItemListItemTag) -> Bool @@ -148,3 +150,93 @@ public func itemListNeighborsGroupedInsets(_ neighbors: ItemListNeighbors) -> UI public func itemListHasRoundedBlockLayout(_ params: ListViewItemLayoutParams) -> Bool { return params.width > 480.0 } + +public final class ItemListPresentationData: Equatable { + public let theme: PresentationTheme + public let fontSize: PresentationFontSize + public let strings: PresentationStrings + + public init(theme: PresentationTheme, fontSize: PresentationFontSize, strings: PresentationStrings) { + self.theme = theme + self.fontSize = fontSize + self.strings = strings + } + + public static func ==(lhs: ItemListPresentationData, rhs: ItemListPresentationData) -> Bool { + if lhs.theme !== rhs.theme { + return false + } + if lhs.strings !== rhs.strings { + return false + } + if lhs.fontSize != rhs.fontSize { + return false + } + return true + } +} + +public extension PresentationFontSize { + var itemListBaseHeaderFontSize: CGFloat { + switch self { + case .extraSmall: + return 13.0 + case .small: + return 14.0 + case .medium: + return 15.0 + case .regular: + return 16.0 + case .large: + return 18.0 + case .extraLarge: + return 22.0 + case .extraLargeX2: + return 25.0 + } + } + + var itemListBaseFontSize: CGFloat { + switch self { + case .extraSmall: + return 14.0 + case .small: + return 15.0 + case .medium: + return 16.0 + case .regular: + return 17.0 + case .large: + return 19.0 + case .extraLarge: + return 23.0 + case .extraLargeX2: + return 26.0 + } + } + + var itemListBaseLabelFontSize: CGFloat { + switch self { + case .extraSmall: + return 11.0 + case .small: + return 12.0 + case .medium: + return 13.0 + case .regular: + return 14.0 + case .large: + return 16.0 + case .extraLarge: + return 20.0 + case .extraLargeX2: + return 23.0 + } + } +} + +public extension ItemListPresentationData { + convenience init(_ presentationData: PresentationData) { + self.init(theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings) + } +} diff --git a/submodules/ItemListUI/Sources/Items/ItemListActionItem.swift b/submodules/ItemListUI/Sources/Items/ItemListActionItem.swift index e3e451f717..9bd3ebe49c 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListActionItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListActionItem.swift @@ -18,7 +18,7 @@ public enum ItemListActionAlignment { } public class ItemListActionItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: String let kind: ItemListActionKind let alignment: ItemListActionAlignment @@ -29,8 +29,8 @@ public class ItemListActionItem: ListViewItem, ItemListItem { let clearHighlightAutomatically: Bool public let tag: Any? - public init(theme: PresentationTheme, title: String, kind: ItemListActionKind, alignment: ItemListActionAlignment, sectionId: ItemListSectionId, style: ItemListStyle, action: @escaping () -> Void, longTapAction: (() -> Void)? = nil, clearHighlightAutomatically: Bool = true, tag: Any? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, title: String, kind: ItemListActionKind, alignment: ItemListActionAlignment, sectionId: ItemListSectionId, style: ItemListStyle, action: @escaping () -> Void, longTapAction: (() -> Void)? = nil, clearHighlightAutomatically: Bool = true, tag: Any? = nil) { + self.presentationData = presentationData self.title = title self.kind = kind self.alignment = alignment @@ -85,8 +85,6 @@ public class ItemListActionItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -138,22 +136,24 @@ public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { let currentItem = self.item return { item, params, neighbors in + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } let textColor: UIColor switch item.kind { - case .destructive: - textColor = item.theme.list.itemDestructiveColor - case .generic: - textColor = item.theme.list.itemAccentColor - case .neutral: - textColor = item.theme.list.itemPrimaryTextColor - case .disabled: - textColor = item.theme.list.itemDisabledTextColor + case .destructive: + textColor = item.presentationData.theme.list.itemDestructiveColor + case .generic: + textColor = item.presentationData.theme.list.itemAccentColor + case .neutral: + textColor = item.presentationData.theme.list.itemPrimaryTextColor + case .disabled: + textColor = item.presentationData.theme.list.itemDisabledTextColor } let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: textColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) @@ -165,16 +165,16 @@ public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { let itemBackgroundColor: UIColor let itemSeparatorColor: UIColor switch item.style { - case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor - contentSize = CGSize(width: params.width, height: 44.0) - insets = itemListNeighborsPlainInsets(neighbors) - case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor - contentSize = CGSize(width: params.width, height: 44.0) - insets = itemListNeighborsGroupedInsets(neighbors) + case .plain: + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor + contentSize = CGSize(width: params.width, height: titleLayout.size.height + 22.0) + insets = itemListNeighborsPlainInsets(neighbors) + case .blocks: + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor + contentSize = CGSize(width: params.width, height: titleLayout.size.height + 22.0) + insets = itemListNeighborsGroupedInsets(neighbors) } let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) @@ -199,7 +199,7 @@ public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { strongSelf.topStripeNode.backgroundColor = itemSeparatorColor strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() @@ -258,7 +258,7 @@ public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -267,13 +267,13 @@ public class ItemListActionItemNode: ListViewItemNode, ItemListItemNode { } switch item.alignment { - case .natural: - strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 11.0), size: titleLayout.size) - case .center: - strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: params.leftInset + floor((params.width - params.leftInset - params.rightInset - titleLayout.size.width) / 2.0), y: 11.0), size: titleLayout.size) + case .natural: + strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 11.0), size: titleLayout.size) + case .center: + strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: params.leftInset + floor((params.width - params.leftInset - params.rightInset - titleLayout.size.width) / 2.0), y: 11.0), size: titleLayout.size) } - strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: 44.0 + UIScreenPixel + UIScreenPixel)) + strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: layout.contentSize.height + UIScreenPixel + UIScreenPixel)) } }) } diff --git a/submodules/ItemListUI/Sources/Items/ItemListActivityTextItem.swift b/submodules/ItemListUI/Sources/Items/ItemListActivityTextItem.swift index 260e05dc3a..e74a11dd23 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListActivityTextItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListActivityTextItem.swift @@ -8,15 +8,15 @@ import ActivityIndicator public class ItemListActivityTextItem: ListViewItem, ItemListItem { let displayActivity: Bool - let theme: PresentationTheme + let presentationData: ItemListPresentationData let text: NSAttributedString public let sectionId: ItemListSectionId public let isAlwaysPlain: Bool = true - public init(displayActivity: Bool, theme: PresentationTheme, text: NSAttributedString, sectionId: ItemListSectionId) { + public init(displayActivity: Bool, presentationData: ItemListPresentationData, text: NSAttributedString, sectionId: ItemListSectionId) { self.displayActivity = displayActivity - self.theme = theme + self.presentationData = presentationData self.text = text self.sectionId = sectionId } @@ -58,8 +58,6 @@ public class ItemListActivityTextItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(14.0) - public class ItemListActivityTextItemNode: ListViewItemNode { private let titleNode: TextNode private let activityIndicator: ActivityIndicator @@ -87,6 +85,8 @@ public class ItemListActivityTextItemNode: ListViewItemNode { let leftInset: CGFloat = 12.0 + params.leftInset let verticalInset: CGFloat = 7.0 + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseHeaderFontSize) + var activityWidth: CGFloat = 0.0 if item.displayActivity { activityWidth = 25.0 @@ -116,9 +116,9 @@ public class ItemListActivityTextItemNode: ListViewItemNode { let _ = titleApply() strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset, y: verticalInset), size: titleLayout.size) - strongSelf.activityIndicator.frame = CGRect(origin: CGPoint(x: leftInset, y: 7.0), size: CGSize(width: 16.0, height: 16.0)) + strongSelf.activityIndicator.frame = CGRect(origin: CGPoint(x: leftInset, y: floor((contentSize.height - 16.0) / 2.0)), size: CGSize(width: 16.0, height: 16.0)) - strongSelf.activityIndicator.type = .custom(item.theme.list.itemAccentColor, 16.0, 2.0, false) + strongSelf.activityIndicator.type = .custom(item.presentationData.theme.list.itemAccentColor, 16.0, 2.0, false) if item.displayActivity { strongSelf.activityIndicator.isHidden = false diff --git a/submodules/ItemListUI/Sources/Items/ItemListCheckboxItem.swift b/submodules/ItemListUI/Sources/Items/ItemListCheckboxItem.swift index 25558f9c3d..666929fccb 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListCheckboxItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListCheckboxItem.swift @@ -16,7 +16,7 @@ public enum ItemListCheckboxItemColor { } public class ItemListCheckboxItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: String let style: ItemListCheckboxItemStyle let color: ItemListCheckboxItemColor @@ -25,8 +25,8 @@ public class ItemListCheckboxItem: ListViewItem, ItemListItem { public let sectionId: ItemListSectionId let action: () -> Void - public init(theme: PresentationTheme, title: String, style: ItemListCheckboxItemStyle, color: ItemListCheckboxItemColor = .accent, checked: Bool, zeroSeparatorInsets: Bool, sectionId: ItemListSectionId, action: @escaping () -> Void) { - self.theme = theme + public init(presentationData: ItemListPresentationData, title: String, style: ItemListCheckboxItemStyle, color: ItemListCheckboxItemColor = .accent, checked: Bool, zeroSeparatorInsets: Bool, sectionId: ItemListSectionId, action: @escaping () -> Void) { + self.presentationData = presentationData self.title = title self.style = style self.color = color @@ -77,8 +77,6 @@ public class ItemListCheckboxItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - public class ItemListCheckboxItemNode: ListViewItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -141,34 +139,36 @@ public class ItemListCheckboxItemNode: ListViewItemNode { var leftInset: CGFloat = params.leftInset switch item.style { - case .left: - leftInset += 44.0 - case .right: - leftInset += 16.0 + case .left: + leftInset += 44.0 + case .right: + leftInset += 16.0 } - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let separatorHeight = UIScreenPixel let insets = itemListNeighborsGroupedInsets(neighbors) - let contentSize = CGSize(width: params.width, height: 44.0) + let contentSize = CGSize(width: params.width, height: titleLayout.size.height + 22.0) let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) var updateCheckImage: UIImage? var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } - if currentItem?.theme !== item.theme || currentItem?.color != item.color { + if currentItem?.presentationData.theme !== item.presentationData.theme || currentItem?.color != item.color { switch item.color { - case .accent: - updateCheckImage = PresentationResourcesItemList.checkIconImage(item.theme) - case .secondary: - updateCheckImage = PresentationResourcesItemList.secondaryCheckIconImage(item.theme) + case .accent: + updateCheckImage = PresentationResourcesItemList.checkIconImage(item.presentationData.theme) + case .secondary: + updateCheckImage = PresentationResourcesItemList.secondaryCheckIconImage(item.presentationData.theme) } } @@ -190,20 +190,20 @@ public class ItemListCheckboxItemNode: ListViewItemNode { } if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() if let image = strongSelf.iconNode.image { switch item.style { - case .left: - strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: params.leftInset + floor((leftInset - params.leftInset - image.size.width) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) - case .right: - strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: params.width - params.rightInset - image.size.width - floor((44.0 - image.size.width) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) + case .left: + strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: params.leftInset + floor((leftInset - params.leftInset - image.size.width) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) + case .right: + strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: params.width - params.rightInset - image.size.width - floor((44.0 - image.size.width) / 2.0), y: floor((contentSize.height - image.size.height) / 2.0)), size: image.size) } } strongSelf.iconNode.isHidden = !item.checked @@ -244,7 +244,7 @@ public class ItemListCheckboxItemNode: ListViewItemNode { } } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) diff --git a/submodules/ItemListUI/Sources/Items/ItemListDisclosureItem.swift b/submodules/ItemListUI/Sources/Items/ItemListDisclosureItem.swift index 7da5f7ca78..95424291cf 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListDisclosureItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListDisclosureItem.swift @@ -24,7 +24,7 @@ public enum ItemListDisclosureLabelStyle { } public class ItemListDisclosureItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let icon: UIImage? let title: String let titleColor: ItemListDisclosureItemTitleColor @@ -38,8 +38,8 @@ public class ItemListDisclosureItem: ListViewItem, ItemListItem { let clearHighlightAutomatically: Bool public let tag: ItemListItemTag? - public init(theme: PresentationTheme, icon: UIImage? = nil, title: String, enabled: Bool = true, titleColor: ItemListDisclosureItemTitleColor = .primary, label: String, labelStyle: ItemListDisclosureLabelStyle = .text, sectionId: ItemListSectionId, style: ItemListStyle, disclosureStyle: ItemListDisclosureStyle = .arrow, action: (() -> Void)?, clearHighlightAutomatically: Bool = true, tag: ItemListItemTag? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, icon: UIImage? = nil, title: String, enabled: Bool = true, titleColor: ItemListDisclosureItemTitleColor = .primary, label: String, labelStyle: ItemListDisclosureLabelStyle = .text, sectionId: ItemListSectionId, style: ItemListStyle, disclosureStyle: ItemListDisclosureStyle = .arrow, action: (() -> Void)?, clearHighlightAutomatically: Bool = true, tag: ItemListItemTag? = nil) { + self.presentationData = presentationData self.icon = icon self.title = title self.titleColor = titleColor @@ -99,9 +99,7 @@ public class ItemListDisclosureItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) private let badgeFont = Font.regular(15.0) -private let detailFont = Font.regular(13.0) public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { private let backgroundNode: ASDisplayNode @@ -190,12 +188,12 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { let currentHasBadge = self.labelBadgeNode.image != nil return { item, params, neighbors in - let rightInset: CGFloat + var rightInset: CGFloat switch item.disclosureStyle { - case .none: - rightInset = 16.0 + params.rightInset - case .arrow: - rightInset = 34.0 + params.rightInset + case .none: + rightInset = 16.0 + params.rightInset + case .arrow: + rightInset = 34.0 + params.rightInset } var updateArrowImage: UIImage? @@ -221,9 +219,9 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { } let badgeDiameter: CGFloat = 20.0 - if currentItem?.theme !== item.theme { - updatedTheme = item.theme - updateArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.theme) + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme + updateArrowImage = PresentationResourcesItemList.disclosureArrowImage(item.presentationData.theme) if let badgeColor = badgeColor { updatedLabelBadgeImage = generateStretchableFilledCircleImage(diameter: badgeDiameter, color: badgeColor) } @@ -247,29 +245,41 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { leftInset += 43.0 } - let titleColor: UIColor - if item.enabled { - titleColor = item.titleColor == .accent ? item.theme.list.itemAccentColor : item.theme.list.itemPrimaryTextColor - } else { - titleColor = item.theme.list.itemDisabledTextColor + var additionalTextRightInset: CGFloat = 0.0 + switch item.labelStyle { + case .badge: + additionalTextRightInset += 44.0 + default: + break } - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: titleColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let titleColor: UIColor + if item.enabled { + titleColor = item.titleColor == .accent ? item.presentationData.theme.list.itemAccentColor : item.presentationData.theme.list.itemPrimaryTextColor + } else { + titleColor = item.presentationData.theme.list.itemDisabledTextColor + } + + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: titleColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset - additionalTextRightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + + let detailFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 13.0 / 17.0)) let labelFont: UIFont let labelBadgeColor: UIColor var labelConstrain: CGFloat = params.width - params.rightInset - leftInset - 40.0 - titleLayout.size.width - 10.0 switch item.labelStyle { - case .badge: - labelBadgeColor = item.theme.list.itemCheckColors.foregroundColor - labelFont = badgeFont - case .detailText, .multilineDetailText: - labelBadgeColor = item.theme.list.itemSecondaryTextColor - labelFont = detailFont - labelConstrain = params.width - params.rightInset - 40.0 - leftInset - default: - labelBadgeColor = item.theme.list.itemSecondaryTextColor - labelFont = titleFont + case .badge: + labelBadgeColor = item.presentationData.theme.list.itemCheckColors.foregroundColor + labelFont = badgeFont + case .detailText, .multilineDetailText: + labelBadgeColor = item.presentationData.theme.list.itemSecondaryTextColor + labelFont = detailFont + labelConstrain = params.width - params.rightInset - 40.0 - leftInset + default: + labelBadgeColor = item.presentationData.theme.list.itemSecondaryTextColor + labelFont = titleFont } var multilineLabel = false if case .multilineDetailText = item.labelStyle { @@ -278,27 +288,30 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { let (labelLayout, labelApply) = makeLabelLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.label, font: labelFont, textColor:labelBadgeColor), backgroundColor: nil, maximumNumberOfLines: multilineLabel ? 0 : 1, truncationType: .end, constrainedSize: CGSize(width: labelConstrain, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let verticalInset: CGFloat = 11.0 + let titleSpacing: CGFloat = 3.0 + let height: CGFloat switch item.labelStyle { - case .detailText: - height = 64.0 - case .multilineDetailText: - height = 44.0 + labelLayout.size.height - default: - height = 44.0 + case .detailText: + height = verticalInset * 2.0 + titleLayout.size.height + titleSpacing + labelLayout.size.height + case .multilineDetailText: + height = verticalInset * 2.0 + titleLayout.size.height + titleSpacing + labelLayout.size.height + default: + height = verticalInset * 2.0 + titleLayout.size.height } switch item.style { - case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor - contentSize = CGSize(width: params.width, height: height) - insets = itemListNeighborsPlainInsets(neighbors) - case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor - contentSize = CGSize(width: params.width, height: height) - insets = itemListNeighborsGroupedInsets(neighbors) + case .plain: + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor + contentSize = CGSize(width: params.width, height: height) + insets = itemListNeighborsPlainInsets(neighbors) + case .blocks: + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor + contentSize = CGSize(width: params.width, height: height) + insets = itemListNeighborsGroupedInsets(neighbors) } let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) @@ -343,70 +356,71 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { strongSelf.topStripeNode.backgroundColor = itemSeparatorColor strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() let _ = labelApply() switch item.style { - case .plain: - if strongSelf.backgroundNode.supernode != nil { - strongSelf.backgroundNode.removeFromSupernode() - } - if strongSelf.topStripeNode.supernode != nil { - strongSelf.topStripeNode.removeFromSupernode() - } - if strongSelf.bottomStripeNode.supernode == nil { - strongSelf.insertSubnode(strongSelf.bottomStripeNode, at: 0) - } - if strongSelf.maskNode.supernode != nil { - strongSelf.maskNode.removeFromSupernode() - } - strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - leftInset, height: separatorHeight)) - case .blocks: - if strongSelf.backgroundNode.supernode == nil { - strongSelf.insertSubnode(strongSelf.backgroundNode, at: 0) - } - if strongSelf.topStripeNode.supernode == nil { - strongSelf.insertSubnode(strongSelf.topStripeNode, at: 1) - } - if strongSelf.bottomStripeNode.supernode == nil { - strongSelf.insertSubnode(strongSelf.bottomStripeNode, at: 2) - } - if strongSelf.maskNode.supernode == nil { - strongSelf.insertSubnode(strongSelf.maskNode, at: 3) - } - - let hasCorners = itemListHasRoundedBlockLayout(params) - var hasTopCorners = false - var hasBottomCorners = false - switch neighbors.top { - case .sameSection(false): - strongSelf.topStripeNode.isHidden = true - default: - hasTopCorners = true - strongSelf.topStripeNode.isHidden = hasCorners - } - let bottomStripeInset: CGFloat - switch neighbors.bottom { - case .sameSection(false): - bottomStripeInset = leftInset - default: - bottomStripeInset = 0.0 - hasBottomCorners = true - strongSelf.bottomStripeNode.isHidden = hasCorners - } - - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil - - strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) - strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) - strongSelf.topStripeNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: separatorHeight)) - strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - bottomStripeInset, height: separatorHeight)) + case .plain: + if strongSelf.backgroundNode.supernode != nil { + strongSelf.backgroundNode.removeFromSupernode() + } + if strongSelf.topStripeNode.supernode != nil { + strongSelf.topStripeNode.removeFromSupernode() + } + if strongSelf.bottomStripeNode.supernode == nil { + strongSelf.insertSubnode(strongSelf.bottomStripeNode, at: 0) + } + if strongSelf.maskNode.supernode != nil { + strongSelf.maskNode.removeFromSupernode() + } + strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - leftInset, height: separatorHeight)) + case .blocks: + if strongSelf.backgroundNode.supernode == nil { + strongSelf.insertSubnode(strongSelf.backgroundNode, at: 0) + } + if strongSelf.topStripeNode.supernode == nil { + strongSelf.insertSubnode(strongSelf.topStripeNode, at: 1) + } + if strongSelf.bottomStripeNode.supernode == nil { + strongSelf.insertSubnode(strongSelf.bottomStripeNode, at: 2) + } + if strongSelf.maskNode.supernode == nil { + strongSelf.insertSubnode(strongSelf.maskNode, at: 3) + } + + let hasCorners = itemListHasRoundedBlockLayout(params) + var hasTopCorners = false + var hasBottomCorners = false + switch neighbors.top { + case .sameSection(false): + strongSelf.topStripeNode.isHidden = true + default: + hasTopCorners = true + strongSelf.topStripeNode.isHidden = hasCorners + } + let bottomStripeInset: CGFloat + switch neighbors.bottom { + case .sameSection(false): + bottomStripeInset = leftInset + default: + bottomStripeInset = 0.0 + hasBottomCorners = true + strongSelf.bottomStripeNode.isHidden = hasCorners + } + + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + + strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) + strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) + strongSelf.topStripeNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: separatorHeight)) + strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - bottomStripeInset, height: separatorHeight)) } - strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 11.0), size: titleLayout.size) + let titleFrame = CGRect(origin: CGPoint(x: leftInset, y: 11.0), size: titleLayout.size) + strongSelf.titleNode.frame = titleFrame if let updateBadgeImage = updatedLabelBadgeImage { if strongSelf.labelBadgeNode.supernode == nil { @@ -420,14 +434,15 @@ public class ItemListDisclosureItemNode: ListViewItemNode, ItemListItemNode { } let badgeWidth = max(badgeDiameter, labelLayout.size.width + 10.0) - strongSelf.labelBadgeNode.frame = CGRect(origin: CGPoint(x: params.width - rightInset - badgeWidth, y: 12.0), size: CGSize(width: badgeWidth, height: badgeDiameter)) + let badgeFrame = CGRect(origin: CGPoint(x: params.width - rightInset - badgeWidth, y: floor((contentSize.height - badgeDiameter) / 2.0)), size: CGSize(width: badgeWidth, height: badgeDiameter)) + strongSelf.labelBadgeNode.frame = badgeFrame let labelFrame: CGRect switch item.labelStyle { case .badge: - labelFrame = CGRect(origin: CGPoint(x: params.width - rightInset - badgeWidth + (badgeWidth - labelLayout.size.width) / 2.0, y: 13.0), size: labelLayout.size) + labelFrame = CGRect(origin: CGPoint(x: params.width - rightInset - badgeWidth + (badgeWidth - labelLayout.size.width) / 2.0, y: badgeFrame.minY + 1), size: labelLayout.size) case .detailText, .multilineDetailText: - labelFrame = CGRect(origin: CGPoint(x: leftInset, y: 36.0), size: labelLayout.size) + labelFrame = CGRect(origin: CGPoint(x: leftInset, y: titleFrame.maxY + titleSpacing), size: labelLayout.size) default: labelFrame = CGRect(origin: CGPoint(x: params.width - rightInset - labelLayout.size.width, y: 11.0), size: labelLayout.size) } diff --git a/submodules/ItemListUI/Sources/Items/ItemListInfoItem.swift b/submodules/ItemListUI/Sources/Items/ItemListInfoItem.swift index 0cc2c753b4..adf0fdae4d 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListInfoItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListInfoItem.swift @@ -19,15 +19,15 @@ public enum InfoListItemLinkAction { public class InfoListItem: ListViewItem { public let selectable: Bool = false - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: String let text: InfoListItemText let style: ItemListStyle let linkAction: ((InfoListItemLinkAction) -> Void)? let closeAction: (() -> Void)? - public init(theme: PresentationTheme, title: String, text: InfoListItemText, style: ItemListStyle, linkAction: ((InfoListItemLinkAction) -> Void)? = nil, closeAction: (() -> Void)?) { - self.theme = theme + public init(presentationData: ItemListPresentationData, title: String, text: InfoListItemText, style: ItemListStyle, linkAction: ((InfoListItemLinkAction) -> Void)? = nil, closeAction: (() -> Void)?) { + self.presentationData = presentationData self.title = title self.text = text self.style = style @@ -72,9 +72,9 @@ public class InfoListItem: ListViewItem { public class ItemListInfoItem: InfoListItem, ItemListItem { public let sectionId: ItemListSectionId - public init(theme: PresentationTheme, title: String, text: InfoListItemText, style: ItemListStyle, sectionId: ItemListSectionId, linkAction: ((InfoListItemLinkAction) -> Void)? = nil, closeAction: (() -> Void)?) { + public init(presentationData: ItemListPresentationData, title: String, text: InfoListItemText, style: ItemListStyle, sectionId: ItemListSectionId, linkAction: ((InfoListItemLinkAction) -> Void)? = nil, closeAction: (() -> Void)?) { self.sectionId = sectionId - super.init(theme: theme, title: title, text: text, style: style, linkAction: linkAction, closeAction: closeAction) + super.init(presentationData: presentationData, title: title, text: text, style: style, linkAction: linkAction, closeAction: closeAction) } override public func nodeConfiguredForParams(async: @escaping (@escaping () -> Void) -> Void, params: ListViewItemLayoutParams, synchronousLoads: Bool, previousItem: ListViewItem?, nextItem: ListViewItem?, completion: @escaping (ListViewItemNode, @escaping () -> (Signal?, (ListViewItemApply) -> Void)) -> Void) { @@ -111,11 +111,6 @@ public class ItemListInfoItem: InfoListItem, ItemListItem { } } -private let titleFont = Font.semibold(17.0) -private let textFont = Font.regular(16.0) -private let textBoldFont = Font.semibold(16.0) -private let badgeFont = Font.regular(15.0) - class InfoItemNode: ListViewItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -211,6 +206,11 @@ class InfoItemNode: ListViewItemNode { return { item, params, neighbors in let leftInset: CGFloat = 15.0 + params.leftInset let rightInset: CGFloat = 15.0 + params.rightInset + + let titleFont = Font.semibold(item.presentationData.fontSize.itemListBaseFontSize) + let textFont = Font.regular(item.presentationData.fontSize.itemListBaseHeaderFontSize) + let textBoldFont = Font.semibold(item.presentationData.fontSize.itemListBaseHeaderFontSize) + let badgeFont = Font.regular(15.0) var updatedTheme: PresentationTheme? var updatedBadgeImage: UIImage? @@ -218,10 +218,10 @@ class InfoItemNode: ListViewItemNode { var updatedCloseIcon: UIImage? let badgeDiameter: CGFloat = 20.0 - if currentItem?.theme !== item.theme { - updatedTheme = item.theme - updatedBadgeImage = generateStretchableFilledCircleImage(diameter: badgeDiameter, color: item.theme.list.itemDestructiveColor) - updatedCloseIcon = PresentationResourcesItemList.itemListCloseIconImage(item.theme) + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme + updatedBadgeImage = generateStretchableFilledCircleImage(diameter: badgeDiameter, color: item.presentationData.theme.list.itemDestructiveColor) + updatedCloseIcon = PresentationResourcesItemList.itemListCloseIconImage(item.presentationData.theme) } let insets: UIEdgeInsets @@ -236,26 +236,26 @@ class InfoItemNode: ListViewItemNode { let itemSeparatorColor: UIColor switch item.style { - case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor - case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor + case .plain: + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor + case .blocks: + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor } let attributedText: NSAttributedString switch item.text { - case let .plain(text): - attributedText = NSAttributedString(string: text, font: textFont, textColor: item.theme.list.itemPrimaryTextColor) - case let .markdown(text): - attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: MarkdownAttributeSet(font: textFont, textColor: item.theme.list.itemPrimaryTextColor), bold: MarkdownAttributeSet(font: textBoldFont, textColor: item.theme.list.itemPrimaryTextColor), link: MarkdownAttributeSet(font: textFont, textColor: item.theme.list.itemAccentColor), linkAttribute: { contents in - return (TelegramTextAttributes.URL, contents) - })) + case let .plain(text): + attributedText = NSAttributedString(string: text, font: textFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) + case let .markdown(text): + attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: MarkdownAttributeSet(font: textFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), bold: MarkdownAttributeSet(font: textBoldFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), link: MarkdownAttributeSet(font: textFont, textColor: item.presentationData.theme.list.itemAccentColor), linkAttribute: { contents in + return (TelegramTextAttributes.URL, contents) + })) } - let (labelLayout, labelApply) = makeLabelLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: "!", font: badgeFont, textColor: item.theme.list.itemCheckColors.foregroundColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: badgeDiameter, height: badgeDiameter), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 2, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - badgeDiameter - 8.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (labelLayout, labelApply) = makeLabelLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: "!", font: badgeFont, textColor: item.presentationData.theme.list.itemCheckColors.foregroundColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: badgeDiameter, height: badgeDiameter), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 2, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset - badgeDiameter - 8.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (textLayout, textApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 3, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let contentSize = CGSize(width: params.width, height: titleLayout.size.height + textLayout.size.height + 36.0) @@ -320,7 +320,7 @@ class InfoItemNode: ListViewItemNode { strongSelf.closeButton.isHidden = item.closeAction == nil - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -338,7 +338,7 @@ class InfoItemNode: ListViewItemNode { strongSelf.closeButton.setImage(updatedCloseIcon, for: []) } - strongSelf.badgeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 15.0), size: CGSize(width: badgeDiameter, height: badgeDiameter)) + strongSelf.badgeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 15.0 + floor((titleLayout.size.height - badgeDiameter) / 2.0)), size: CGSize(width: badgeDiameter, height: badgeDiameter)) strongSelf.labelNode.frame = CGRect(origin: CGPoint(x: strongSelf.badgeNode.frame.midX - labelLayout.size.width / 2.0, y: strongSelf.badgeNode.frame.minY + 1.0), size: labelLayout.size) @@ -420,7 +420,7 @@ class InfoItemNode: ListViewItemNode { if let current = self.linkHighlightingNode { linkHighlightingNode = current } else { - linkHighlightingNode = LinkHighlightingNode(color: item.theme.list.itemAccentColor.withAlphaComponent(0.5)) + linkHighlightingNode = LinkHighlightingNode(color: item.presentationData.theme.list.itemAccentColor.withAlphaComponent(0.5)) self.linkHighlightingNode = linkHighlightingNode self.insertSubnode(linkHighlightingNode, belowSubnode: self.textNode) } diff --git a/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift b/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift index 078dd251e0..b16081b935 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift @@ -33,7 +33,7 @@ public struct ItemListMultilineInputInlineAction { } public class ItemListMultilineInputItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let text: String let placeholder: String public let sectionId: ItemListSectionId @@ -51,8 +51,8 @@ public class ItemListMultilineInputItem: ListViewItem, ItemListItem { let inlineAction: ItemListMultilineInputInlineAction? public let tag: ItemListItemTag? - public init(theme: PresentationTheme, text: String, placeholder: String, maxLength: ItemListMultilineInputItemTextLimit?, sectionId: ItemListSectionId, style: ItemListStyle, capitalization: Bool = true, autocorrection: Bool = true, returnKeyType: UIReturnKeyType = .default, minimalHeight: CGFloat? = nil, textUpdated: @escaping (String) -> Void, shouldUpdateText: @escaping (String) -> Bool = { _ in return true }, processPaste: ((String) -> Void)? = nil, updatedFocus: ((Bool) -> Void)? = nil, tag: ItemListItemTag? = nil, action: (() -> Void)? = nil, inlineAction: ItemListMultilineInputInlineAction? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, text: String, placeholder: String, maxLength: ItemListMultilineInputItemTextLimit?, sectionId: ItemListSectionId, style: ItemListStyle, capitalization: Bool = true, autocorrection: Bool = true, returnKeyType: UIReturnKeyType = .default, minimalHeight: CGFloat? = nil, textUpdated: @escaping (String) -> Void, shouldUpdateText: @escaping (String) -> Bool = { _ in return true }, processPaste: ((String) -> Void)? = nil, updatedFocus: ((Bool) -> Void)? = nil, tag: ItemListItemTag? = nil, action: (() -> Void)? = nil, inlineAction: ItemListMultilineInputInlineAction? = nil) { + self.presentationData = presentationData self.text = text self.placeholder = placeholder self.maxLength = maxLength @@ -105,8 +105,6 @@ public class ItemListMultilineInputItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNodeDelegate, ItemListItemNode, ItemListItemFocusableNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -159,9 +157,11 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod var textColor: UIColor = .black if let item = self.item { - textColor = item.theme.list.itemPrimaryTextColor + textColor = item.presentationData.theme.list.itemPrimaryTextColor + self.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), NSAttributedString.Key.foregroundColor.rawValue: textColor] + } else { + self.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(17.0), NSAttributedString.Key.foregroundColor.rawValue: textColor] } - self.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(17.0), NSAttributedString.Key.foregroundColor.rawValue: textColor] self.textNode.clipsToBounds = true self.textNode.delegate = self self.textNode.hitTestSlop = UIEdgeInsets(top: -5.0, left: -5.0, bottom: -5.0, right: -5.0) @@ -175,8 +175,8 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod return { item, params, neighbors in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } let itemBackgroundColor: UIColor @@ -185,11 +185,11 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod let leftInset = 16.0 + params.rightInset switch item.style { case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor } var limitTextString: NSAttributedString? @@ -206,7 +206,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod let displayTextLimit = textLength > maxLength.value * 70 / 100 let remainingCount = maxLength.value - textLength if displayTextLimit { - limitTextString = NSAttributedString(string: "\(remainingCount)", font: Font.regular(13.0), textColor: remainingCount < 0 ? item.theme.list.itemDestructiveColor : item.theme.list.itemSecondaryTextColor) + limitTextString = NSAttributedString(string: "\(remainingCount)", font: Font.regular(13.0), textColor: remainingCount < 0 ? item.presentationData.theme.list.itemDestructiveColor : item.presentationData.theme.list.itemSecondaryTextColor) } rightInset += 30.0 + 4.0 @@ -226,8 +226,8 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod if measureText.hasSuffix("\n") || measureText.isEmpty { measureText += "|" } - let attributedMeasureText = NSAttributedString(string: measureText, font: Font.regular(17.0), textColor: .black) - let attributedText = NSAttributedString(string: item.text, font: Font.regular(17.0), textColor: item.theme.list.itemPrimaryTextColor) + let attributedMeasureText = NSAttributedString(string: measureText, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: .black) + let attributedText = NSAttributedString(string: item.text, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPrimaryTextColor) let (textLayout, textApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: attributedMeasureText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - 16.0 - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, lineSpacing: 0.0, cutout: nil, insets: UIEdgeInsets())) let separatorHeight = UIScreenPixel @@ -246,7 +246,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) let layoutSize = layout.size - let attributedPlaceholderText = NSAttributedString(string: item.placeholder, font: Font.regular(17.0), textColor: item.theme.list.itemPlaceholderTextColor) + let attributedPlaceholderText = NSAttributedString(string: item.placeholder, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPlaceholderTextColor) return (layout, { [weak self] in if let strongSelf = self { @@ -259,12 +259,12 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod strongSelf.backgroundNode.backgroundColor = itemBackgroundColor if strongSelf.isNodeLoaded { - strongSelf.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(17.0), NSAttributedString.Key.foregroundColor.rawValue: item.theme.list.itemPrimaryTextColor] - strongSelf.textNode.tintColor = item.theme.list.itemAccentColor + strongSelf.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), NSAttributedString.Key.foregroundColor.rawValue: item.presentationData.theme.list.itemPrimaryTextColor] + strongSelf.textNode.tintColor = item.presentationData.theme.list.itemAccentColor } if let inlineAction = item.inlineAction { - strongSelf.inlineActionButtonNode?.setImage(generateTintedImage(image: inlineAction.icon, color: item.theme.list.itemAccentColor), for: .normal) + strongSelf.inlineActionButtonNode?.setImage(generateTintedImage(image: inlineAction.icon, color: item.presentationData.theme.list.itemAccentColor), for: .normal) } } @@ -323,7 +323,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -334,7 +334,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod strongSelf.textNode.attributedPlaceholderText = attributedPlaceholderText } - strongSelf.textNode.keyboardAppearance = item.theme.rootController.keyboardColor.keyboardAppearance + strongSelf.textNode.keyboardAppearance = item.presentationData.theme.rootController.keyboardColor.keyboardAppearance strongSelf.textClippingNode.frame = CGRect(origin: CGPoint(x: leftInset, y: textTopInset), size: CGSize(width: params.width - leftInset - params.rightInset, height: textLayout.size.height)) strongSelf.textNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: params.width - leftInset - 16.0 - rightInset, height: textLayout.size.height + 1.0)) @@ -355,7 +355,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod inlineActionButtonNode = currentInlineActionButtonNode } else { inlineActionButtonNode = HighlightableButtonNode() - inlineActionButtonNode.setImage(generateTintedImage(image: inlineAction.icon, color: item.theme.list.itemAccentColor), for: .normal) + inlineActionButtonNode.setImage(generateTintedImage(image: inlineAction.icon, color: item.presentationData.theme.list.itemAccentColor), for: .normal) inlineActionButtonNode.addTarget(strongSelf, action: #selector(strongSelf.inlineActionPressed), forControlEvents: .touchUpInside) strongSelf.addSubnode(inlineActionButtonNode) strongSelf.inlineActionButtonNode = inlineActionButtonNode @@ -431,7 +431,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod if let item = self.item { if let text = self.textNode.attributedText { let updatedText = text.string - let updatedAttributedText = NSAttributedString(string: updatedText, font: Font.regular(17.0), textColor: item.theme.list.itemPrimaryTextColor) + let updatedAttributedText = NSAttributedString(string: updatedText, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPrimaryTextColor) if text.string != updatedAttributedText.string { self.textNode.attributedText = updatedAttributedText } diff --git a/submodules/ItemListUI/Sources/Items/ItemListMultilineTextItem.swift b/submodules/ItemListUI/Sources/Items/ItemListMultilineTextItem.swift index 7939fbb159..608641f99a 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListMultilineTextItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListMultilineTextItem.swift @@ -13,7 +13,7 @@ public enum ItemListMultilineTextBaseFont { } public class ItemListMultilineTextItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let text: String let enabledEntityTypes: EnabledEntityTypes let font: ItemListMultilineTextBaseFont @@ -27,8 +27,8 @@ public class ItemListMultilineTextItem: ListViewItem, ItemListItem { public let selectable: Bool - public init(theme: PresentationTheme, text: String, enabledEntityTypes: EnabledEntityTypes, font: ItemListMultilineTextBaseFont = .default, sectionId: ItemListSectionId, style: ItemListStyle, action: (() -> Void)? = nil, longTapAction: (() -> Void)? = nil, linkItemAction: ((TextLinkItemActionType, TextLinkItem) -> Void)? = nil, tag: Any? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, text: String, enabledEntityTypes: EnabledEntityTypes, font: ItemListMultilineTextBaseFont = .default, sectionId: ItemListSectionId, style: ItemListStyle, action: (() -> Void)? = nil, longTapAction: (() -> Void)? = nil, linkItemAction: ((TextLinkItemActionType, TextLinkItem) -> Void)? = nil, tag: Any? = nil) { + self.presentationData = presentationData self.text = text self.enabledEntityTypes = enabledEntityTypes self.font = font @@ -81,12 +81,6 @@ public class ItemListMultilineTextItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) -private let titleBoldFont = Font.medium(17.0) -private let titleItalicFont = Font.italic(17.0) -private let titleBoldItalicFont = Font.semiboldItalic(17.0) -private let titleFixedFont = Font.regular(17.0) - public class ItemListMultilineTextItemNode: ListViewItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -165,11 +159,11 @@ public class ItemListMultilineTextItemNode: ListViewItemNode { return { item, params, neighbors in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } - let textColor: UIColor = item.theme.list.itemPrimaryTextColor + let textColor: UIColor = item.presentationData.theme.list.itemPrimaryTextColor let leftInset: CGFloat let itemBackgroundColor: UIColor @@ -177,30 +171,33 @@ public class ItemListMultilineTextItemNode: ListViewItemNode { switch item.style { case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor leftInset = 16.0 + params.leftInset case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor leftInset = 16.0 + params.rightInset } - var baseFont = titleFont - var linkFont = titleFont - var boldFont = titleBoldFont - var italicFont = titleItalicFont - var boldItalicFont = titleBoldItalicFont + let fontSize = item.presentationData.fontSize.itemListBaseFontSize + + var baseFont = Font.regular(fontSize) + var linkFont = baseFont + var boldFont = Font.medium(fontSize) + var italicFont = Font.italic(fontSize) + var boldItalicFont = Font.semiboldItalic(fontSize) + let titleFixedFont = Font.monospace(fontSize) if case .monospace = item.font { - baseFont = Font.monospace(17.0) - linkFont = Font.monospace(17.0) - boldFont = Font.semiboldMonospace(17.0) - italicFont = Font.italicMonospace(17.0) - boldItalicFont = Font.semiboldItalicMonospace(17.0) + baseFont = Font.monospace(fontSize) + linkFont = Font.monospace(fontSize) + boldFont = Font.semiboldMonospace(fontSize) + italicFont = Font.italicMonospace(fontSize) + boldItalicFont = Font.semiboldItalicMonospace(fontSize) } let entities = generateTextEntities(item.text, enabledTypes: item.enabledEntityTypes) - let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: textColor, linkColor: item.theme.list.itemAccentColor, baseFont: baseFont, linkFont: linkFont, boldFont: boldFont, italicFont: italicFont, boldItalicFont: boldItalicFont, fixedFont: titleFixedFont, blockQuoteFont: titleFont) + let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: textColor, linkColor: item.presentationData.theme.list.itemAccentColor, baseFont: baseFont, linkFont: linkFont, boldFont: boldFont, italicFont: italicFont, boldItalicFont: boldItalicFont, fixedFont: titleFixedFont, blockQuoteFont: baseFont) let (titleLayout, titleApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: string, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset * 2.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) @@ -231,7 +228,7 @@ public class ItemListMultilineTextItemNode: ListViewItemNode { strongSelf.topStripeNode.backgroundColor = itemSeparatorColor strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() @@ -289,7 +286,7 @@ public class ItemListMultilineTextItemNode: ListViewItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -416,7 +413,7 @@ public class ItemListMultilineTextItemNode: ListViewItemNode { if let current = self.linkHighlightingNode { linkHighlightingNode = current } else { - linkHighlightingNode = LinkHighlightingNode(color: item.theme.list.itemAccentColor.withAlphaComponent(0.5)) + linkHighlightingNode = LinkHighlightingNode(color: item.presentationData.theme.list.itemAccentColor.withAlphaComponent(0.5)) self.linkHighlightingNode = linkHighlightingNode self.insertSubnode(linkHighlightingNode, belowSubnode: self.textNode) } diff --git a/submodules/ItemListUI/Sources/Items/ItemListSectionHeaderItem.swift b/submodules/ItemListUI/Sources/Items/ItemListSectionHeaderItem.swift index 18d396b2b8..7433ec6112 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListSectionHeaderItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListSectionHeaderItem.swift @@ -39,7 +39,7 @@ public enum ItemListSectionHeaderActivityIndicator { } public class ItemListSectionHeaderItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let text: String let multiline: Bool let activityIndicator: ItemListSectionHeaderActivityIndicator @@ -48,8 +48,8 @@ public class ItemListSectionHeaderItem: ListViewItem, ItemListItem { public let isAlwaysPlain: Bool = true - public init(theme: PresentationTheme, text: String, multiline: Bool = false, activityIndicator: ItemListSectionHeaderActivityIndicator = .none, accessoryText: ItemListSectionHeaderAccessoryText? = nil, sectionId: ItemListSectionId) { - self.theme = theme + public init(presentationData: ItemListPresentationData, text: String, multiline: Bool = false, activityIndicator: ItemListSectionHeaderActivityIndicator = .none, accessoryText: ItemListSectionHeaderAccessoryText? = nil, sectionId: ItemListSectionId) { + self.presentationData = presentationData self.text = text self.multiline = multiline self.activityIndicator = activityIndicator @@ -93,8 +93,6 @@ public class ItemListSectionHeaderItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(14.0) - public class ItemListSectionHeaderItemNode: ListViewItemNode { private var item: ItemListSectionHeaderItem? @@ -135,16 +133,18 @@ public class ItemListSectionHeaderItemNode: ListViewItemNode { return { item, params, neighbors in let leftInset: CGFloat = 15.0 + params.leftInset - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.text, font: titleFont, textColor: item.theme.list.sectionHeaderTextColor), backgroundColor: nil, maximumNumberOfLines: item.multiline ? 0 : 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseHeaderFontSize) + + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.text, font: titleFont, textColor: item.presentationData.theme.list.sectionHeaderTextColor), backgroundColor: nil, maximumNumberOfLines: item.multiline ? 0 : 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 20.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) var accessoryTextString: NSAttributedString? var accessoryIcon: UIImage? if let accessoryText = item.accessoryText { let color: UIColor switch accessoryText.color { - case .generic: - color = item.theme.list.sectionHeaderTextColor - case .destructive: - color = item.theme.list.freeTextErrorColor + case .generic: + color = item.presentationData.theme.list.sectionHeaderTextColor + case .destructive: + color = item.presentationData.theme.list.freeTextErrorColor } accessoryTextString = NSAttributedString(string: accessoryText.value, font: titleFont, textColor: color) accessoryIcon = accessoryText.icon @@ -208,7 +208,7 @@ public class ItemListSectionHeaderItemNode: ListViewItemNode { if let currentActivityIndicator = strongSelf.activityIndicator { activityIndicator = currentActivityIndicator } else { - activityIndicator = ActivityIndicator(type: .custom(item.theme.list.sectionHeaderTextColor, 18.0, 1.0, false)) + activityIndicator = ActivityIndicator(type: .custom(item.presentationData.theme.list.sectionHeaderTextColor, 18.0, 1.0, false)) strongSelf.addSubnode(activityIndicator) strongSelf.activityIndicator = activityIndicator } @@ -227,12 +227,12 @@ public class ItemListSectionHeaderItemNode: ListViewItemNode { var activityIndicatorOrigin: CGPoint? switch item.activityIndicator { - case .left: - activityIndicatorOrigin = CGPoint(x: strongSelf.titleNode.frame.maxX + 6.0, y: 7.0 - UIScreenPixel) - case .right: - activityIndicatorOrigin = CGPoint(x: params.width - leftInset - 18.0, y: 7.0 - UIScreenPixel) - default: - break + case .left: + activityIndicatorOrigin = CGPoint(x: strongSelf.titleNode.frame.maxX + 6.0, y: 7.0 - UIScreenPixel) + case .right: + activityIndicatorOrigin = CGPoint(x: params.width - leftInset - 18.0, y: 7.0 - UIScreenPixel) + default: + break } if let activityIndicatorOrigin = activityIndicatorOrigin { strongSelf.activityIndicator?.frame = CGRect(origin: activityIndicatorOrigin, size: CGSize(width: 18.0, height: 18.0)) diff --git a/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift b/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift index 3dda105fc4..d1728dc26a 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift @@ -30,8 +30,7 @@ public enum ItemListSingleLineInputClearType: Equatable { } public class ItemListSingleLineInputItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let title: NSAttributedString let text: String let placeholder: String @@ -48,9 +47,8 @@ public class ItemListSingleLineInputItem: ListViewItem, ItemListItem { let updatedFocus: ((Bool) -> Void)? public let tag: ItemListItemTag? - public init(theme: PresentationTheme, strings: PresentationStrings, title: NSAttributedString, text: String, placeholder: String, type: ItemListSingleLineInputItemType = .regular(capitalization: true, autocorrection: true), returnKeyType: UIReturnKeyType = .`default`, spacing: CGFloat = 0.0, clearType: ItemListSingleLineInputClearType = .none, enabled: Bool = true, tag: ItemListItemTag? = nil, sectionId: ItemListSectionId, textUpdated: @escaping (String) -> Void, shouldUpdateText: @escaping (String) -> Bool = { _ in return true }, processPaste: ((String) -> String)? = nil, updatedFocus: ((Bool) -> Void)? = nil, action: @escaping () -> Void) { - self.theme = theme - self.strings = strings + public init(presentationData: ItemListPresentationData, title: NSAttributedString, text: String, placeholder: String, type: ItemListSingleLineInputItemType = .regular(capitalization: true, autocorrection: true), returnKeyType: UIReturnKeyType = .`default`, spacing: CGFloat = 0.0, clearType: ItemListSingleLineInputClearType = .none, enabled: Bool = true, tag: ItemListItemTag? = nil, sectionId: ItemListSectionId, textUpdated: @escaping (String) -> Void, shouldUpdateText: @escaping (String) -> Bool = { _ in return true }, processPaste: ((String) -> String)? = nil, updatedFocus: ((Bool) -> Void)? = nil, action: @escaping () -> Void) { + self.presentationData = presentationData self.title = title self.text = text self.placeholder = placeholder @@ -103,8 +101,6 @@ public class ItemListSingleLineInputItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDelegate, ItemListItemNode, ItemListItemFocusableNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -168,14 +164,19 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg override public func didLoad() { super.didLoad() - self.textNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(17.0)] - self.textNode.textField.font = Font.regular(17.0) if let item = self.item { - self.textNode.textField.textColor = item.theme.list.itemPrimaryTextColor - self.textNode.textField.keyboardAppearance = item.theme.rootController.keyboardColor.keyboardAppearance - self.textNode.textField.tintColor = item.theme.list.itemAccentColor + self.textNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize)] + self.textNode.textField.font = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + + self.textNode.textField.textColor = item.presentationData.theme.list.itemPrimaryTextColor + self.textNode.textField.keyboardAppearance = item.presentationData.theme.rootController.keyboardColor.keyboardAppearance + self.textNode.textField.tintColor = item.presentationData.theme.list.itemAccentColor self.textNode.textField.accessibilityHint = item.placeholder + } else { + self.textNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(17.0)] + self.textNode.textField.font = Font.regular(17.0) } + self.textNode.clipsToBounds = true self.textNode.textField.delegate = self self.textNode.textField.addTarget(self, action: #selector(self.textFieldTextChanged(_:)), for: .editingChanged) @@ -191,9 +192,14 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg var updatedTheme: PresentationTheme? var updatedClearIcon: UIImage? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme - updatedClearIcon = PresentationResourcesItemList.itemListClearInputIcon(item.theme) + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme + updatedClearIcon = PresentationResourcesItemList.itemListClearInputIcon(item.presentationData.theme) + } + + var fontUpdated = false + if currentItem?.presentationData.fontSize != item.presentationData.fontSize { + fontUpdated = true } let leftInset: CGFloat = 16.0 + params.leftInset @@ -205,32 +211,36 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg let titleString = NSMutableAttributedString(attributedString: item.title) titleString.removeAttribute(NSAttributedString.Key.font, range: NSMakeRange(0, titleString.length)) - titleString.addAttributes([NSAttributedString.Key.font: Font.regular(17.0)], range: NSMakeRange(0, titleString.length)) + titleString.addAttributes([NSAttributedString.Key.font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize)], range: NSMakeRange(0, titleString.length)) let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleString, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - 32.0 - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let separatorHeight = UIScreenPixel - let contentSize = CGSize(width: params.width, height: 44.0) + let contentSize = CGSize(width: params.width, height: titleLayout.size.height + 22.0) let insets = itemListNeighborsGroupedInsets(neighbors) let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) let layoutSize = layout.size - let attributedPlaceholderText = NSAttributedString(string: item.placeholder, font: Font.regular(17.0), textColor: item.theme.list.itemPlaceholderTextColor) + let attributedPlaceholderText = NSAttributedString(string: item.placeholder, font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize), textColor: item.presentationData.theme.list.itemPlaceholderTextColor) return (layout, { [weak self] in if let strongSelf = self { strongSelf.item = item if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor - strongSelf.textNode.textField.textColor = item.theme.list.itemPrimaryTextColor - strongSelf.textNode.textField.keyboardAppearance = item.theme.rootController.keyboardColor.keyboardAppearance - strongSelf.textNode.textField.tintColor = item.theme.list.itemAccentColor + strongSelf.textNode.textField.textColor = item.presentationData.theme.list.itemPrimaryTextColor + strongSelf.textNode.textField.keyboardAppearance = item.presentationData.theme.rootController.keyboardColor.keyboardAppearance + strongSelf.textNode.textField.tintColor = item.presentationData.theme.list.itemAccentColor + } + + if fontUpdated { + strongSelf.textNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(item.presentationData.fontSize.itemListBaseFontSize)] } let _ = titleApply() @@ -242,40 +252,40 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg let keyboardType: UIKeyboardType switch item.type { - case let .regular(capitalization, autocorrection): - secureEntry = false - capitalizationType = capitalization ? .sentences : .none - autocorrectionType = autocorrection ? .default : .no - keyboardType = .default - case .email: - secureEntry = false - capitalizationType = .none - autocorrectionType = .no - keyboardType = .emailAddress - case .password: - secureEntry = true - capitalizationType = .none - autocorrectionType = .no - keyboardType = .default - case .number: - secureEntry = false - capitalizationType = .none - autocorrectionType = .no - if #available(iOSApplicationExtension 10.0, iOS 10.0, *) { - keyboardType = .asciiCapableNumberPad - } else { - keyboardType = .numberPad - } - case .decimal: - secureEntry = false - capitalizationType = .none - autocorrectionType = .no - keyboardType = .decimalPad - case .username: - secureEntry = false - capitalizationType = .none - autocorrectionType = .no - keyboardType = .asciiCapable + case let .regular(capitalization, autocorrection): + secureEntry = false + capitalizationType = capitalization ? .sentences : .none + autocorrectionType = autocorrection ? .default : .no + keyboardType = .default + case .email: + secureEntry = false + capitalizationType = .none + autocorrectionType = .no + keyboardType = .emailAddress + case .password: + secureEntry = true + capitalizationType = .none + autocorrectionType = .no + keyboardType = .default + case .number: + secureEntry = false + capitalizationType = .none + autocorrectionType = .no + if #available(iOSApplicationExtension 10.0, iOS 10.0, *) { + keyboardType = .asciiCapableNumberPad + } else { + keyboardType = .numberPad + } + case .decimal: + secureEntry = false + capitalizationType = .none + autocorrectionType = .no + keyboardType = .decimalPad + case .username: + secureEntry = false + capitalizationType = .none + autocorrectionType = .no + keyboardType = .asciiCapable } if strongSelf.textNode.textField.isSecureTextEntry != secureEntry { @@ -302,7 +312,7 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg strongSelf.textNode.textField.text = item.text } - strongSelf.textNode.frame = CGRect(origin: CGPoint(x: leftInset + titleLayout.size.width + item.spacing, y: floor((layout.contentSize.height - 40.0) / 2.0)), size: CGSize(width: max(1.0, params.width - (leftInset + rightInset + titleLayout.size.width + item.spacing)), height: 40.0)) + strongSelf.textNode.frame = CGRect(origin: CGPoint(x: leftInset + titleLayout.size.width + item.spacing, y: 1.0), size: CGSize(width: max(1.0, params.width - (leftInset + rightInset + titleLayout.size.width + item.spacing)), height: layout.contentSize.height - 2.0)) if let image = updatedClearIcon { strongSelf.clearIconNode.image = image @@ -349,7 +359,7 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -364,7 +374,7 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg strongSelf.textNode.isUserInteractionEnabled = item.enabled strongSelf.textNode.alpha = item.enabled ? 1.0 : 0.4 - strongSelf.clearButtonNode.accessibilityLabel = item.strings.VoiceOver_Editing_ClearText + strongSelf.clearButtonNode.accessibilityLabel = item.presentationData.strings.VoiceOver_Editing_ClearText } }) } diff --git a/submodules/ItemListUI/Sources/Items/ItemListSwitchItem.swift b/submodules/ItemListUI/Sources/Items/ItemListSwitchItem.swift index f94511e73c..ff70e9abcb 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListSwitchItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListSwitchItem.swift @@ -12,12 +12,13 @@ public enum ItemListSwitchItemNodeType { } public class ItemListSwitchItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let title: String let value: Bool let type: ItemListSwitchItemNodeType let enableInteractiveChanges: Bool let enabled: Bool + let disableLeadingInset: Bool let maximumNumberOfLines: Int public let sectionId: ItemListSectionId let style: ItemListStyle @@ -25,13 +26,14 @@ public class ItemListSwitchItem: ListViewItem, ItemListItem { let activatedWhileDisabled: () -> Void public let tag: ItemListItemTag? - public init(theme: PresentationTheme, title: String, value: Bool, type: ItemListSwitchItemNodeType = .regular, enableInteractiveChanges: Bool = true, enabled: Bool = true, maximumNumberOfLines: Int = 1, sectionId: ItemListSectionId, style: ItemListStyle, updated: @escaping (Bool) -> Void, activatedWhileDisabled: @escaping () -> Void = {}, tag: ItemListItemTag? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, title: String, value: Bool, type: ItemListSwitchItemNodeType = .regular, enableInteractiveChanges: Bool = true, enabled: Bool = true, disableLeadingInset: Bool = false, maximumNumberOfLines: Int = 1, sectionId: ItemListSectionId, style: ItemListStyle, updated: @escaping (Bool) -> Void, activatedWhileDisabled: @escaping () -> Void = {}, tag: ItemListItemTag? = nil) { + self.presentationData = presentationData self.title = title self.value = value self.type = type self.enableInteractiveChanges = enableInteractiveChanges self.enabled = enabled + self.disableLeadingInset = disableLeadingInset self.maximumNumberOfLines = maximumNumberOfLines self.sectionId = sectionId self.style = style @@ -78,8 +80,6 @@ public class ItemListSwitchItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) - private protocol ItemListSwitchNodeImpl { var frameColor: UIColor { get set } var contentColor: UIColor { get set } @@ -131,7 +131,7 @@ public class ItemListSwitchItemNode: ListViewItemNode, ItemListItemNode { return self.item?.tag } - init(type: ItemListSwitchItemNodeType) { + public init(type: ItemListSwitchItemNodeType) { self.backgroundNode = ASDisplayNode() self.backgroundNode.isLayerBacked = true self.backgroundNode.backgroundColor = .white @@ -195,31 +195,38 @@ public class ItemListSwitchItemNode: ListViewItemNode, ItemListItemNode { return { item, params, neighbors in var contentSize: CGSize - let insets: UIEdgeInsets + var insets: UIEdgeInsets let separatorHeight = UIScreenPixel let itemBackgroundColor: UIColor let itemSeparatorColor: UIColor + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } switch item.style { - case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor - contentSize = CGSize(width: params.width, height: 44.0) - insets = itemListNeighborsPlainInsets(neighbors) - case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor - contentSize = CGSize(width: params.width, height: 44.0) - insets = itemListNeighborsGroupedInsets(neighbors) + case .plain: + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor + contentSize = CGSize(width: params.width, height: 44.0) + insets = itemListNeighborsPlainInsets(neighbors) + case .blocks: + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor + contentSize = CGSize(width: params.width, height: 44.0) + insets = itemListNeighborsGroupedInsets(neighbors) } - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: item.maximumNumberOfLines, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 80.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + if item.disableLeadingInset { + insets.top = 0.0 + insets.bottom = 0.0 + } + + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: item.maximumNumberOfLines, truncationType: .end, constrainedSize: CGSize(width: params.width - params.leftInset - params.rightInset - 80.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) contentSize.height = max(contentSize.height, titleLayout.size.height + 22.0) @@ -280,13 +287,13 @@ public class ItemListSwitchItemNode: ListViewItemNode, ItemListItemNode { strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor strongSelf.backgroundNode.backgroundColor = itemBackgroundColor - strongSelf.switchNode.frameColor = item.theme.list.itemSwitchColors.frameColor - strongSelf.switchNode.contentColor = item.theme.list.itemSwitchColors.contentColor - strongSelf.switchNode.handleColor = item.theme.list.itemSwitchColors.handleColor - strongSelf.switchNode.positiveContentColor = item.theme.list.itemSwitchColors.positiveColor - strongSelf.switchNode.negativeContentColor = item.theme.list.itemSwitchColors.negativeColor + strongSelf.switchNode.frameColor = item.presentationData.theme.list.itemSwitchColors.frameColor + strongSelf.switchNode.contentColor = item.presentationData.theme.list.itemSwitchColors.contentColor + strongSelf.switchNode.handleColor = item.presentationData.theme.list.itemSwitchColors.handleColor + strongSelf.switchNode.positiveContentColor = item.presentationData.theme.list.itemSwitchColors.positiveColor + strongSelf.switchNode.negativeContentColor = item.presentationData.theme.list.itemSwitchColors.negativeColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() @@ -342,7 +349,7 @@ public class ItemListSwitchItemNode: ListViewItemNode, ItemListItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) @@ -357,7 +364,7 @@ public class ItemListSwitchItemNode: ListViewItemNode, ItemListItemNode { } let switchSize = switchView.bounds.size - strongSelf.switchNode.frame = CGRect(origin: CGPoint(x: params.width - params.rightInset - switchSize.width - 15.0, y: 6.0), size: switchSize) + strongSelf.switchNode.frame = CGRect(origin: CGPoint(x: params.width - params.rightInset - switchSize.width - 15.0, y: floor((contentSize.height - switchSize.height) / 2.0)), size: switchSize) strongSelf.switchGestureNode.frame = strongSelf.switchNode.frame if switchView.isOn != item.value { switchView.setOn(item.value, animated: animated) diff --git a/submodules/ItemListUI/Sources/Items/ItemListTextItem.swift b/submodules/ItemListUI/Sources/Items/ItemListTextItem.swift index 6f67e65615..93e9f27da9 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListTextItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListTextItem.swift @@ -17,15 +17,15 @@ public enum ItemListTextItemLinkAction { } public class ItemListTextItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData let text: ItemListTextItemText public let sectionId: ItemListSectionId let linkAction: ((ItemListTextItemLinkAction) -> Void)? let style: ItemListStyle public let isAlwaysPlain: Bool = true - public init(theme: PresentationTheme, text: ItemListTextItemText, sectionId: ItemListSectionId, linkAction: ((ItemListTextItemLinkAction) -> Void)? = nil, style: ItemListStyle = .blocks) { - self.theme = theme + public init(presentationData: ItemListPresentationData, text: ItemListTextItemText, sectionId: ItemListSectionId, linkAction: ((ItemListTextItemLinkAction) -> Void)? = nil, style: ItemListStyle = .blocks) { + self.presentationData = presentationData self.text = text self.sectionId = sectionId self.linkAction = linkAction @@ -69,9 +69,6 @@ public class ItemListTextItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(14.0) -private let titleBoldFont = Font.semibold(14.0) - public class ItemListTextItemNode: ListViewItemNode { private let titleNode: TextNode private let activateArea: AccessibilityAreaNode @@ -110,14 +107,17 @@ public class ItemListTextItemNode: ListViewItemNode { let leftInset: CGFloat = 15.0 + params.leftInset let verticalInset: CGFloat = 7.0 + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseHeaderFontSize) + let titleBoldFont = Font.semibold(item.presentationData.fontSize.itemListBaseHeaderFontSize) + let attributedText: NSAttributedString switch item.text { - case let .plain(text): - attributedText = NSAttributedString(string: text, font: titleFont, textColor: item.theme.list.freeTextColor) - case let .markdown(text): - attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: MarkdownAttributeSet(font: titleFont, textColor: item.theme.list.freeTextColor), bold: MarkdownAttributeSet(font: titleBoldFont, textColor: item.theme.list.freeTextColor), link: MarkdownAttributeSet(font: titleFont, textColor: item.theme.list.itemAccentColor), linkAttribute: { contents in - return (TelegramTextAttributes.URL, contents) - })) + case let .plain(text): + attributedText = NSAttributedString(string: text, font: titleFont, textColor: item.presentationData.theme.list.freeTextColor) + case let .markdown(text): + attributedText = parseMarkdownIntoAttributedString(text, attributes: MarkdownAttributes(body: MarkdownAttributeSet(font: titleFont, textColor: item.presentationData.theme.list.freeTextColor), bold: MarkdownAttributeSet(font: titleBoldFont, textColor: item.presentationData.theme.list.freeTextColor), link: MarkdownAttributeSet(font: titleFont, textColor: item.presentationData.theme.list.itemAccentColor), linkAttribute: { contents in + return (TelegramTextAttributes.URL, contents) + })) } let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - leftInset * 2.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) diff --git a/submodules/ItemListUI/Sources/Items/ItemListTextWithLabelItem.swift b/submodules/ItemListUI/Sources/Items/ItemListTextWithLabelItem.swift index 3d12ca8e31..a54f938957 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListTextWithLabelItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListTextWithLabelItem.swift @@ -14,7 +14,7 @@ public enum ItemListTextWithLabelItemTextColor { } public final class ItemListTextWithLabelItem: ListViewItem, ItemListItem { - let theme: PresentationTheme + let presentationData: ItemListPresentationData public let label: String public let text: String let style: ItemListStyle @@ -30,8 +30,8 @@ public final class ItemListTextWithLabelItem: ListViewItem, ItemListItem { public let tag: Any? - public init(theme: PresentationTheme, label: String, text: String, style: ItemListStyle = .plain, labelColor: ItemListTextWithLabelItemTextColor = .primary, textColor: ItemListTextWithLabelItemTextColor = .primary, enabledEntityTypes: EnabledEntityTypes, multiline: Bool, selected: Bool? = nil, sectionId: ItemListSectionId, action: (() -> Void)?, longTapAction: (() -> Void)? = nil, linkItemAction: ((TextLinkItemActionType, TextLinkItem) -> Void)? = nil, tag: Any? = nil) { - self.theme = theme + public init(presentationData: ItemListPresentationData, label: String, text: String, style: ItemListStyle = .plain, labelColor: ItemListTextWithLabelItemTextColor = .primary, textColor: ItemListTextWithLabelItemTextColor = .primary, enabledEntityTypes: EnabledEntityTypes, multiline: Bool, selected: Bool? = nil, sectionId: ItemListSectionId, action: (() -> Void)?, longTapAction: (() -> Void)? = nil, linkItemAction: ((TextLinkItemActionType, TextLinkItem) -> Void)? = nil, tag: Any? = nil) { + self.presentationData = presentationData self.label = label self.text = text self.style = style @@ -90,13 +90,6 @@ public final class ItemListTextWithLabelItem: ListViewItem, ItemListItem { } } -private let labelFont = Font.regular(14.0) -private let textFont = Font.regular(17.0) -private let textBoldFont = Font.medium(17.0) -private let textItalicFont = Font.italic(17.0) -private let textBoldItalicFont = Font.semiboldItalic(17.0) -private let textFixedFont = Font.regular(17.0) - public class ItemListTextWithLabelItemNode: ListViewItemNode { let labelNode: TextNode let textNode: TextNode @@ -173,8 +166,8 @@ public class ItemListTextWithLabelItemNode: ListViewItemNode { return { item, params, neighbors in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } let insets = itemListNeighborsPlainInsets(neighbors) @@ -182,39 +175,46 @@ public class ItemListTextWithLabelItemNode: ListViewItemNode { let rightInset: CGFloat = 8.0 + params.rightInset let separatorHeight = UIScreenPixel + let labelFont = Font.regular(item.presentationData.fontSize.itemListBaseLabelFontSize) + let textFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + let textBoldFont = Font.medium(item.presentationData.fontSize.itemListBaseFontSize) + let textItalicFont = Font.italic(item.presentationData.fontSize.itemListBaseFontSize) + let textBoldItalicFont = Font.semiboldItalic(item.presentationData.fontSize.itemListBaseFontSize) + let textFixedFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + var leftOffset: CGFloat = 0.0 var selectionNodeWidthAndApply: (CGFloat, (CGSize, Bool) -> ItemListSelectableControlNode)? if let selected = item.selected { - let (selectionWidth, selectionApply) = selectionNodeLayout(item.theme.list.itemCheckColors.strokeColor, item.theme.list.itemCheckColors.fillColor, item.theme.list.itemCheckColors.foregroundColor, selected, false) + let (selectionWidth, selectionApply) = selectionNodeLayout(item.presentationData.theme.list.itemCheckColors.strokeColor, item.presentationData.theme.list.itemCheckColors.fillColor, item.presentationData.theme.list.itemCheckColors.foregroundColor, selected, false) selectionNodeWidthAndApply = (selectionWidth, selectionApply) leftOffset += selectionWidth - 8.0 } let labelColor: UIColor switch item.labelColor { - case .primary: - labelColor = item.theme.list.itemPrimaryTextColor - case .accent: - labelColor = item.theme.list.itemAccentColor - case .highlighted: - labelColor = item.theme.list.itemHighlightedColor + case .primary: + labelColor = item.presentationData.theme.list.itemPrimaryTextColor + case .accent: + labelColor = item.presentationData.theme.list.itemAccentColor + case .highlighted: + labelColor = item.presentationData.theme.list.itemHighlightedColor } let (labelLayout, labelApply) = makeLabelLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.label, font: labelFont, textColor: labelColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftOffset - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let entities = generateTextEntities(item.text, enabledTypes: item.enabledEntityTypes) let baseColor: UIColor switch item.textColor { - case .primary: - baseColor = item.theme.list.itemPrimaryTextColor - case .accent: - baseColor = item.theme.list.itemAccentColor - case .highlighted: - baseColor = item.theme.list.itemHighlightedColor + case .primary: + baseColor = item.presentationData.theme.list.itemPrimaryTextColor + case .accent: + baseColor = item.presentationData.theme.list.itemAccentColor + case .highlighted: + baseColor = item.presentationData.theme.list.itemHighlightedColor } - let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: baseColor, linkColor: item.theme.list.itemAccentColor, baseFont: textFont, linkFont: textFont, boldFont: textBoldFont, italicFont: textItalicFont, boldItalicFont: textBoldItalicFont, fixedFont: textFixedFont, blockQuoteFont: textFont) + let string = stringWithAppliedEntities(item.text, entities: entities, baseColor: baseColor, linkColor: item.presentationData.theme.list.itemAccentColor, baseFont: textFont, linkFont: textFont, boldFont: textBoldFont, italicFont: textItalicFont, boldItalicFont: textBoldItalicFont, fixedFont: textFixedFont, blockQuoteFont: textFont) let (textLayout, textApply) = makeTextLayout(TextNodeLayoutArguments(attributedString: string, backgroundColor: nil, maximumNumberOfLines: item.multiline ? 0 : 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftOffset - leftInset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let contentSize = CGSize(width: params.width, height: textLayout.size.height + 39.0) + let contentSize = CGSize(width: params.width, height: textLayout.size.height + labelLayout.size.height + 22.0) let nodeLayout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) return (nodeLayout, { [weak self] animation in if let strongSelf = self { @@ -233,15 +233,15 @@ public class ItemListTextWithLabelItemNode: ListViewItemNode { if let _ = updatedTheme { switch item.style { case .plain: - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemPlainSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemPlainSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.plainBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemPlainSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemPlainSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.plainBackgroundColor case .blocks: - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor } - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = labelApply() @@ -267,8 +267,9 @@ public class ItemListTextWithLabelItemNode: ListViewItemNode { }) } - strongSelf.labelNode.frame = CGRect(origin: CGPoint(x: leftOffset + leftInset, y: 11.0), size: labelLayout.size) - strongSelf.textNode.frame = CGRect(origin: CGPoint(x: leftOffset + leftInset, y: 31.0), size: textLayout.size) + let labelFrame = CGRect(origin: CGPoint(x: leftOffset + leftInset, y: 11.0), size: labelLayout.size) + strongSelf.labelNode.frame = labelFrame + strongSelf.textNode.frame = CGRect(origin: CGPoint(x: leftOffset + leftInset, y: labelFrame.maxY + 3.0), size: textLayout.size) let leftInset: CGFloat switch item.style { @@ -436,7 +437,7 @@ public class ItemListTextWithLabelItemNode: ListViewItemNode { if let current = self.linkHighlightingNode { linkHighlightingNode = current } else { - linkHighlightingNode = LinkHighlightingNode(color: item.theme.list.itemAccentColor.withAlphaComponent(0.5)) + linkHighlightingNode = LinkHighlightingNode(color: item.presentationData.theme.list.itemAccentColor.withAlphaComponent(0.5)) self.linkHighlightingNode = linkHighlightingNode self.insertSubnode(linkHighlightingNode, belowSubnode: self.textNode) } diff --git a/submodules/LanguageSuggestionUI/Sources/LanguageSuggestionController.swift b/submodules/LanguageSuggestionUI/Sources/LanguageSuggestionController.swift index 931f7d09a8..f4fa61b896 100644 --- a/submodules/LanguageSuggestionUI/Sources/LanguageSuggestionController.swift +++ b/submodules/LanguageSuggestionUI/Sources/LanguageSuggestionController.swift @@ -217,21 +217,21 @@ private final class LanguageSuggestionAlertContentNode: AlertContentNode { return self.isUserInteractionEnabled } - init(theme: PresentationTheme, strings: LanguageSuggestionControllerStrings, englishStrings: LanguageSuggestionControllerStrings, suggestedLocalization: LocalizationInfo, openSelection: @escaping () -> Void, applyLocalization: @escaping (String, () -> Void) -> Void, dismiss: @escaping () -> Void) { + init(presentationData: PresentationData, strings: LanguageSuggestionControllerStrings, englishStrings: LanguageSuggestionControllerStrings, suggestedLocalization: LocalizationInfo, openSelection: @escaping () -> Void, applyLocalization: @escaping (String, () -> Void) -> Void, dismiss: @escaping () -> Void) { let selectedLocalization = ValuePromise(suggestedLocalization.languageCode, ignoreRepeated: true) self.titleNode = ASTextNode() - self.titleNode.attributedText = NSAttributedString(string: strings.ChooseLanguage, font: Font.bold(17.0), textColor: theme.actionSheet.primaryTextColor, paragraphAlignment: .center) + self.titleNode.attributedText = NSAttributedString(string: strings.ChooseLanguage, font: Font.bold(presentationData.fontSize.baseDisplaySize), textColor: presentationData.theme.actionSheet.primaryTextColor, paragraphAlignment: .center) self.titleNode.maximumNumberOfLines = 2 self.subtitleNode = ASTextNode() - self.subtitleNode.attributedText = NSAttributedString(string: englishStrings.ChooseLanguage, font: Font.regular(14.0), textColor: theme.actionSheet.secondaryTextColor, paragraphAlignment: .center) + self.subtitleNode.attributedText = NSAttributedString(string: englishStrings.ChooseLanguage, font: Font.regular(floor(presentationData.fontSize.baseDisplaySize * 14.0 / 17.0)), textColor: presentationData.theme.actionSheet.secondaryTextColor, paragraphAlignment: .center) self.subtitleNode.maximumNumberOfLines = 2 self.titleSeparatorNode = ASDisplayNode() - self.titleSeparatorNode.backgroundColor = theme.actionSheet.opaqueItemSeparatorColor + self.titleSeparatorNode.backgroundColor = presentationData.theme.actionSheet.opaqueItemSeparatorColor - self.activityIndicator = ActivityIndicator(type: .custom(theme.actionSheet.controlAccentColor, 22.0, 1.0, false)) + self.activityIndicator = ActivityIndicator(type: .custom(presentationData.theme.actionSheet.controlAccentColor, 22.0, 1.0, false)) self.activityIndicator.isHidden = true var items: [LanguageSuggestionItem] = [] @@ -250,7 +250,7 @@ private final class LanguageSuggestionAlertContentNode: AlertContentNode { applyImpl?() })) - self.nodes = items.map { LanguageSuggestionItemNode(theme: theme, item: $0) } + self.nodes = items.map { LanguageSuggestionItemNode(theme: presentationData.theme, item: $0) } super.init() @@ -334,7 +334,8 @@ public func languageSuggestionController(context: AccountContext, suggestedLocal return nil } - let theme = context.sharedContext.currentPresentationData.with { $0 }.theme + let presentationData = context.sharedContext.currentPresentationData.with { $0 } + let theme = context.sharedContext.presentationData let strings = LanguageSuggestionControllerStrings(localization: suggestedLocalization) guard let mainPath = getAppBundle().path(forResource: "en", ofType: "lproj") else { return nil @@ -344,7 +345,7 @@ public func languageSuggestionController(context: AccountContext, suggestedLocal let disposable = MetaDisposable() var dismissImpl: ((Bool) -> Void)? - let contentNode = LanguageSuggestionAlertContentNode(theme: theme, strings: strings, englishStrings: englishStrings, suggestedLocalization: localization, openSelection: { + let contentNode = LanguageSuggestionAlertContentNode(presentationData: presentationData, strings: strings, englishStrings: englishStrings, suggestedLocalization: localization, openSelection: { dismissImpl?(true) openSelection() }, applyLocalization: { languageCode, startActivity in @@ -360,7 +361,7 @@ public func languageSuggestionController(context: AccountContext, suggestedLocal }, dismiss: { dismissImpl?(true) }) - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: theme), contentNode: contentNode) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode) dismissImpl = { [weak controller] animated in if animated { controller?.dismissAnimated() diff --git a/submodules/LegacyComponents/LegacyComponents/TGPhotoEditorSliderView.m b/submodules/LegacyComponents/LegacyComponents/TGPhotoEditorSliderView.m index 1703bca957..22bd9ee45d 100644 --- a/submodules/LegacyComponents/LegacyComponents/TGPhotoEditorSliderView.m +++ b/submodules/LegacyComponents/LegacyComponents/TGPhotoEditorSliderView.m @@ -279,8 +279,10 @@ const CGFloat TGPhotoEditorSliderViewInternalMargin = 7.0f; - (void)setTrackColor:(UIColor *)trackColor { - _trackColor = trackColor; - [self setNeedsDisplay]; + if (_trackColor == nil || ![_trackColor isEqual:trackColor]) { + _trackColor = trackColor; + [self setNeedsDisplay]; + } } - (UIColor *)startColor diff --git a/submodules/MessageReactionListUI/Sources/MessageReactionListController.swift b/submodules/MessageReactionListUI/Sources/MessageReactionListController.swift index 5cdc3a252a..81f8a93aa5 100644 --- a/submodules/MessageReactionListUI/Sources/MessageReactionListController.swift +++ b/submodules/MessageReactionListUI/Sources/MessageReactionListController.swift @@ -8,6 +8,7 @@ import SyncCore import SwiftSignalKit import MergeLists import ItemListPeerItem +import ItemListUI public final class MessageReactionListController: ViewController { private let context: AccountContext @@ -93,7 +94,7 @@ private struct MessageReactionListEntry: Comparable, Identifiable { } func item(context: AccountContext, presentationData: PresentationData) -> ListViewItem { - return ItemListPeerItem(theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, account: context.account, peer: self.item.peer, height: .peerList, nameStyle: .distinctBold, presence: nil, text: .none, label: .text(self.item.reaction, .custom(Font.regular(19.0))), editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: false, sectionId: 0, action: { + return ItemListPeerItem(presentationData: ItemListPresentationData(presentationData), dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, account: context.account, peer: self.item.peer, height: .peerList, nameStyle: .distinctBold, presence: nil, text: .none, label: .text(self.item.reaction, .custom(Font.regular(19.0))), editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: false, sectionId: 0, action: { }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }, noInsets: true, tag: nil) } diff --git a/submodules/NotificationSoundSelectionUI/Sources/NotificationSoundSelection.swift b/submodules/NotificationSoundSelectionUI/Sources/NotificationSoundSelection.swift index e63fab7609..3e01be1a20 100644 --- a/submodules/NotificationSoundSelectionUI/Sources/NotificationSoundSelection.swift +++ b/submodules/NotificationSoundSelectionUI/Sources/NotificationSoundSelection.swift @@ -125,23 +125,23 @@ private enum NotificationSoundSelectionEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! NotificationSoundSelectionArguments switch self { case let.modernHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .classicHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .none(_, theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: true, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: true, sectionId: self.section, action: { arguments.selectSound(.none) }) case let .default(_, theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectSound(.default) }) case let .sound(_, _, theme, text, sound, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectSound(sound) }) } @@ -294,8 +294,8 @@ public func notificationSoundSelectionController(context: AccountContext, isModa arguments.complete() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Notifications_TextTone), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: notificationsAndSoundsEntries(presentationData: presentationData, defaultSound: defaultSound, state: state), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Notifications_TextTone), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: notificationsAndSoundsEntries(presentationData: presentationData, defaultSound: defaultSound, state: state), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/PasswordSetupUI/Sources/ResetPasswordController.swift b/submodules/PasswordSetupUI/Sources/ResetPasswordController.swift index 0f4ef4efa5..db3835105c 100644 --- a/submodules/PasswordSetupUI/Sources/ResetPasswordController.swift +++ b/submodules/PasswordSetupUI/Sources/ResetPasswordController.swift @@ -68,18 +68,18 @@ private enum ResetPasswordEntry: ItemListNodeEntry, Equatable { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ResetPasswordControllerArguments switch self { case let .code(theme, strings, text, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: text, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: "", type: .number, spacing: 10.0, tag: ResetPasswordEntryTag.code, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: text, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: "", type: .number, spacing: 10.0, tag: ResetPasswordEntryTag.code, sectionId: self.section, textUpdated: { updatedText in arguments.updateCodeText(updatedText) }, action: { }) case let .codeInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .helpInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section, linkAction: { action in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section, linkAction: { action in if case .tap = action { arguments.openHelp() } @@ -193,8 +193,8 @@ public func resetPasswordController(context: AccountContext, emailPattern: Strin }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.TwoStepAuth_RecoveryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: resetPasswordControllerEntries(presentationData: presentationData, state: state, pattern: emailPattern), style: .blocks, focusItemTag: ResetPasswordEntryTag.code, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.TwoStepAuth_RecoveryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: resetPasswordControllerEntries(presentationData: presentationData, state: state, pattern: emailPattern), style: .blocks, focusItemTag: ResetPasswordEntryTag.code, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/PasswordSetupUI/Sources/TwoFactorAuthDataInputScreen.swift b/submodules/PasswordSetupUI/Sources/TwoFactorAuthDataInputScreen.swift index 6217409605..c3cb036a8a 100644 --- a/submodules/PasswordSetupUI/Sources/TwoFactorAuthDataInputScreen.swift +++ b/submodules/PasswordSetupUI/Sources/TwoFactorAuthDataInputScreen.swift @@ -66,7 +66,7 @@ public final class TwoFactorDataInputScreen: ViewController { return } if values[0] != values[1] { - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: strongSelf.presentationData.strings.TwoStepAuth_SetupPasswordConfirmFailed, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.TwoStepAuth_SetupPasswordConfirmFailed, actions: [ TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {}) ]), in: .window(.root)) return @@ -289,7 +289,7 @@ public final class TwoFactorDataInputScreen: ViewController { } switch strongSelf.mode { case let .emailAddress(password, hint): - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.TwoFactorSetup_Email_SkipConfirmationTitle, text: strongSelf.presentationData.strings.TwoFactorSetup_Email_SkipConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.TwoFactorSetup_Email_SkipConfirmationTitle, text: strongSelf.presentationData.strings.TwoFactorSetup_Email_SkipConfirmationText, actions: [ TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.TwoFactorSetup_Email_SkipConfirmationSkip, action: { guard let strongSelf = self else { return diff --git a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift index 5affbc7b42..6c84e8ae6c 100644 --- a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift @@ -365,11 +365,11 @@ private enum ChannelAdminEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelAdminControllerArguments switch self { case let .info(theme, strings, dateTimeFormat, peer, presence): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: nil, state: ItemListAvatarAndNameInfoItemState(), sectionId: self.section, style: .blocks(withTopInset: true, withExtendedBottomInset: false), editingNameUpdated: { _ in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: nil, state: ItemListAvatarAndNameInfoItemState(), sectionId: self.section, style: .blocks(withTopInset: true, withExtendedBottomInset: false), editingNameUpdated: { _ in }, avatarTapped: { }) case let .rankTitle(theme, text, count, limit): @@ -377,9 +377,9 @@ private enum ChannelAdminEntry: ItemListNodeEntry { if let count = count { accessoryText = ItemListSectionHeaderAccessoryText(value: "\(limit - count)", color: count > limit ? .destructive : .generic) } - return ItemListSectionHeaderItem(theme: theme, text: text, accessoryText: accessoryText, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, accessoryText: accessoryText, sectionId: self.section) case let .rank(theme, strings, placeholder, text, enabled): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: true), spacing: 0.0, clearType: enabled ? .always : .none, enabled: enabled, tag: ChannelAdminEntryTag.rank, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: true), spacing: 0.0, clearType: enabled ? .always : .none, enabled: enabled, tag: ChannelAdminEntryTag.rank, sectionId: self.section, textUpdated: { updatedText in arguments.updateRank(text, updatedText) }, shouldUpdateText: { text in if text.containsEmoji { @@ -393,23 +393,23 @@ private enum ChannelAdminEntry: ItemListNodeEntry { arguments.dismissInput() }) case let .rankInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .rightsTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .rightItem(theme, _, text, right, flags, value, enabled): - return ItemListSwitchItem(theme: theme, title: text, value: value, type: .icon, enabled: enabled, sectionId: self.section, style: .blocks, updated: { _ in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, type: .icon, enabled: enabled, sectionId: self.section, style: .blocks, updated: { _ in arguments.toggleRight(right, flags) }, activatedWhileDisabled: { arguments.toggleRightWhileDisabled(right, flags) }) case let .addAdminsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .transfer(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.transferOwnership() }, tag: nil) case let .dismiss(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.dismissAdmin() }, tag: nil) } @@ -829,7 +829,7 @@ public func channelAdminController(context: AccountContext, peerId: PeerId, admi text = presentationData.strings.Channel_EditAdmin_CannotEdit } - presentControllerImpl?(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) + presentControllerImpl?(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) }) }, transferOwnership: { let _ = (context.account.postbox.transaction { transaction -> (peer: Peer?, member: Peer?) in @@ -1169,9 +1169,9 @@ public func channelAdminController(context: AccountContext, peerId: PeerId, admi }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Channel_Management_LabelEditor), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Channel_Management_LabelEditor), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: channelAdminControllerEntries(presentationData: presentationData, state: state, accountPeerId: context.account.peerId, channelView: channelView, adminView: adminView, initialParticipant: initialParticipant, canEdit: canEdit), style: .blocks, focusItemTag: focusItemTag, ensureVisibleItemTag: nil, emptyStateItem: nil, animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelAdminControllerEntries(presentationData: presentationData, state: state, accountPeerId: context.account.peerId, channelView: channelView, adminView: adminView, initialParticipant: initialParticipant, canEdit: canEdit), style: .blocks, focusItemTag: focusItemTag, ensureVisibleItemTag: nil, emptyStateItem: nil, animateChanges: true) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift b/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift index 67b9234470..f44e7977a0 100644 --- a/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift @@ -201,15 +201,15 @@ private enum ChannelAdminsEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelAdminsControllerArguments switch self { case let .recentActions(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openRecentActions() }) case let .adminsHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .adminPeerItem(theme, strings, dateTimeFormat, nameDisplayOrder, _, _, participant, editing, enabled, hasAction): let peerText: String var action: (() -> Void)? @@ -236,17 +236,17 @@ private enum ChannelAdminsEntry: ItemListNodeEntry { arguments.openAdmin(participant.participant) } } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: .text(peerText), label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: action, setPeerIdWithRevealedOptions: { previousId, id in + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: .text(peerText), label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: action, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) }, removePeer: { peerId in arguments.removeAdmin(peerId) }) case let .addAdmin(theme, text, editing): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: editing, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: editing, action: { arguments.addAdmin() }) case let .adminsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -757,8 +757,8 @@ public func channelAdminsController(context: AccountContext, peerId: PeerId, loa emptyStateItem = ItemListLoadingIndicatorEmptyStateItem(theme: presentationData.theme) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(isGroup ? presentationData.strings.ChatAdmins_Title : presentationData.strings.Channel_Management_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: channelAdminsControllerEntries(presentationData: presentationData, accountPeerId: context.account.peerId, view: view, state: state, participants: admins), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && admins != nil && previous!.count >= admins!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(isGroup ? presentationData.strings.ChatAdmins_Title : presentationData.strings.Channel_Management_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelAdminsControllerEntries(presentationData: presentationData, accountPeerId: context.account.peerId, view: view, state: state, participants: admins), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && admins != nil && previous!.count >= admins!.count) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/PeerInfoUI/Sources/ChannelBannedMemberController.swift b/submodules/PeerInfoUI/Sources/ChannelBannedMemberController.swift index 8dd8d0e148..572ba98267 100644 --- a/submodules/PeerInfoUI/Sources/ChannelBannedMemberController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelBannedMemberController.swift @@ -221,29 +221,29 @@ private enum ChannelBannedMemberEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelBannedMemberControllerArguments switch self { case let .info(theme, strings, dateTimeFormat, peer, presence): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: nil, state: ItemListAvatarAndNameInfoItemState(), sectionId: self.section, style: .blocks(withTopInset: true, withExtendedBottomInset: false), editingNameUpdated: { _ in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: nil, state: ItemListAvatarAndNameInfoItemState(), sectionId: self.section, style: .blocks(withTopInset: true, withExtendedBottomInset: false), editingNameUpdated: { _ in }, avatarTapped: { }) case let .rightsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .rightItem(theme, _, text, right, value, enabled): - return ItemListSwitchItem(theme: theme, title: text, value: value, type: .icon, enableInteractiveChanges: enabled, enabled: enabled, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, type: .icon, enableInteractiveChanges: enabled, enabled: enabled, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleRight(right, value) }, activatedWhileDisabled: { arguments.toggleRightWhileDisabled(right) }) case let .timeout(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openTimeout() }) case let .exceptionInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .delete(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.delete() }) } @@ -731,9 +731,9 @@ public func channelBannedMemberController(context: AccountContext, peerId: PeerI title = presentationData.strings.GroupPermission_NewTitle } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: channelBannedMemberControllerEntries(presentationData: presentationData, state: state, accountPeerId: context.account.peerId, channelView: channelView, memberView: memberView, initialParticipant: initialParticipant, initialBannedBy: initialBannedByPeer), style: .blocks, emptyStateItem: nil, animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelBannedMemberControllerEntries(presentationData: presentationData, state: state, accountPeerId: context.account.peerId, channelView: channelView, memberView: memberView, initialParticipant: initialParticipant, initialBannedBy: initialBannedByPeer), style: .blocks, emptyStateItem: nil, animateChanges: true) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift b/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift index 400d178646..8ed7b958b0 100644 --- a/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelBlacklistController.swift @@ -148,17 +148,17 @@ private enum ChannelBlacklistEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelBlacklistControllerArguments switch self { case let .add(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.addPeer() }) case let .addInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .bannedHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .peerItem(theme, strings, dateTimeFormat, nameDisplayOrder, _, participant, editing, enabled): var text: ItemListPeerItemText = .none switch participant.participant { @@ -169,7 +169,7 @@ private enum ChannelBlacklistEntry: ItemListNodeEntry { default: break } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { arguments.openPeer(participant) }, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) @@ -498,8 +498,8 @@ public func channelBlacklistController(context: AccountContext, peerId: PeerId) }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.GroupRemoved_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: channelBlacklistControllerEntries(presentationData: presentationData, view: view, state: state, participants: participants), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && participants != nil && previous!.count >= participants!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.GroupRemoved_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelBlacklistControllerEntries(presentationData: presentationData, view: view, state: state, participants: participants), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && participants != nil && previous!.count >= participants!.count) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSearchContainerNode.swift b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSearchContainerNode.swift index bff381d31e..0980cf4d1b 100644 --- a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSearchContainerNode.swift +++ b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSearchContainerNode.swift @@ -12,6 +12,7 @@ import MergeLists import AccountContext import SearchUI import ContactsPeerItem +import ItemListUI private enum ChannelDiscussionGroupSearchContent: Equatable { case peer(Peer) @@ -68,10 +69,10 @@ private final class ChannelDiscussionGroupSearchEntry: Comparable, Identifiable return lhs.index < rhs.index } - func item(account: Account, theme: PresentationTheme, strings: PresentationStrings, interaction: ChannelDiscussionGroupSearchInteraction) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, interaction: ChannelDiscussionGroupSearchInteraction) -> ListViewItem { switch self.content { case let .peer(peer): - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: .firstLast, displayOrder: .firstLast, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: .firstLast, displayOrder: .firstLast, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: nil, action: { _ in interaction.peerSelected(peer) }) } @@ -85,12 +86,12 @@ struct ChannelDiscussionGroupSearchContainerTransition { let isSearching: Bool } -private func channelDiscussionGroupSearchContainerPreparedRecentTransition(from fromEntries: [ChannelDiscussionGroupSearchEntry], to toEntries: [ChannelDiscussionGroupSearchEntry], isSearching: Bool, account: Account, theme: PresentationTheme, strings: PresentationStrings, interaction: ChannelDiscussionGroupSearchInteraction) -> ChannelDiscussionGroupSearchContainerTransition { +private func channelDiscussionGroupSearchContainerPreparedRecentTransition(from fromEntries: [ChannelDiscussionGroupSearchEntry], to toEntries: [ChannelDiscussionGroupSearchEntry], isSearching: Bool, account: Account, presentationData: PresentationData, interaction: ChannelDiscussionGroupSearchInteraction) -> ChannelDiscussionGroupSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, interaction: interaction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, interaction: interaction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, interaction: interaction), directionHint: nil) } return ChannelDiscussionGroupSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, isSearching: isSearching) } @@ -114,14 +115,14 @@ final class ChannelDiscussionGroupSearchContainerNode: SearchDisplayControllerCo private var presentationData: PresentationData private var presentationDataDisposable: Disposable? - private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, PresentationDateTimeFormat)> + private let presentationDataPromise: Promise init(context: AccountContext, peers: [Peer], openPeer: @escaping (Peer) -> Void) { self.context = context self.openPeer = openPeer self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.themeAndStringsPromise = Promise((self.presentationData.theme, self.presentationData.strings, self.presentationData.nameSortOrder, self.presentationData.nameDisplayOrder, self.presentationData.dateTimeFormat)) + self.presentationDataPromise = Promise(self.presentationData) self.dimNode = ASDisplayNode() self.listNode = ListView() @@ -186,12 +187,12 @@ final class ChannelDiscussionGroupSearchContainerNode: SearchDisplayControllerCo let previousSearchItems = Atomic<[ChannelDiscussionGroupSearchEntry]?>(value: nil) - self.searchDisposable.set((combineLatest(foundItems, self.themeAndStringsPromise.get()) - |> deliverOnMainQueue).start(next: { [weak self] entries, themeAndStrings in + self.searchDisposable.set((combineLatest(foundItems, self.presentationDataPromise.get()) + |> deliverOnMainQueue).start(next: { [weak self] entries, presentationData in if let strongSelf = self { let previousEntries = previousSearchItems.swap(entries) let firstTime = previousEntries == nil - let transition = channelDiscussionGroupSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, theme: themeAndStrings.0, strings: themeAndStrings.1, interaction: interaction) + let transition = channelDiscussionGroupSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, presentationData: presentationData, interaction: interaction) strongSelf.enqueueTransition(transition, firstTime: firstTime) } })) diff --git a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSetupController.swift b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSetupController.swift index 495180435f..fb5f4a016d 100644 --- a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSetupController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupSetupController.swift @@ -128,13 +128,13 @@ private enum ChannelDiscussionGroupSetupControllerEntry: ItemListNodeEntry { return lhs.sortIndex < rhs.sortIndex } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelDiscussionGroupSetupControllerArguments switch self { case let .header(theme, strings, title, isGroup, label): return ChannelDiscussionGroupSetupHeaderItem(theme: theme, strings: strings, title: title, isGroup: isGroup, label: label, sectionId: self.section) case let .create(theme, text): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, editing: false, action: { arguments.createGroup() }) case let .group(_, theme, strings, peer, nameOrder): @@ -144,13 +144,13 @@ private enum ChannelDiscussionGroupSetupControllerEntry: ItemListNodeEntry { } else { text = strings.Channel_DiscussionGroup_PrivateGroup } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: PresentationDateTimeFormat(timeFormat: .regular, dateFormat: .monthFirst, dateSeparator: ".", decimalSeparator: ".", groupingSeparator: "."), nameDisplayOrder: nameOrder, account: arguments.account, peer: peer, aliasHandling: .standard, nameStyle: .plain, presence: nil, text: .text(text), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: PresentationDateTimeFormat(timeFormat: .regular, dateFormat: .monthFirst, dateSeparator: ".", decimalSeparator: ".", groupingSeparator: "."), nameDisplayOrder: nameOrder, account: arguments.account, peer: peer, aliasHandling: .standard, nameStyle: .plain, presence: nil, text: .text(text), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.selectGroup(peer.id) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }) case let .groupsInfo(theme, title): - return ItemListTextItem(theme: theme, text: .plain(title), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(title), sectionId: self.section) case let .unlink(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.unlinkGroup() }) } @@ -591,8 +591,8 @@ public func channelDiscussionGroupSetupController(context: AccountContext, peerI } } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: channelDiscussionGroupSetupControllerEntries(presentationData: presentationData, view: view, groups: groups), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, crossfadeState: crossfade, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelDiscussionGroupSetupControllerEntries(presentationData: presentationData, view: view, groups: groups), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, crossfadeState: crossfade, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelInfoController.swift b/submodules/PeerInfoUI/Sources/ChannelInfoController.swift index 1767eafb52..3d2f4770db 100644 --- a/submodules/PeerInfoUI/Sources/ChannelInfoController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelInfoController.swift @@ -322,85 +322,85 @@ private enum ChannelInfoEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelInfoControllerArguments switch self { case let .info(theme, strings, dateTimeFormat, peer, cachedData, state, updatingAvatar): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: cachedData, state: state, sectionId: self.section, style: .plain, editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: cachedData, state: state, sectionId: self.section, style: .plain, editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.tapAvatarAction() }, context: arguments.avatarAndNameInfoContext, updatingImage: updatingAvatar) case let .about(theme, text, value): - return ItemListTextWithLabelItem(theme: theme, label: text, text: foldMultipleLineBreaks(value), enabledEntityTypes: [.url, .mention, .hashtag], multiline: true, sectionId: self.section, action: nil, longTapAction: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: foldMultipleLineBreaks(value), enabledEntityTypes: [.url, .mention, .hashtag], multiline: true, sectionId: self.section, action: nil, longTapAction: { arguments.displayContextMenu(ChannelInfoEntryTag.about, value) }, linkItemAction: { action, itemLink in arguments.aboutLinkAction(action, itemLink) }, tag: ChannelInfoEntryTag.about) case let .addressName(theme, text, value): - return ItemListTextWithLabelItem(theme: theme, label: text, text: "https://t.me/\(value)", textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: "https://t.me/\(value)", textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { arguments.displayAddressNameContextMenu("https://t.me/\(value)") }, longTapAction: { arguments.displayContextMenu(ChannelInfoEntryTag.link, "https://t.me/\(value)") }, tag: ChannelInfoEntryTag.link) case let .channelPhotoSetup(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.changeProfilePhoto() }) case let .channelTypeSetup(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openChannelTypeSetup() }) case let .discussionGroupSetup(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openDiscussionGroupSetup() }) case let .discussionGroupSetupInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .channelDescriptionSetup(theme, placeholder, value): - return ItemListMultilineInputItem(theme: theme, text: value, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .plain, textUpdated: { updatedText in + return ItemListMultilineInputItem(presentationData: presentationData, text: value, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .plain, textUpdated: { updatedText in arguments.updateEditingDescriptionText(updatedText) }) case let .admins(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openAdmins() }) case let .members(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openMembers() }) case let .banned(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openBanned() }) case let .signMessages(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .plain, updated: { updated in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .plain, updated: { updated in arguments.toggleSignatures(updated) }) case let .signInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section, style: .plain) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section, style: .plain) case let .sharedMedia(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .plain, action: { arguments.openSharedMedia() }) case let .stats(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .plain, action: { arguments.openStats() }) case let .notifications(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.changeNotificationMuteSettings() }) case let .report(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.reportChannel() }) case let .leave(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.leaveChannel() }) case let .deleteChannel(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.deleteChannel() }) } @@ -1086,8 +1086,8 @@ public func channelInfoController(context: AccountContext, peerId: PeerId) -> Vi crossfadeState = true } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.UserInfo_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: channelInfoEntries(account: context.account, presentationData: presentationData, view: view, globalNotificationSettings: globalNotificationSettings, state: state), style: .plain, crossfadeState: crossfadeState, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.UserInfo_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelInfoEntries(account: context.account, presentationData: presentationData, view: view, globalNotificationSettings: globalNotificationSettings, state: state), style: .plain, crossfadeState: crossfadeState, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/PeerInfoUI/Sources/ChannelMembersController.swift b/submodules/PeerInfoUI/Sources/ChannelMembersController.swift index 05e0c8f130..233337305d 100644 --- a/submodules/PeerInfoUI/Sources/ChannelMembersController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelMembersController.swift @@ -178,19 +178,19 @@ private enum ChannelMembersEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelMembersControllerArguments switch self { case let .addMember(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.addMember() }) case let .inviteLink(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.inviteViaLink() }) case let .addMemberInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .peerItem(_, theme, strings, dateTimeFormat, nameDisplayOrder, participant, editing, enabled): let text: ItemListPeerItemText if let user = participant.peer as? TelegramUser, let _ = user.botInfo { @@ -198,7 +198,7 @@ private enum ChannelMembersEntry: ItemListNodeEntry { } else { text = .presence } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: participant.presences[participant.peer.id], text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: participant.presences[participant.peer.id], text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { arguments.openPeer(participant.peer) }, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) @@ -520,8 +520,8 @@ public func channelMembersController(context: AccountContext, peerId: PeerId) -> let previous = previousPeers previousPeers = peers - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Channel_Subscribers_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: ChannelMembersControllerEntries(context: context, presentationData: presentationData, view: view, state: state, participants: peers), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && peers != nil && previous!.count >= peers!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Channel_Subscribers_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: ChannelMembersControllerEntries(context: context, presentationData: presentationData, view: view, state: state, participants: peers), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && peers != nil && previous!.count >= peers!.count) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelMembersSearchContainerNode.swift b/submodules/PeerInfoUI/Sources/ChannelMembersSearchContainerNode.swift index d6b8bd4248..ae40c98c5b 100644 --- a/submodules/PeerInfoUI/Sources/ChannelMembersSearchContainerNode.swift +++ b/submodules/PeerInfoUI/Sources/ChannelMembersSearchContainerNode.swift @@ -15,6 +15,7 @@ import SearchUI import ItemListPeerItem import ContactsPeerItem import ChatListSearchItemHeader +import ItemListUI enum ChannelMembersSearchMode { case searchMembers @@ -138,10 +139,10 @@ private final class ChannelMembersSearchEntry: Comparable, Identifiable { return lhs.index < rhs.index } - func item(account: Account, theme: PresentationTheme, strings: PresentationStrings, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchContainerInteraction) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchContainerInteraction) -> ListViewItem { switch self.content { case let .peer(peer): - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: self.section.chatListHeaderType.flatMap({ ChatListSearchItemHeader(type: $0, theme: theme, strings: strings, actionTitle: nil, action: nil) }), action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), index: nil, header: self.section.chatListHeaderType.flatMap({ ChatListSearchItemHeader(type: $0, theme: presentationData.theme, strings: presentationData.strings, actionTitle: nil, action: nil) }), action: { _ in interaction.peerSelected(peer, nil) }) case let .participant(participant, label, revealActions, revealed, enabled): @@ -175,7 +176,7 @@ private final class ChannelMembersSearchEntry: Comparable, Identifiable { actionIcon = .add } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: participant.peer, chatPeer: participant.peer), status: status, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: revealed), options: options, actionIcon: actionIcon, index: nil, header: self.section.chatListHeaderType.flatMap({ ChatListSearchItemHeader(type: $0, theme: theme, strings: strings, actionTitle: nil, action: nil) }), action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: participant.peer, chatPeer: participant.peer), status: status, enabled: enabled, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: revealed), options: options, actionIcon: actionIcon, index: nil, header: self.section.chatListHeaderType.flatMap({ ChatListSearchItemHeader(type: $0, theme: presentationData.theme, strings: presentationData.strings, actionTitle: nil, action: nil) }), action: { _ in interaction.peerSelected(participant.peer, participant) }, setPeerIdWithRevealedOptions: { peerId, fromPeerId in interaction.setPeerIdWithRevealedOptions(RevealedPeerId(peerId: participant.peer.id, section: self.section), fromPeerId.flatMap({ RevealedPeerId(peerId: $0, section: self.section) })) @@ -259,12 +260,12 @@ final class GroupMembersSearchContext { } } -private func channelMembersSearchContainerPreparedRecentTransition(from fromEntries: [ChannelMembersSearchEntry], to toEntries: [ChannelMembersSearchEntry], isSearching: Bool, account: Account, theme: PresentationTheme, strings: PresentationStrings, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchContainerInteraction) -> ChannelMembersSearchContainerTransition { +private func channelMembersSearchContainerPreparedRecentTransition(from fromEntries: [ChannelMembersSearchEntry], to toEntries: [ChannelMembersSearchEntry], isSearching: Bool, account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchContainerInteraction) -> ChannelMembersSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } return ChannelMembersSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, isSearching: isSearching) } @@ -295,7 +296,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod private let removeMemberDisposable = MetaDisposable() - private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings, PresentationPersonNameOrder, PresentationPersonNameOrder, PresentationDateTimeFormat)> + private let presentationDataPromise: Promise init(context: AccountContext, peerId: PeerId, mode: ChannelMembersSearchMode, filters: [ChannelMembersSearchFilter], searchContext: GroupMembersSearchContext?, openPeer: @escaping (Peer, RenderedChannelParticipant?) -> Void, updateActivity: @escaping (Bool) -> Void, pushController: @escaping (ViewController) -> Void) { self.context = context @@ -303,7 +304,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod self.mode = mode self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.themeAndStringsPromise = Promise((self.presentationData.theme, self.presentationData.strings, self.presentationData.nameSortOrder, self.presentationData.nameDisplayOrder, self.presentationData.dateTimeFormat)) + self.presentationDataPromise = Promise(self.presentationData) self.emptyQueryListNode = ListView() self.listNode = ListView() @@ -433,12 +434,12 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod removeMemberDisposable.set(signal.start()) }) - let themeAndStringsPromise = self.themeAndStringsPromise + let presentationDataPromise = self.presentationDataPromise let emptyQueryItems: Signal<[ChannelMembersSearchEntry]?, NoError> if let searchContext = searchContext { - emptyQueryItems = combineLatest(queue: .mainQueue(), statePromise.get(), searchContext.state.get(), context.account.postbox.peerView(id: peerId) |> take(1), themeAndStringsPromise.get()) - |> map { state, searchState, peerView, themeAndStrings -> [ChannelMembersSearchEntry]? in + emptyQueryItems = combineLatest(queue: .mainQueue(), statePromise.get(), searchContext.state.get(), context.account.postbox.peerView(id: peerId) |> take(1), presentationDataPromise.get()) + |> map { state, searchState, peerView, presentationData -> [ChannelMembersSearchEntry]? in if let channel = peerView.peers[peerId] as? TelegramChannel { var entries: [ChannelMembersSearchEntry] = [] @@ -483,7 +484,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod if case .searchMembers = mode { switch participant.participant { case .creator: - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner default: break } @@ -496,15 +497,15 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var peerActions: [ParticipantRevealAction] = [] if case .searchMembers = mode { if canPromote { - peerActions.append(ParticipantRevealAction(type: .neutral, title: themeAndStrings.1.GroupInfo_ActionPromote, action: .promote)) + peerActions.append(ParticipantRevealAction(type: .neutral, title: presentationData.strings.GroupInfo_ActionPromote, action: .promote)) } if canRestrict { - peerActions.append(ParticipantRevealAction(type: .warning, title: themeAndStrings.1.GroupInfo_ActionRestrict, action: .restrict)) - peerActions.append(ParticipantRevealAction(type: .destructive, title: themeAndStrings.1.Common_Delete, action: .remove)) + peerActions.append(ParticipantRevealAction(type: .warning, title: presentationData.strings.GroupInfo_ActionRestrict, action: .restrict)) + peerActions.append(ParticipantRevealAction(type: .destructive, title: presentationData.strings.Common_Delete, action: .remove)) } } - entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } @@ -617,8 +618,8 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod foundRemotePeers = .single(([], [])) } - return combineLatest(foundGroupMembers, foundMembers, foundContacts, foundRemotePeers, themeAndStringsPromise.get(), statePromise.get()) - |> map { foundGroupMembers, foundMembers, foundContacts, foundRemotePeers, themeAndStrings, state -> [ChannelMembersSearchEntry]? in + return combineLatest(foundGroupMembers, foundMembers, foundContacts, foundRemotePeers, presentationDataPromise.get(), statePromise.get()) + |> map { foundGroupMembers, foundMembers, foundContacts, foundRemotePeers, presentationData, state -> [ChannelMembersSearchEntry]? in var entries: [ChannelMembersSearchEntry] = [] var existingPeerIds = Set() @@ -693,16 +694,16 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var enabled = true if case .banAndPromoteActions = mode { if case .creator = participant.participant { - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner enabled = false } } else if case .searchMembers = mode { switch participant.participant { case .creator: - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner case let .member(member): if member.adminInfo != nil { - label = themeAndStrings.1.Channel_Management_LabelEditor + label = presentationData.strings.Channel_Management_LabelEditor } } } @@ -714,15 +715,15 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var peerActions: [ParticipantRevealAction] = [] if case .searchMembers = mode { if canPromote { - peerActions.append(ParticipantRevealAction(type: .neutral, title: themeAndStrings.1.GroupInfo_ActionPromote, action: .promote)) + peerActions.append(ParticipantRevealAction(type: .neutral, title: presentationData.strings.GroupInfo_ActionPromote, action: .promote)) } if canRestrict { - peerActions.append(ParticipantRevealAction(type: .warning, title: themeAndStrings.1.GroupInfo_ActionRestrict, action: .restrict)) - peerActions.append(ParticipantRevealAction(type: .destructive, title: themeAndStrings.1.Common_Delete, action: .remove)) + peerActions.append(ParticipantRevealAction(type: .warning, title: presentationData.strings.GroupInfo_ActionRestrict, action: .restrict)) + peerActions.append(ParticipantRevealAction(type: .destructive, title: presentationData.strings.Common_Delete, action: .remove)) } } else if case .searchAdmins = mode { if canRestrict { - peerActions.append(ParticipantRevealAction(type: .destructive, title: themeAndStrings.1.Common_Delete, action: .remove)) + peerActions.append(ParticipantRevealAction(type: .destructive, title: presentationData.strings.Common_Delete, action: .remove)) } } @@ -730,14 +731,14 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod case .searchAdmins: switch participant.participant { case .creator: - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner case let .member(_, _, adminInfo, _, _): if let adminInfo = adminInfo { if let peer = participant.peers[adminInfo.promotedBy] { if peer.id == participant.peer.id { - label = themeAndStrings.1.Channel_Management_LabelAdministrator + label = presentationData.strings.Channel_Management_LabelAdministrator } else { - label = themeAndStrings.1.Channel_Management_PromotedBy(peer.displayTitle(strings: themeAndStrings.1, displayOrder: themeAndStrings.3)).0 + label = presentationData.strings.Channel_Management_PromotedBy(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).0 } } } @@ -752,7 +753,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod if !exceptionsString.isEmpty { exceptionsString.append(", ") } - exceptionsString.append(compactStringForGroupPermission(strings: themeAndStrings.1, right: rights)) + exceptionsString.append(compactStringForGroupPermission(strings: presentationData.strings, right: rights)) } } label = exceptionsString @@ -764,7 +765,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod switch participant.participant { case let .member(_, _, _, banInfo, _): if let banInfo = banInfo, let peer = participant.peers[banInfo.restrictedBy] { - label = themeAndStrings.1.Channel_Management_RemovedBy(peer.displayTitle(strings: themeAndStrings.1, displayOrder: themeAndStrings.3)).0 + label = presentationData.strings.Channel_Management_RemovedBy(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).0 } default: break @@ -772,7 +773,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod default: break } - entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -796,12 +797,12 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var enabled = true if case .banAndPromoteActions = mode { if case .creator = participant.participant { - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner enabled = false } } - entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: [], revealed: false, enabled: enabled), section: section, dateTimeFormat: themeAndStrings.4, addIcon: addIcon)) + entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: [], revealed: false, enabled: enabled), section: section, dateTimeFormat: presentationData.dateTimeFormat, addIcon: addIcon)) index += 1 } } @@ -809,7 +810,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod for peer in foundContacts.0 { if !existingPeerIds.contains(peer.id) { existingPeerIds.insert(peer.id) - entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .contacts, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .contacts, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -818,7 +819,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod let peer = foundPeer.peer if !existingPeerIds.contains(peer.id) && peer is TelegramUser { existingPeerIds.insert(peer.id) - entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -827,7 +828,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod let peer = foundPeer.peer if !existingPeerIds.contains(peer.id) && peer is TelegramUser { existingPeerIds.insert(peer.id) - entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -905,8 +906,8 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod foundRemotePeers = .single(([], [])) } - return combineLatest(foundGroupMembers, foundMembers, foundRemotePeers, themeAndStringsPromise.get(), statePromise.get()) - |> map { foundGroupMembers, foundMembers, foundRemotePeers, themeAndStrings, state -> [ChannelMembersSearchEntry]? in + return combineLatest(foundGroupMembers, foundMembers, foundRemotePeers, presentationDataPromise.get(), statePromise.get()) + |> map { foundGroupMembers, foundMembers, foundRemotePeers, presentationData, state -> [ChannelMembersSearchEntry]? in var entries: [ChannelMembersSearchEntry] = [] var existingPeerIds = Set() @@ -977,16 +978,16 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var enabled = true if case .banAndPromoteActions = mode { if case .creator = participant.participant { - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner enabled = false } } else if case .searchMembers = mode { switch participant.participant { case .creator: - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner case let .member(member): if member.adminInfo != nil { - label = themeAndStrings.1.Channel_Management_LabelEditor + label = presentationData.strings.Channel_Management_LabelEditor } } } @@ -998,11 +999,11 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var peerActions: [ParticipantRevealAction] = [] /*if case .searchMembers = mode { if canPromote { - peerActions.append(ParticipantRevealAction(type: .neutral, title: themeAndStrings.1.GroupInfo_ActionPromote, action: .promote)) + peerActions.append(ParticipantRevealAction(type: .neutral, title: presentationData.strings.GroupInfo_ActionPromote, action: .promote)) } if canRestrict { - peerActions.append(ParticipantRevealAction(type: .warning, title: themeAndStrings.1.GroupInfo_ActionRestrict, action: .restrict)) - peerActions.append(ParticipantRevealAction(type: .destructive, title: themeAndStrings.1.Common_Delete, action: .remove)) + peerActions.append(ParticipantRevealAction(type: .warning, title: presentationData.strings.GroupInfo_ActionRestrict, action: .restrict)) + peerActions.append(ParticipantRevealAction(type: .destructive, title: presentationData.strings.Common_Delete, action: .remove)) } }*/ @@ -1010,14 +1011,14 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod case .searchAdmins: switch participant.participant { case .creator: - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner case let .member(_, _, adminInfo, _, _): if let adminInfo = adminInfo { if let peer = participant.peers[adminInfo.promotedBy] { if peer.id == participant.peer.id { - label = themeAndStrings.1.Channel_Management_LabelAdministrator + label = presentationData.strings.Channel_Management_LabelAdministrator } else { - label = themeAndStrings.1.Channel_Management_PromotedBy(peer.displayTitle(strings: themeAndStrings.1, displayOrder: themeAndStrings.3)).0 + label = presentationData.strings.Channel_Management_PromotedBy(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).0 } } } @@ -1032,7 +1033,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod if !exceptionsString.isEmpty { exceptionsString.append(", ") } - exceptionsString.append(compactStringForGroupPermission(strings: themeAndStrings.1, right: rights)) + exceptionsString.append(compactStringForGroupPermission(strings: presentationData.strings, right: rights)) } } label = exceptionsString @@ -1044,7 +1045,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod switch participant.participant { case let .member(_, _, _, banInfo, _): if let banInfo = banInfo, let peer = participant.peers[banInfo.restrictedBy] { - label = themeAndStrings.1.Channel_Management_RemovedBy(peer.displayTitle(strings: themeAndStrings.1, displayOrder: themeAndStrings.3)).0 + label = presentationData.strings.Channel_Management_RemovedBy(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)).0 } default: break @@ -1052,7 +1053,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod default: break } - entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: peerActions, revealed: state.revealedPeerId == RevealedPeerId(peerId: participant.peer.id, section: section), enabled: enabled), section: section, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -1076,12 +1077,12 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod var enabled = true if case .banAndPromoteActions = mode { if case .creator = participant.participant { - label = themeAndStrings.1.Channel_Management_LabelOwner + label = presentationData.strings.Channel_Management_LabelOwner enabled = false } } - entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: [], revealed: false, enabled: enabled), section: section, dateTimeFormat: themeAndStrings.4, addIcon: addIcon)) + entries.append(ChannelMembersSearchEntry(index: index, content: .participant(participant: participant, label: label, revealActions: [], revealed: false, enabled: enabled), section: section, dateTimeFormat: presentationData.dateTimeFormat, addIcon: addIcon)) index += 1 } } @@ -1090,7 +1091,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod let peer = foundPeer.peer if !existingPeerIds.contains(peer.id) && peer is TelegramUser { existingPeerIds.insert(peer.id) - entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -1099,7 +1100,7 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod let peer = foundPeer.peer if !existingPeerIds.contains(peer.id) && peer is TelegramUser { existingPeerIds.insert(peer.id) - entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: themeAndStrings.4)) + entries.append(ChannelMembersSearchEntry(index: index, content: .peer(peer), section: .global, dateTimeFormat: presentationData.dateTimeFormat)) index += 1 } } @@ -1114,29 +1115,29 @@ final class ChannelMembersSearchContainerNode: SearchDisplayControllerContentNod let previousSearchItems = Atomic<[ChannelMembersSearchEntry]?>(value: nil) let previousEmptyQueryItems = Atomic<[ChannelMembersSearchEntry]?>(value: nil) - self.emptyQueryDisposable.set((combineLatest(emptyQueryItems, self.themeAndStringsPromise.get()) - |> deliverOnMainQueue).start(next: { [weak self] entries, themeAndStrings in + self.emptyQueryDisposable.set((combineLatest(emptyQueryItems, self.presentationDataPromise.get()) + |> deliverOnMainQueue).start(next: { [weak self] entries, presentationData in if let strongSelf = self { let previousEntries = previousEmptyQueryItems.swap(entries) let firstTime = previousEntries == nil - let transition = channelMembersSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, theme: themeAndStrings.0, strings: themeAndStrings.1, nameSortOrder: themeAndStrings.2, nameDisplayOrder: themeAndStrings.3, interaction: interaction) + let transition = channelMembersSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, presentationData: presentationData, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, interaction: interaction) strongSelf.enqueueEmptyQueryTransition(transition, firstTime: firstTime) if entries == nil { strongSelf.emptyQueryListNode.backgroundColor = UIColor(white: 0.0, alpha: 0.5) } else { - strongSelf.emptyQueryListNode.backgroundColor = themeAndStrings.0.chatList.backgroundColor + strongSelf.emptyQueryListNode.backgroundColor = presentationData.theme.chatList.backgroundColor } } })) - self.searchDisposable.set((combineLatest(foundItems, self.themeAndStringsPromise.get()) - |> deliverOnMainQueue).start(next: { [weak self] entries, themeAndStrings in + self.searchDisposable.set((combineLatest(foundItems, self.presentationDataPromise.get()) + |> deliverOnMainQueue).start(next: { [weak self] entries, presentationData in if let strongSelf = self { let previousEntries = previousSearchItems.swap(entries) updateActivity(false) let firstTime = previousEntries == nil - let transition = channelMembersSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, theme: themeAndStrings.0, strings: themeAndStrings.1, nameSortOrder: themeAndStrings.2, nameDisplayOrder: themeAndStrings.3, interaction: interaction) + let transition = channelMembersSearchContainerPreparedRecentTransition(from: previousEntries ?? [], to: entries ?? [], isSearching: entries != nil, account: context.account, presentationData: presentationData, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, interaction: interaction) strongSelf.enqueueTransition(transition, firstTime: firstTime) } })) diff --git a/submodules/PeerInfoUI/Sources/ChannelMembersSearchControllerNode.swift b/submodules/PeerInfoUI/Sources/ChannelMembersSearchControllerNode.swift index b8e46b9bd9..a3324b0ada 100644 --- a/submodules/PeerInfoUI/Sources/ChannelMembersSearchControllerNode.swift +++ b/submodules/PeerInfoUI/Sources/ChannelMembersSearchControllerNode.swift @@ -14,6 +14,7 @@ import TemporaryCachedPeerDataManager import SearchBarNode import ContactsPeerItem import SearchUI +import ItemListUI private final class ChannelMembersSearchInteraction { let openPeer: (Peer, RenderedChannelParticipant?) -> Void @@ -59,7 +60,7 @@ private enum ChannelMembersSearchEntry: Comparable, Identifiable { } } - func item(account: Account, theme: PresentationTheme, strings: PresentationStrings, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchInteraction) -> ListViewItem { + func item(account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchInteraction) -> ListViewItem { switch self { case let .peer(_, participant, editing, label, enabled): let status: ContactsPeerItemStatus @@ -68,7 +69,7 @@ private enum ChannelMembersSearchEntry: Comparable, Identifiable { } else { status = .none } - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: participant.peer, chatPeer: nil), status: status, enabled: enabled, selection: .none, editing: editing, index: nil, header: nil, action: { _ in + return ContactsPeerItem(presentationData: ItemListPresentationData(presentationData), sortOrder: nameSortOrder, displayOrder: nameDisplayOrder, account: account, peerMode: .peer, peer: .peer(peer: participant.peer, chatPeer: nil), status: status, enabled: enabled, selection: .none, editing: editing, index: nil, header: nil, action: { _ in interaction.openPeer(participant.peer, participant) }) } @@ -82,12 +83,12 @@ private struct ChannelMembersSearchTransition { let initial: Bool } -private func preparedTransition(from fromEntries: [ChannelMembersSearchEntry]?, to toEntries: [ChannelMembersSearchEntry], account: Account, theme: PresentationTheme, strings: PresentationStrings, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchInteraction) -> ChannelMembersSearchTransition { +private func preparedTransition(from fromEntries: [ChannelMembersSearchEntry]?, to toEntries: [ChannelMembersSearchEntry], account: Account, presentationData: PresentationData, nameSortOrder: PresentationPersonNameOrder, nameDisplayOrder: PresentationPersonNameOrder, interaction: ChannelMembersSearchInteraction) -> ChannelMembersSearchTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries ?? [], rightList: toEntries) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, theme: theme, strings: strings, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(account: account, presentationData: presentationData, nameSortOrder: nameSortOrder, nameDisplayOrder: nameDisplayOrder, interaction: interaction), directionHint: nil) } return ChannelMembersSearchTransition(deletions: deletions, insertions: insertions, updates: updates, initial: fromEntries == nil) } @@ -232,7 +233,7 @@ class ChannelMembersSearchControllerNode: ASDisplayNode { } let previous = previousEntries.swap(entries) - strongSelf.enqueueTransition(preparedTransition(from: previous, to: entries, account: context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, interaction: interaction)) + strongSelf.enqueueTransition(preparedTransition(from: previous, to: entries, account: context.account, presentationData: strongSelf.presentationData, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, interaction: interaction)) }) disposableAndLoadMoreControl = (disposable, nil) } else { @@ -290,7 +291,7 @@ class ChannelMembersSearchControllerNode: ASDisplayNode { let previous = previousEntries.swap(entries) - strongSelf.enqueueTransition(preparedTransition(from: previous, to: entries, account: context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, interaction: interaction)) + strongSelf.enqueueTransition(preparedTransition(from: previous, to: entries, account: context.account, presentationData: strongSelf.presentationData, nameSortOrder: strongSelf.presentationData.nameSortOrder, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder, interaction: interaction)) }) } self.disposable = disposableAndLoadMoreControl.0 diff --git a/submodules/PeerInfoUI/Sources/ChannelOwnershipTransferController.swift b/submodules/PeerInfoUI/Sources/ChannelOwnershipTransferController.swift index 900cfc8abc..da1429a5ff 100644 --- a/submodules/PeerInfoUI/Sources/ChannelOwnershipTransferController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelOwnershipTransferController.swift @@ -415,7 +415,7 @@ private func commitChannelOwnershipTransferController(context: AccountContext, p let disposable = MetaDisposable() - let contentNode = ChannelOwnershipTransferAlertContentNode(theme: AlertControllerTheme(presentationTheme: presentationData.theme), ptheme: presentationData.theme, strings: presentationData.strings, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: { + let contentNode = ChannelOwnershipTransferAlertContentNode(theme: AlertControllerTheme(presentationData: presentationData), ptheme: presentationData.theme, strings: presentationData.strings, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: { dismissImpl?() }), TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_Done, action: { proceedImpl?() @@ -425,9 +425,9 @@ private func commitChannelOwnershipTransferController(context: AccountContext, p proceedImpl?() } - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), contentNode: contentNode) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode) let presentationDataDisposable = context.sharedContext.presentationData.start(next: { [weak controller, weak contentNode] presentationData in - controller?.theme = AlertControllerTheme(presentationTheme: presentationData.theme) + controller?.theme = AlertControllerTheme(presentationData: presentationData) contentNode?.inputFieldNode.updateTheme(presentationData.theme) }) controller.dismissed = { @@ -507,7 +507,7 @@ private func commitChannelOwnershipTransferController(context: AccountContext, p private func confirmChannelOwnershipTransferController(context: AccountContext, peer: Peer, member: TelegramUser, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - let theme = AlertControllerTheme(presentationTheme: presentationData.theme) + let theme = AlertControllerTheme(presentationData: presentationData) var isGroup = true if let channel = peer as? TelegramChannel, case .broadcast = channel.info { @@ -538,9 +538,9 @@ private func confirmChannelOwnershipTransferController(context: AccountContext, func channelOwnershipTransferController(context: AccountContext, peer: Peer, member: TelegramUser, initialError: ChannelOwnershipTransferError, present: @escaping (ViewController, Any?) -> Void, completion: @escaping (PeerId?) -> Void) -> ViewController { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - let theme = AlertControllerTheme(presentationTheme: presentationData.theme) + let theme = AlertControllerTheme(presentationData: presentationData) - var title: NSAttributedString? = NSAttributedString(string: presentationData.strings.OwnershipTransfer_SecurityCheck, font: Font.medium(17.0), textColor: theme.primaryColor, paragraphAlignment: .center) + var title: NSAttributedString? = NSAttributedString(string: presentationData.strings.OwnershipTransfer_SecurityCheck, font: Font.medium(presentationData.fontSize.itemListBaseFontSize), textColor: theme.primaryColor, paragraphAlignment: .center) var text = presentationData.strings.OwnershipTransfer_SecurityRequirements var isGroup = true diff --git a/submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift b/submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift index 05e60540e0..4f8a40b838 100644 --- a/submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelPermissionsController.swift @@ -216,13 +216,13 @@ private enum ChannelPermissionsEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelPermissionsControllerArguments switch self { case let .permissionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .permission(theme, _, title, value, rights, enabled): - return ItemListSwitchItem(theme: theme, title: title, value: value, type: .icon, enableInteractiveChanges: enabled != nil, enabled: enabled ?? true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, type: .icon, enableInteractiveChanges: enabled != nil, enabled: enabled ?? true, sectionId: self.section, style: .blocks, updated: { value in if let _ = enabled { arguments.updatePermission(rights, value) } else { @@ -232,21 +232,21 @@ private enum ChannelPermissionsEntry: ItemListNodeEntry { arguments.presentRestrictedPermissionAlert(rights) }) case let .slowmodeHeader(theme, value): - return ItemListSectionHeaderItem(theme: theme, text: value, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: value, sectionId: self.section) case let .slowmode(theme, strings, value): return ChatSlowmodeItem(theme: theme, strings: strings, value: value, enabled: true, sectionId: self.section, updated: { value in arguments.updateSlowmode(value) }) case let .slowmodeInfo(theme, value): - return ItemListTextItem(theme: theme, text: .plain(value), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(value), sectionId: self.section) case let .kicked(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openKicked() }) case let .exceptionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .add(theme, text): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: false, action: { arguments.addPeer() }) case let .peerItem(theme, strings, dateTimeFormat, nameDisplayOrder, _, participant, editing, enabled, canOpen, defaultBannedRights): @@ -270,7 +270,7 @@ private enum ChannelPermissionsEntry: ItemListNodeEntry { default: break } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: canOpen ? { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: canOpen ? { arguments.openPeer(participant.participant) } : { arguments.openPeerInfo(participant.peer) @@ -828,8 +828,8 @@ public func channelPermissionsController(context: AccountContext, peerId origina }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.GroupInfo_Permissions_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: channelPermissionsControllerEntries(presentationData: presentationData, view: view, state: state, participants: participants), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && participants != nil && previous!.count >= participants!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.GroupInfo_Permissions_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelPermissionsControllerEntries(presentationData: presentationData, view: view, state: state, participants: participants), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, animateChanges: previous != nil && participants != nil && previous!.count >= participants!.count) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift index 1cda2e9038..3a500896a4 100644 --- a/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelVisibilityController.swift @@ -263,35 +263,35 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChannelVisibilityControllerArguments switch self { case let .typeHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .typePublic(theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateCurrentType(.publicChannel) }) case let .typePrivate(theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateCurrentType(.privateChannel) }) case let .typeInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .publicLinkHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .publicLinkAvailability(theme, text, value): let attr = NSMutableAttributedString(string: text, textColor: value ? theme.list.freeTextColor : theme.list.freeTextErrorColor) attr.addAttribute(.font, value: Font.regular(13), range: NSMakeRange(0, attr.length)) - return ItemListActivityTextItem(displayActivity: value, theme: theme, text: attr, sectionId: self.section) + return ItemListActivityTextItem(displayActivity: value, presentationData: presentationData, text: attr, sectionId: self.section) case let .privateLink(theme, text, value): - return ItemListActionItem(theme: theme, title: text, kind: value != nil ? .neutral : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: value != nil ? .neutral : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { if let value = value { arguments.displayPrivateLinkMenu(value) } }, tag: ChannelVisibilityEntryTag.privateLink) case let .editablePublicLink(theme, strings, placeholder, currentText): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: "t.me/", textColor: theme.list.itemPrimaryTextColor), text: currentText, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), clearType: .always, tag: ChannelVisibilityEntryTag.publicLink, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: "t.me/", textColor: theme.list.itemPrimaryTextColor), text: currentText, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), clearType: .always, tag: ChannelVisibilityEntryTag.publicLink, sectionId: self.section, textUpdated: { updatedText in arguments.updatePublicLinkText(currentText, updatedText) }, updatedFocus: { focus in if focus { @@ -300,21 +300,21 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry { }, action: { }) case let .privateLinkInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .privateLinkCopy(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.copyPrivateLink() }) case let .privateLinkRevoke(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.revokePrivateLink() }) case let .privateLinkShare(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.sharePrivateLink() }) case let .publicLinkInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .publicLinkStatus(theme, text, status): var displayActivity = false let color: UIColor @@ -334,15 +334,15 @@ private enum ChannelVisibilityEntry: ItemListNodeEntry { color = theme.list.freeTextColor displayActivity = true } - return ItemListActivityTextItem(displayActivity: displayActivity, theme: theme, text: NSAttributedString(string: text, textColor: color), sectionId: self.section) + return ItemListActivityTextItem(displayActivity: displayActivity, presentationData: presentationData, text: NSAttributedString(string: text, textColor: color), sectionId: self.section) case let .existingLinksInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .existingLinkPeerItem(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer, editing, enabled): var label = "" if let addressName = peer.addressName { label = "t.me/" + addressName } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .text(label), label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: nil, setPeerIdWithRevealedOptions: { previousId, id in + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .text(label), label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: nil, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) }, removePeer: { peerId in arguments.revokePeerId(peerId) @@ -1214,8 +1214,8 @@ public func channelVisibilityController(context: AccountContext, peerId: PeerId, focusItemTag = ChannelVisibilityEntryTag.publicLink } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: entries, style: .blocks, focusItemTag: focusItemTag, crossfadeState: crossfade, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: entries, style: .blocks, focusItemTag: focusItemTag, crossfadeState: crossfade, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/PeerInfoUI/Sources/ConvertToSupergroupController.swift b/submodules/PeerInfoUI/Sources/ConvertToSupergroupController.swift index 099dff3b95..494e9537c2 100644 --- a/submodules/PeerInfoUI/Sources/ConvertToSupergroupController.swift +++ b/submodules/PeerInfoUI/Sources/ConvertToSupergroupController.swift @@ -77,17 +77,17 @@ private enum ConvertToSupergroupEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ConvertToSupergroupArguments switch self { case let .info(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .action(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.convert() }) case let .actionInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) } } } @@ -166,8 +166,8 @@ public func convertToSupergroupController(context: AccountContext, peerId: PeerI rightNavigationButton = ItemListNavigationButton(content: .none, style: .activity, enabled: true, action: {}) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.ConvertToSupergroup_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: convertToSupergroupEntries(presentationData: presentationData), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.ConvertToSupergroup_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: convertToSupergroupEntries(presentationData: presentationData), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift b/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift index 8f4f681b0d..3c61919f78 100644 --- a/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift +++ b/submodules/PeerInfoUI/Sources/DeviceContactInfoController.swift @@ -392,35 +392,35 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { return lhs.sortIndex < rhs.sortIndex } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! DeviceContactInfoControllerArguments switch self { case let .info(_, theme, strings, dateTimeFormat, peer, state, jobSummary, isPlain): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .contact, peer: peer, presence: nil, label: jobSummary, cachedData: nil, state: state, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks(withTopInset: false, withExtendedBottomInset: true), editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .contact, peer: peer, presence: nil, label: jobSummary, cachedData: nil, state: state, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks(withTopInset: false, withExtendedBottomInset: true), editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { }, context: nil, call: nil) case let .sendMessage(_, theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { arguments.performAction(.sendMessage) }) case let .invite(_, theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { arguments.performAction(.invite) }) case let .createContact(_, theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { arguments.performAction(.createContact) }) case let .addToExisting(_, theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, action: { arguments.performAction(.addToExisting) }) case let .company(_, theme, title, value, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { }, tag: nil) case let .phoneNumber(_, index, theme, title, label, value, selected, isInteractionEnabled): - return ItemListTextWithLabelItem(theme: theme, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: isInteractionEnabled ? { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: isInteractionEnabled ? { if selected != nil { arguments.toggleSelection(.phoneNumber(label, value)) } else { @@ -432,13 +432,13 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } } : nil, tag: DeviceContactInfoEntryTag.info(index)) case let .phoneNumberSharingInfo(_, theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .phoneNumberShareViaException(_, theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: arguments.isPlain ? .plain : .blocks, updated: { value in arguments.updateShareViaException(value) }) case let .phoneNumberShareViaExceptionInfo(_, theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .editingPhoneNumber(_, theme, strings, id, title, label, value, hasActiveRevealControls): return UserInfoEditingPhoneItem(theme: theme, strings: strings, id: id, label: title, value: value, editing: UserInfoEditingPhoneItemEditing(editable: true, hasActiveRevealControls: hasActiveRevealControls), sectionId: self.section, setPhoneIdWithRevealedOptions: { lhs, rhs in arguments.setPhoneIdWithRevealedOptions(lhs, rhs) @@ -454,7 +454,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { arguments.addPhoneNumber() }) case let .email(_, index, theme, title, label, value, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.email(label, value)) } else { @@ -466,7 +466,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } }, tag: DeviceContactInfoEntryTag.info(index)) case let .url(_, index, theme, title, label, value, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: value, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: false, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.url(label, value)) } else { @@ -505,7 +505,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } }, tag: DeviceContactInfoEntryTag.info(index)) case let .birthday(_, theme, title, value, text, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.birthday) } else { @@ -534,7 +534,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } }, tag: DeviceContactInfoEntryTag.birthday) case let .socialProfile(_, index, theme, title, value, text, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.socialProfile(value)) } else if value.url.count > 0 { @@ -546,7 +546,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } }, tag: DeviceContactInfoEntryTag.info(index)) case let .instantMessenger(_, index, theme, title, value, text, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, textColor: .accent, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.instantMessenger(value)) } @@ -556,7 +556,7 @@ private enum DeviceContactInfoEntry: ItemListNodeEntry { } }, tag: DeviceContactInfoEntryTag.info(index)) case let .note(_, theme, title, text, selected): - return ItemListTextWithLabelItem(theme: theme, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: title, text: text, style: arguments.isPlain ? .plain : .blocks, enabledEntityTypes: [], multiline: true, selected: selected, sectionId: self.section, action: { if selected != nil { arguments.toggleSelection(.note) } @@ -1214,7 +1214,7 @@ public func deviceContactInfoController(context: AccountContext, subject: Device selecting = true } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: nil) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: nil) let editingPhoneIds = Set(state.phoneNumbers.map({ $0.id })) let previousPhoneIds = previousEditingPhoneIds.swap(editingPhoneIds) @@ -1236,7 +1236,7 @@ public func deviceContactInfoController(context: AccountContext, subject: Device focusItemTag = DeviceContactInfoEntryTag.editingPhone(insertedPhoneId) } - let listState = ItemListNodeState(entries: deviceContactInfoEntries(account: context.account, presentationData: presentationData, peer: peerAndContactData.0, isShare: isShare, shareViaException: shareViaException, contactData: peerAndContactData.2, isContact: peerAndContactData.1 != nil, state: state, selecting: selecting, editingPhoneNumbers: editingPhones), style: isShare ? .blocks : .plain, focusItemTag: focusItemTag) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: deviceContactInfoEntries(account: context.account, presentationData: presentationData, peer: peerAndContactData.0, isShare: isShare, shareViaException: shareViaException, contactData: peerAndContactData.2, isContact: peerAndContactData.1 != nil, state: state, selecting: selecting, editingPhoneNumbers: editingPhones), style: isShare ? .blocks : .plain, focusItemTag: focusItemTag) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/GroupInfoController.swift b/submodules/PeerInfoUI/Sources/GroupInfoController.swift index efa8d547e4..003f1668fe 100644 --- a/submodules/PeerInfoUI/Sources/GroupInfoController.swift +++ b/submodules/PeerInfoUI/Sources/GroupInfoController.swift @@ -493,27 +493,27 @@ private enum GroupInfoEntry: ItemListNodeEntry { return lhs.sortIndex < rhs.sortIndex } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! GroupInfoArguments switch self { case let .info(theme, strings, dateTimeFormat, peer, cachedData, state, updatingAvatar): - return ItemListAvatarAndNameInfoItem(account: arguments.context.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: cachedData, state: state, sectionId: self.section, style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.context.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: cachedData, state: state, sectionId: self.section, style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.tapAvatarAction() }, context: arguments.avatarAndNameInfoContext, updatingImage: updatingAvatar) case let .setGroupPhoto(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.changeProfilePhoto() }) case let .about(theme, text): - return ItemListMultilineTextItem(theme: theme, text: foldMultipleLineBreaks(text), enabledEntityTypes: [.url, .mention, .hashtag], sectionId: self.section, style: .blocks, longTapAction: { + return ItemListMultilineTextItem(presentationData: presentationData, text: foldMultipleLineBreaks(text), enabledEntityTypes: [.url, .mention, .hashtag], sectionId: self.section, style: .blocks, longTapAction: { arguments.displayAboutContextMenu(text) }, linkItemAction: { action, itemLink in arguments.aboutLinkAction(action, itemLink) }, tag: GroupInfoEntryTag.about) case let .locationHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .location(theme, location): let imageSignal = chatMapSnapshotImage(account: arguments.context.account, resource: MapSnapshotMediaResource(latitude: location.latitude, longitude: location.longitude, width: 90, height: 90)) return ItemListAddressItem(theme: theme, label: "", text: location.address.replacingOccurrences(of: ", ", with: "\n"), imageSignal: imageSignal, selected: nil, sectionId: self.section, style: .blocks, action: { @@ -522,53 +522,53 @@ private enum GroupInfoEntry: ItemListNodeEntry { arguments.displayLocationContextMenu(location.address.replacingOccurrences(of: "\n", with: ", ")) }, tag: GroupInfoEntryTag.location) case let .changeLocation(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.changeLocation() }, clearHighlightAutomatically: false) case let .link(theme, url): - return ItemListActionItem(theme: theme, title: url, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: url, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.displayUsernameShareMenu(url) }, longTapAction: { arguments.displayUsernameContextMenu(url) }, tag: GroupInfoEntryTag.link) case let .notifications(theme, title, text): - return ItemListDisclosureItem(theme: theme, title: title, label: text, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: text, sectionId: self.section, style: .blocks, action: { arguments.changeNotificationMuteSettings() }) case let .stickerPack(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openStickerPackSetup() }) case let .preHistory(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openPreHistory() }) case let .sharedMedia(theme, title): - return ItemListDisclosureItem(theme: theme, title: title, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: "", sectionId: self.section, style: .blocks, action: { arguments.openSharedMedia() }) case let .addMember(theme, title, editing): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.addPersonIcon(theme), title: title, sectionId: self.section, editing: editing, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.addPersonIcon(theme), title: title, sectionId: self.section, editing: editing, action: { arguments.addMember() }) case let .groupTypeSetup(theme, title, text): - return ItemListDisclosureItem(theme: theme, title: title, label: text, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: text, sectionId: self.section, style: .blocks, action: { arguments.openGroupTypeSetup() }) case let .linkedChannelSetup(theme, title, text): - return ItemListDisclosureItem(theme: theme, title: title, label: text, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: text, sectionId: self.section, style: .blocks, action: { arguments.openLinkedChannelSetup() }) case let .groupDescriptionSetup(theme, placeholder, text): - return ItemListMultilineInputItem(theme: theme, text: text, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in + return ItemListMultilineInputItem(presentationData: presentationData, text: text, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in arguments.updateEditingDescriptionText(updatedText) }) case let .permissions(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesChat.groupInfoPermissionsIcon(theme), title: title, label: text, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesChat.groupInfoPermissionsIcon(theme), title: title, label: text, sectionId: self.section, style: .blocks, action: { arguments.openPermissions() }) case let .administrators(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesChat.groupInfoAdminsIcon(theme), title: title, label: text, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesChat.groupInfoAdminsIcon(theme), title: title, label: text, sectionId: self.section, style: .blocks, action: { arguments.openAdministrators() }) case let .member(theme, strings, dateTimeFormat, nameDisplayOrder, _, _, peer, participant, presence, memberStatus, editing, actions, enabled, selectable): @@ -598,7 +598,7 @@ private enum GroupInfoEntry: ItemListNodeEntry { } })) } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer, presence: presence, text: .presence, label: label == nil ? .none : .text(label!, .standard), editing: editing, revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: enabled, selectable: selectable, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer, presence: presence, text: .presence, label: label == nil ? .none : .text(label!, .standard), editing: editing, revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: enabled, selectable: selectable, sectionId: self.section, action: { if let infoController = arguments.context.sharedContext.makePeerInfoController(context: arguments.context, peer: peer, mode: .generic), selectable { arguments.pushController(infoController) } @@ -608,11 +608,11 @@ private enum GroupInfoEntry: ItemListNodeEntry { arguments.removePeer(peerId) }) case let .expand(theme, title): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.downArrowImage(theme), title: title, sectionId: self.section, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.downArrowImage(theme), title: title, sectionId: self.section, editing: false, action: { arguments.expandParticipants() }) case let .leave(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.leave() }) default: @@ -2322,7 +2322,7 @@ public func groupInfoController(context: AccountContext, peerId originalPeerId: }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.GroupInfo_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.GroupInfo_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, secondaryRightNavigationButton: secondaryRightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) let entries = groupInfoEntries(account: context.account, presentationData: presentationData, view: view, channelMembers: channelMembers, globalNotificationSettings: globalNotificationSettings, state: state) var memberIds: [PeerId] = [] @@ -2344,7 +2344,7 @@ public func groupInfoController(context: AccountContext, peerId originalPeerId: } } - let listState = ItemListNodeState(entries: entries, style: .blocks, searchItem: searchItem, animateChanges: animateChanges) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: entries, style: .blocks, searchItem: searchItem, animateChanges: animateChanges) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/GroupPreHistorySetupController.swift b/submodules/PeerInfoUI/Sources/GroupPreHistorySetupController.swift index 203081f8f8..973ad20225 100644 --- a/submodules/PeerInfoUI/Sources/GroupPreHistorySetupController.swift +++ b/submodules/PeerInfoUI/Sources/GroupPreHistorySetupController.swift @@ -78,21 +78,21 @@ private enum GroupPreHistorySetupEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! GroupPreHistorySetupArguments switch self { case let .header(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .visible(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.toggle(true) }) case let .hidden(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.toggle(false) }) case let .info(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) } } } @@ -199,8 +199,8 @@ public func groupPreHistorySetupController(context: AccountContext, peerId: Peer }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Group_Setup_HistoryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: groupPreHistorySetupEntries(isSupergroup: peerId.namespace == Namespaces.Peer.CloudChannel, presentationData: presentationData, defaultValue: defaultValue, state: state), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Group_Setup_HistoryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: groupPreHistorySetupEntries(isSupergroup: peerId.namespace == Namespaces.Peer.CloudChannel, presentationData: presentationData, defaultValue: defaultValue, state: state), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift b/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift index da18984fc7..934145542f 100644 --- a/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift +++ b/submodules/PeerInfoUI/Sources/GroupStickerPackSetupController.swift @@ -208,11 +208,11 @@ private enum GroupStickerPackEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! GroupStickerPackSetupControllerArguments switch self { case let .search(theme, strings, prefix, placeholder, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: prefix, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), spacing: 0.0, clearType: .always, tag: nil, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: prefix, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), spacing: 0.0, clearType: .always, tag: nil, sectionId: self.section, textUpdated: { value in arguments.updateSearchText(value) }, processPaste: { text in if let url = (URL(string: text) ?? URL(string: "http://" + text)), url.host == "t.me" || url.host == "telegram.me" { @@ -224,11 +224,11 @@ private enum GroupStickerPackEntry: ItemListNodeEntry { return text }, action: {}) case let .searchInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section, linkAction: nil) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section, linkAction: nil) case let .packsTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .pack(_, theme, strings, info, topItem, count, playAnimatedStickers, selected): - return ItemListStickerPackItem(theme: theme, strings: strings, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: selected ? .selection : .none, editing: ItemListStickerPackItemEditing(editable: false, editing: false, revealed: false, reorderable: false), enabled: true, playAnimatedStickers: playAnimatedStickers, sectionId: self.section, action: { + return ItemListStickerPackItem(presentationData: presentationData, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: selected ? .selection : .none, editing: ItemListStickerPackItemEditing(editable: false, editing: false, revealed: false, reorderable: false), enabled: true, playAnimatedStickers: playAnimatedStickers, sectionId: self.section, action: { if selected { arguments.openStickerPack(info) } else { @@ -462,7 +462,7 @@ public func groupStickerPackSetupController(context: AccountContext, peerId: Pee } } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Channel_Info_Stickers), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Channel_Info_Stickers), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) let hasData = initialData != nil let hadData = previousHadData.swap(hasData) @@ -472,7 +472,7 @@ public func groupStickerPackSetupController(context: AccountContext, peerId: Pee emptyStateItem = ItemListLoadingIndicatorEmptyStateItem(theme: presentationData.theme) } - let listState = ItemListNodeState(entries: groupStickerPackSetupControllerEntries(presentationData: presentationData, searchText: searchState.0, view: view, initialData: initialData, searchState: searchState.1, stickerSettings: stickerSettings), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: hasData && hadData) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: groupStickerPackSetupControllerEntries(presentationData: presentationData, searchText: searchState.0, view: view, initialData: initialData, searchState: searchState.1, stickerSettings: stickerSettings), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: hasData && hadData) return (controllerState, (listState, arguments)) } |> afterDisposed { actionsDisposable.dispose() diff --git a/submodules/PeerInfoUI/Sources/GroupsInCommonController.swift b/submodules/PeerInfoUI/Sources/GroupsInCommonController.swift index 0ba5f9badc..693185f0a9 100644 --- a/submodules/PeerInfoUI/Sources/GroupsInCommonController.swift +++ b/submodules/PeerInfoUI/Sources/GroupsInCommonController.swift @@ -90,11 +90,11 @@ private enum GroupsInCommonEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! GroupsInCommonControllerArguments switch self { case let .peerItem(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer): - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .none, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .none, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.openPeer(peer.id) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in @@ -178,8 +178,8 @@ public func groupsInCommonController(context: AccountContext, peerId: PeerId) -> let previous = previousPeers previousPeers = peers - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.UserInfo_GroupsInCommon), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: groupsInCommonControllerEntries(presentationData: presentationData, state: state, peers: peers), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previous != nil && peers != nil && previous!.count >= peers!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.UserInfo_GroupsInCommon), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: groupsInCommonControllerEntries(presentationData: presentationData, state: state, peers: peers), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previous != nil && peers != nil && previous!.count >= peers!.count) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/PeerInfoUI/Sources/ItemListCallListItem.swift b/submodules/PeerInfoUI/Sources/ItemListCallListItem.swift index 9cfa007e61..ae1d09dd9c 100644 --- a/submodules/PeerInfoUI/Sources/ItemListCallListItem.swift +++ b/submodules/PeerInfoUI/Sources/ItemListCallListItem.swift @@ -12,16 +12,14 @@ import PresentationDataUtils import TelegramStringFormatting class ItemListCallListItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let dateTimeFormat: PresentationDateTimeFormat let messages: [Message] let sectionId: ItemListSectionId let style: ItemListStyle - init(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, messages: [Message], sectionId: ItemListSectionId, style: ItemListStyle) { - self.theme = theme - self.strings = strings + init(presentationData: ItemListPresentationData, dateTimeFormat: PresentationDateTimeFormat, messages: [Message], sectionId: ItemListSectionId, style: ItemListStyle) { + self.presentationData = presentationData self.dateTimeFormat = dateTimeFormat self.messages = messages self.sectionId = sectionId @@ -62,10 +60,6 @@ class ItemListCallListItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(15.0) -private let font = Font.regular(14.0) -private let typeFont = Font.medium(14.0) - private func stringForCallType(message: Message, strings: PresentationStrings) -> String { var string = "" for media in message.media { @@ -181,10 +175,14 @@ class ItemListCallListItemNode: ListViewItemNode { var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } + let titleFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + let font = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + let typeFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 14.0 / 17.0)) + let contentSize: CGSize var contentHeight: CGFloat = 0.0 let insets: UIEdgeInsets @@ -196,18 +194,18 @@ class ItemListCallListItemNode: ListViewItemNode { switch item.style { case .plain: - itemBackgroundColor = item.theme.list.plainBackgroundColor - itemSeparatorColor = item.theme.list.itemPlainSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.plainBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemPlainSeparatorColor insets = itemListNeighborsPlainInsets(neighbors) case .blocks: - itemBackgroundColor = item.theme.list.itemBlocksBackgroundColor - itemSeparatorColor = item.theme.list.itemBlocksSeparatorColor + itemBackgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + itemSeparatorColor = item.presentationData.theme.list.itemBlocksSeparatorColor insets = itemListNeighborsGroupedInsets(neighbors) } let earliestMessage = item.messages.sorted(by: {$0.timestamp < $1.timestamp}).first! - let titleText = stringForDate(timestamp: earliestMessage.timestamp, strings: item.strings) - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: titleText, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let titleText = stringForDate(timestamp: earliestMessage.timestamp, strings: item.presentationData.strings) + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: titleText, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) contentHeight += titleLayout.size.height + 18.0 @@ -217,11 +215,11 @@ class ItemListCallListItemNode: ListViewItemNode { for message in item.messages { let makeTimeLayout = makeNodesLayout[index].0 let time = stringForMessageTimestamp(timestamp: message.timestamp, dateTimeFormat: item.dateTimeFormat) - let (timeLayout, timeApply) = makeTimeLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: time, font: font, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let (timeLayout, timeApply) = makeTimeLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: time, font: font, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let makeTypeLayout = makeNodesLayout[index].1 - let type = stringForCallType(message: message, strings: item.strings) - let (typeLayout, typeApply) = makeTypeLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: type, font: typeFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let type = stringForCallType(message: message, strings: item.presentationData.strings) + let (typeLayout, typeApply) = makeTypeLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: type, font: typeFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - leftInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) nodesLayout.append((timeLayout, typeLayout)) nodesApply.append((timeApply, typeApply)) diff --git a/submodules/PeerInfoUI/Sources/PeerReportController.swift b/submodules/PeerInfoUI/Sources/PeerReportController.swift index 759c2d8d84..e0ce0e9a09 100644 --- a/submodules/PeerInfoUI/Sources/PeerReportController.swift +++ b/submodules/PeerInfoUI/Sources/PeerReportController.swift @@ -254,11 +254,11 @@ private enum PeerReportControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! PeerReportControllerArguments switch self { case let .text(theme, title, value): - return ItemListMultilineInputItem(theme: theme, text: value, placeholder: title, maxLength: nil, sectionId: self.section, style: .blocks, textUpdated: { text in + return ItemListMultilineInputItem(presentationData: presentationData, text: value, placeholder: title, maxLength: nil, sectionId: self.section, style: .blocks, textUpdated: { text in arguments.updateText(text) }, tag: PeerReportControllerEntryTag.text) } @@ -338,11 +338,11 @@ private func peerReportController(context: AccountContext, subject: PeerReportSu }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.ReportPeer_ReasonOther_Title), leftNavigationButton: ItemListNavigationButton(content: .text(presentationData.strings.Common_Cancel), style: .regular, enabled: true, action: { + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.ReportPeer_ReasonOther_Title), leftNavigationButton: ItemListNavigationButton(content: .text(presentationData.strings.Common_Cancel), style: .regular, enabled: true, action: { dismissImpl?() completion(false) }), rightNavigationButton: rightButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: peerReportControllerEntries(presentationData: presentationData, state: state), style: .blocks, focusItemTag: PeerReportControllerEntryTag.text) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: peerReportControllerEntries(presentationData: presentationData, state: state), style: .blocks, focusItemTag: PeerReportControllerEntryTag.text) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/PhoneLabelController.swift b/submodules/PeerInfoUI/Sources/PhoneLabelController.swift index ef3da80093..d0e1659679 100644 --- a/submodules/PeerInfoUI/Sources/PhoneLabelController.swift +++ b/submodules/PeerInfoUI/Sources/PhoneLabelController.swift @@ -57,11 +57,11 @@ private enum PhoneLabelEntry: ItemListNodeEntry { return lhs.index < rhs.index } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! PhoneLabelArguments switch self { case let .label(_, theme, value, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectLabel(value) }) } @@ -120,8 +120,8 @@ public func phoneLabelController(context: AccountContext, currentLabel: String, arguments.complete() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.PhoneLabel_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: phoneLabelEntries(presentationData: presentationData, state: state), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.PhoneLabel_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: phoneLabelEntries(presentationData: presentationData, state: state), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/UserInfoController.swift b/submodules/PeerInfoUI/Sources/UserInfoController.swift index e614960ca9..564eb79e5e 100644 --- a/submodules/PeerInfoUI/Sources/UserInfoController.swift +++ b/submodules/PeerInfoUI/Sources/UserInfoController.swift @@ -393,11 +393,11 @@ private enum UserInfoEntry: ItemListNodeEntry { return lhs.sortIndex < rhs.sortIndex } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! UserInfoControllerArguments switch self { case let .info(theme, strings, dateTimeFormat, peer, presence, cachedData, state, displayCall): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: cachedData, state: state, sectionId: self.section, style: .plain, editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: presence, cachedData: cachedData, state: state, sectionId: self.section, style: .plain, editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.tapAvatarAction() @@ -405,63 +405,63 @@ private enum UserInfoEntry: ItemListNodeEntry { arguments.call() } : nil) case let .calls(theme, strings, dateTimeFormat, messages): - return ItemListCallListItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, messages: messages, sectionId: self.section, style: .plain) + return ItemListCallListItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, messages: messages, sectionId: self.section, style: .plain) case let .about(theme, peer, text, value): var enabledEntityTypes: EnabledEntityTypes = [] if let peer = peer as? TelegramUser, let _ = peer.botInfo { enabledEntityTypes = [.url, .mention, .hashtag] } - return ItemListTextWithLabelItem(theme: theme, label: text, text: foldMultipleLineBreaks(value), enabledEntityTypes: enabledEntityTypes, multiline: true, sectionId: self.section, action: nil, longTapAction: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: foldMultipleLineBreaks(value), enabledEntityTypes: enabledEntityTypes, multiline: true, sectionId: self.section, action: nil, longTapAction: { arguments.displayAboutContextMenu(value) }, linkItemAction: { action, itemLink in arguments.aboutLinkAction(action, itemLink) }, tag: UserInfoEntryTag.about) case let .phoneNumber(theme, _, label, value, isMain): - return ItemListTextWithLabelItem(theme: theme, label: label, text: value, textColor: isMain ? .highlighted : .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: label, text: value, textColor: isMain ? .highlighted : .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { arguments.openCallMenu(value) }, longTapAction: { arguments.displayCopyContextMenu(.phoneNumber, value) }, tag: UserInfoEntryTag.phoneNumber) case let .requestPhoneNumber(theme, label, value): - return ItemListTextWithLabelItem(theme: theme, label: label, text: value, textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: label, text: value, textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { arguments.requestPhoneNumber() }) case let .userName(theme, text, value): - return ItemListTextWithLabelItem(theme: theme, label: text, text: "@\(value)", textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { + return ItemListTextWithLabelItem(presentationData: presentationData, label: text, text: "@\(value)", textColor: .accent, enabledEntityTypes: [], multiline: false, sectionId: self.section, action: { arguments.displayUsernameContextMenu("@\(value)") }, longTapAction: { arguments.displayCopyContextMenu(.username, "@\(value)") }, tag: UserInfoEntryTag.username) case let .sendMessage(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.openChat() }) case let .addContact(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.addContact() }) case let .shareContact(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.shareContact() }) case let .shareMyContact(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.shareMyContact() }) case let .startSecretChat(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.startSecretChat() }) case let .sharedMedia(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .plain, action: { arguments.openSharedMedia() }) case let .notifications(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.changeNotificationMuteSettings() }) case let .groupsInCommon(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .plain, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .plain, action: { arguments.openGroupsInCommon() }) case let .secretEncryptionKey(theme, text, fingerprint): @@ -469,31 +469,31 @@ private enum UserInfoEntry: ItemListNodeEntry { arguments.openEncryptionKey(fingerprint) }) case let .botAddToGroup(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.addBotToGroup() }) case let .botShare(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.shareBot() }) case let .botSettings(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.botSettings() }) case let .botHelp(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.botHelp() }) case let .botPrivacy(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.botPrivacy() }) case let .botReport(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .plain, action: { arguments.report() }) case let .block(theme, text, action): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .plain, action: { switch action { case .block: arguments.updatePeerBlocked(true) @@ -1304,8 +1304,8 @@ public func userInfoController(context: AccountContext, peerId: PeerId, mode: Pe }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.UserInfo_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: nil) - let listState = ItemListNodeState(entries: userInfoEntries(account: context.account, presentationData: presentationData, view: view.0, cachedPeerData: view.1, deviceContacts: deviceContacts, mode: mode, state: state, peerChatState: (combinedView.views[.peerChatState(peerId: peerId)] as? PeerChatStateView)?.chatState, globalNotificationSettings: globalNotificationSettings), style: .plain) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.UserInfo_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: nil) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: userInfoEntries(account: context.account, presentationData: presentationData, view: view.0, cachedPeerData: view.1, deviceContacts: deviceContacts, mode: mode, state: state, peerChatState: (combinedView.views[.peerChatState(peerId: peerId)] as? PeerChatStateView)?.chatState, globalNotificationSettings: globalNotificationSettings), style: .plain) return (controllerState, (listState, arguments)) } diff --git a/submodules/PeerInfoUI/Sources/UserInfoEditingPhoneItem.swift b/submodules/PeerInfoUI/Sources/UserInfoEditingPhoneItem.swift index cc173f5780..14553478ad 100644 --- a/submodules/PeerInfoUI/Sources/UserInfoEditingPhoneItem.swift +++ b/submodules/PeerInfoUI/Sources/UserInfoEditingPhoneItem.swift @@ -203,7 +203,7 @@ class UserInfoEditingPhoneItemNode: ItemListRevealOptionsItemNode, ItemListItemN updatedTheme = item.theme } - let controlSizeAndApply = editableControlLayout(44.0, item.theme, false) + let controlSizeAndApply = editableControlLayout(item.theme, false) let textColor = item.theme.list.itemAccentColor @@ -261,8 +261,8 @@ class UserInfoEditingPhoneItemNode: ItemListRevealOptionsItemNode, ItemListItemN strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - leftInset, height: separatorHeight)) - let _ = controlSizeAndApply.1() - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + 4.0 + revealOffset, y: 0.0), size: controlSizeAndApply.0) + let _ = controlSizeAndApply.1(layout.contentSize.height) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + 4.0 + revealOffset, y: 0.0), size: CGSize(width: controlSizeAndApply.0, height: layout.contentSize.height)) strongSelf.editableControlNode.frame = editableControlFrame let labelFrame = CGRect(origin: CGPoint(x: revealOffset + leftInset + 30.0, y: 12.0), size: labelLayout.size) diff --git a/submodules/PeersNearbyUI/Sources/PeersNearbyController.swift b/submodules/PeersNearbyUI/Sources/PeersNearbyController.swift index d5dfe4cf05..53345fc1df 100644 --- a/submodules/PeersNearbyUI/Sources/PeersNearbyController.swift +++ b/submodules/PeersNearbyUI/Sources/PeersNearbyController.swift @@ -190,23 +190,23 @@ private enum PeersNearbyEntry: ItemListNodeEntry { return result } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! PeersNearbyControllerArguments switch self { case let .header(theme, text): return PeersNearbyHeaderItem(theme: theme, text: text, sectionId: self.section) case let .usersHeader(theme, text, loading): - return ItemListSectionHeaderItem(theme: theme, text: text, activityIndicator: loading ? .left : .none, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, activityIndicator: loading ? .left : .none, sectionId: self.section) case let .empty(theme, text): return ItemListPlaceholderItem(theme: theme, text: text, sectionId: self.section, style: .blocks) case let .user(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer): - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: .text(strings.Map_DistanceAway(stringForDistance(peer.distance)).0), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: .text(strings.Map_DistanceAway(stringForDistance(peer.distance)).0), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.openChat(peer.peer.0) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }, toggleUpdated: nil, hasTopGroupInset: false, tag: nil) case let .groupsHeader(theme, text, loading): - return ItemListSectionHeaderItem(theme: theme, text: text, activityIndicator: loading ? .left : .none, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, activityIndicator: loading ? .left : .none, sectionId: self.section) case let .createGroup(theme, title, latitude, longitude, address): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.createGroupIcon(theme), title: title, alwaysPlain: false, sectionId: self.section, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.createGroupIcon(theme), title: title, alwaysPlain: false, sectionId: self.section, editing: false, action: { if let latitude = latitude, let longitude = longitude { arguments.openCreateGroup(latitude, longitude, address) } @@ -218,11 +218,11 @@ private enum PeersNearbyEntry: ItemListNodeEntry { } else { text = .text(strings.Map_DistanceAway(stringForDistance(peer.distance)).0) } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: text, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: text, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.openChat(peer.peer.0) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }, toggleUpdated: nil, hasTopGroupInset: false, tag: nil) case let .channelsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .channel(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer): var text: ItemListPeerItemText if let cachedData = peer.peer.1 as? CachedChannelData, let memberCount = cachedData.participantsSummary.memberCount { @@ -230,7 +230,7 @@ private enum PeersNearbyEntry: ItemListNodeEntry { } else { text = .text(strings.Map_DistanceAway(stringForDistance(peer.distance)).0) } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: text, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.context.account, peer: peer.peer.0, aliasHandling: .standard, nameColor: .primary, nameStyle: .distinctBold, presence: nil, text: text, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.openChat(peer.peer.0) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }, toggleUpdated: nil, hasTopGroupInset: false, tag: nil) } @@ -425,8 +425,8 @@ public func peersNearbyController(context: AccountContext) -> ViewController { crossfade = true } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.PeopleNearby_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: peersNearbyControllerEntries(data: data, presentationData: presentationData, displayLoading: displayLoading), style: .blocks, emptyStateItem: nil, crossfadeState: crossfade, animateChanges: !crossfade) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.PeopleNearby_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: peersNearbyControllerEntries(data: data, presentationData: presentationData, displayLoading: displayLoading), style: .blocks, emptyStateItem: nil, crossfadeState: crossfade, animateChanges: !crossfade) return (controllerState, (listState, arguments)) } diff --git a/submodules/Postbox/Sources/ChatListIndexTable.swift b/submodules/Postbox/Sources/ChatListIndexTable.swift index 9e1a41e51e..3d12b9b25a 100644 --- a/submodules/Postbox/Sources/ChatListIndexTable.swift +++ b/submodules/Postbox/Sources/ChatListIndexTable.swift @@ -286,6 +286,20 @@ final class ChatListIndexTable: Table { alteredPeerIds.insert(peerId) } + var additionalAlteredPeerIds = Set() + for peerId in alteredPeerIds { + guard let peer = postbox.peerTable.get(peerId) else { + continue + } + if let associatedPeerId = peer.associatedPeerId { + additionalAlteredPeerIds.insert(associatedPeerId) + } + if let reverseAssociatedPeerId = postbox.reverseAssociatedPeerTable.get(peerId: peerId).first { + additionalAlteredPeerIds.insert(reverseAssociatedPeerId) + } + } + alteredPeerIds.formUnion(additionalAlteredPeerIds) + func alterTags(_ totalUnreadState: inout ChatListTotalUnreadState, _ peerId: PeerId, _ tag: PeerSummaryCounterTags, _ f: (ChatListTotalUnreadCounters, ChatListTotalUnreadCounters) -> (ChatListTotalUnreadCounters, ChatListTotalUnreadCounters)) { if totalUnreadState.absoluteCounters[tag] == nil { totalUnreadState.absoluteCounters[tag] = ChatListTotalUnreadCounters(messageCount: 0, chatCount: 0) @@ -404,10 +418,10 @@ final class ChatListIndexTable: Table { var initialFilteredStates: CombinedPeerReadState = initialStates var currentFilteredStates: CombinedPeerReadState = currentStates - if transactionParticipationInTotalUnreadCountUpdates.added.contains(peerId) { + if transactionParticipationInTotalUnreadCountUpdates.added.contains(peerId) || transactionParticipationInTotalUnreadCountUpdates.added.contains(notificationPeerId) { initialFilteredValue = (0, false, false) initialFilteredStates = CombinedPeerReadState(states: []) - } else if transactionParticipationInTotalUnreadCountUpdates.removed.contains(peerId) { + } else if transactionParticipationInTotalUnreadCountUpdates.removed.contains(peerId) || transactionParticipationInTotalUnreadCountUpdates.removed.contains(notificationPeerId) { currentFilteredValue = (0, false, false) currentFilteredStates = CombinedPeerReadState(states: []) } else { diff --git a/submodules/PresentationDataUtils/Sources/AlertTheme.swift b/submodules/PresentationDataUtils/Sources/AlertTheme.swift index e9245c8313..9a0c25b108 100644 --- a/submodules/PresentationDataUtils/Sources/AlertTheme.swift +++ b/submodules/PresentationDataUtils/Sources/AlertTheme.swift @@ -5,9 +5,9 @@ import AccountContext import SwiftSignalKit public func textAlertController(context: AccountContext, title: String?, text: String, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true) -> AlertController { - return textAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationTheme: context.sharedContext.currentPresentationData.with({ $0 }).theme), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationTheme: presentationData.theme) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset) + return textAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationData: context.sharedContext.currentPresentationData.with { $0 }), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationData: presentationData) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset) } public func richTextAlertController(context: AccountContext, title: NSAttributedString?, text: NSAttributedString, actions: [TextAlertAction], actionLayout: TextAlertContentActionLayout = .horizontal, allowInputInset: Bool = true, dismissAutomatically: Bool = true) -> AlertController { - return richTextAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationTheme: context.sharedContext.currentPresentationData.with({ $0 }).theme), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationTheme: presentationData.theme) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset, dismissAutomatically: dismissAutomatically) + return richTextAlertController(alertContext: AlertControllerContext(theme: AlertControllerTheme(presentationData: context.sharedContext.currentPresentationData.with { $0 }), themeSignal: context.sharedContext.presentationData |> map { presentationData in AlertControllerTheme(presentationData: presentationData) }), title: title, text: text, actions: actions, actionLayout: actionLayout, allowInputInset: allowInputInset, dismissAutomatically: dismissAutomatically) } diff --git a/submodules/PresentationDataUtils/Sources/ItemListController.swift b/submodules/PresentationDataUtils/Sources/ItemListController.swift index 7887853851..e563d060a2 100644 --- a/submodules/PresentationDataUtils/Sources/ItemListController.swift +++ b/submodules/PresentationDataUtils/Sources/ItemListController.swift @@ -13,6 +13,6 @@ public extension ItemListController { convenience init(sharedContext: SharedAccountContext, state: Signal<(ItemListControllerState, (ItemListNodeState, ItemGenerationArguments)), NoError>, tabBarItem: Signal? = nil) { let presentationData = sharedContext.currentPresentationData.with { $0 } - self.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: sharedContext.presentationData |> map { ($0.theme, $0.strings) }, state: state, tabBarItem: tabBarItem) + self.init(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: sharedContext.presentationData |> map(ItemListPresentationData.init(_:)), state: state, tabBarItem: tabBarItem) } } diff --git a/submodules/SettingsUI/Sources/ChangePhoneNumberCodeController.swift b/submodules/SettingsUI/Sources/ChangePhoneNumberCodeController.swift index eb8b98ef4a..3f37c4c2a7 100644 --- a/submodules/SettingsUI/Sources/ChangePhoneNumberCodeController.swift +++ b/submodules/SettingsUI/Sources/ChangePhoneNumberCodeController.swift @@ -86,17 +86,17 @@ private enum ChangePhoneNumberCodeEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChangePhoneNumberCodeControllerArguments switch self { case let .codeEntry(theme, strings, title, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: title, textColor: .black), text: text, placeholder: "", type: .number, spacing: 10.0, tag: ChangePhoneNumberCodeTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: title, textColor: .black), text: text, placeholder: "", type: .number, spacing: 10.0, tag: ChangePhoneNumberCodeTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() }) case let .codeInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -184,7 +184,7 @@ private final class ChangePhoneNumberCodeControllerImpl: ItemListController, Cha self.applyCodeImpl = applyCodeImpl let presentationData = context.sharedContext.currentPresentationData.with { $0 } - super.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: context.sharedContext.presentationData |> map { ($0.theme, $0.strings) }, state: state, tabBarItem: nil) + super.init(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: context.sharedContext.presentationData |> map(ItemListPresentationData.init(_:)), state: state, tabBarItem: nil) } required init(coder aDecoder: NSCoder) { @@ -313,8 +313,8 @@ func changePhoneNumberCodeController(context: AccountContext, phoneNumber: Strin }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(formatPhoneNumber(phoneNumber)), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: changePhoneNumberCodeControllerEntries(presentationData: presentationData, state: state, codeData: data, timeout: timeout, strings: presentationData.strings), style: .blocks, focusItemTag: ChangePhoneNumberCodeTag.input, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(formatPhoneNumber(phoneNumber)), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: changePhoneNumberCodeControllerEntries(presentationData: presentationData, state: state, codeData: data, timeout: timeout, strings: presentationData.strings), style: .blocks, focusItemTag: ChangePhoneNumberCodeTag.input, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Data and Storage/AutodownloadConnectionTypeController.swift b/submodules/SettingsUI/Sources/Data and Storage/AutodownloadConnectionTypeController.swift index 39b3c1775c..a3405f6639 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/AutodownloadConnectionTypeController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/AutodownloadConnectionTypeController.swift @@ -142,35 +142,35 @@ private enum AutodownloadMediaCategoryEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! AutodownloadMediaConnectionTypeControllerArguments switch self { case let .master(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleMaster(value) }) case let .dataUsageHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .dataUsageItem(theme, strings, value, customPosition, enabled): return AutodownloadDataUsagePickerItem(theme: theme, strings: strings, value: value, customPosition: customPosition, enabled: enabled, sectionId: self.section, updated: { preset in arguments.changePreset(preset) }) case let .typesHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .photos(theme, text, value, enabled): - return ItemListDisclosureItem(theme: theme, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { arguments.customize(.photo) }) case let .videos(theme, text, value, enabled): - return ItemListDisclosureItem(theme: theme, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { arguments.customize(.video) }) case let .files(theme, text, value, enabled): - return ItemListDisclosureItem(theme: theme, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, enabled: enabled, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { arguments.customize(.file) }) case let .voiceMessagesInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -345,8 +345,8 @@ func autodownloadMediaConnectionTypeController(context: AccountContext, connecti title = presentationData.strings.AutoDownloadSettings_WifiTitle } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: autodownloadMediaConnectionTypeControllerEntries(presentationData: presentationData, connectionType: connectionType, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: autodownloadMediaConnectionTypeControllerEntries(presentationData: presentationData, connectionType: connectionType, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/AutodownloadMediaCategoryController.swift b/submodules/SettingsUI/Sources/Data and Storage/AutodownloadMediaCategoryController.swift index c506cb0b60..3591b7c92b 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/AutodownloadMediaCategoryController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/AutodownloadMediaCategoryController.swift @@ -170,39 +170,39 @@ private enum AutodownloadMediaCategoryEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! AutodownloadMediaCategoryControllerArguments switch self { case let .peerHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .peerContacts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.togglePeer(.contact) }) case let .peerOtherPrivate(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.togglePeer(.otherPrivate) }) case let .peerGroups(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.togglePeer(.group) }) case let .peerChannels(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.togglePeer(.channel) }) case let .sizeHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .sizeItem(theme, decimalSeparator, text, value): return AutodownloadSizeLimitItem(theme: theme, decimalSeparator: decimalSeparator, text: text, value: value, sectionId: self.section, updated: { value in arguments.adjustSize(value) }) case let .sizePreload(theme, text, value, enabled): - return ItemListSwitchItem(theme: theme, title: text, value: value && enabled, enableInteractiveChanges: true, enabled: enabled, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value && enabled, enableInteractiveChanges: true, enabled: enabled, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleVideoPreload() }) case let .sizePreloadInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -427,8 +427,8 @@ func autodownloadMediaCategoryController(context: AccountContext, connectionType title = presentationData.strings.AutoDownloadSettings_DocumentsTitle } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: autodownloadMediaCategoryControllerEntries(presentationData: presentationData, connectionType: connectionType, category: category, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: autodownloadMediaCategoryControllerEntries(presentationData: presentationData, connectionType: connectionType, category: category, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/DataAndStorageSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/DataAndStorageSettingsController.swift index 0df0bedfd0..a7190c7839 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/DataAndStorageSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/DataAndStorageSettingsController.swift @@ -272,73 +272,73 @@ private enum DataAndStorageEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! DataAndStorageControllerArguments switch self { case let .storageUsage(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openStorageUsage() }) case let .networkUsage(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openNetworkUsage() }) case let .automaticDownloadHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .automaticDownloadCellular(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { arguments.openAutomaticDownloadConnectionType(.cellular) }) case let .automaticDownloadWifi(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, labelStyle: .detailText, sectionId: self.section, style: .blocks, action: { arguments.openAutomaticDownloadConnectionType(.wifi) }) case let .automaticDownloadReset(theme, text, enabled): - return ItemListActionItem(theme: theme, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { if enabled { arguments.resetAutomaticDownload() } }, tag: DataAndStorageEntryTag.automaticDownloadReset) case let .autoplayHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .autoplayGifs(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleAutoplayGifs(value) }, tag: DataAndStorageEntryTag.autoplayGifs) case let .autoplayVideos(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleAutoplayVideos(value) }, tag: DataAndStorageEntryTag.autoplayVideos) case let .voiceCallsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .useLessVoiceData(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openVoiceUseLessData() }) case let .otherHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .saveIncomingPhotos(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openSaveIncomingPhotos() }) case let .saveEditedPhotos(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleSaveEditedPhotos(value) }, tag: DataAndStorageEntryTag.saveEditedPhotos) case let .openLinksIn(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openBrowserSelection() }) case let .downloadInBackground(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleDownloadInBackground(value) }, tag: DataAndStorageEntryTag.downloadInBackground) case let .downloadInBackgroundInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .connectionHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .connectionProxy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openProxy() }) } @@ -600,8 +600,8 @@ func dataAndStorageController(context: AccountContext, focusOnItemTag: DataAndSt defaultWebBrowser = presentationData.strings.WebBrowser_InAppSafari } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.ChatSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: dataAndStorageControllerEntries(state: state, data: dataAndStorageData, presentationData: presentationData, defaultWebBrowser: defaultWebBrowser), style: .blocks, ensureVisibleItemTag: focusOnItemTag, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.ChatSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: dataAndStorageControllerEntries(state: state, data: dataAndStorageData, presentationData: presentationData, defaultWebBrowser: defaultWebBrowser), style: .blocks, ensureVisibleItemTag: focusOnItemTag, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Data and Storage/NetworkUsageStatsController.swift b/submodules/SettingsUI/Sources/Data and Storage/NetworkUsageStatsController.swift index 841149016d..a59748fcf5 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/NetworkUsageStatsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/NetworkUsageStatsController.swift @@ -255,51 +255,51 @@ private enum NetworkUsageStatsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! NetworkUsageStatsControllerArguments switch self { case let .messagesHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .messagesSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .messagesReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .imageHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .imageSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .imageReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .videoHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .videoSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .videoReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .audioHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .audioSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .audioReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .fileHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .fileSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .fileReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .callHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .callSent(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .callReceived(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, disclosureStyle: .none , action: nil) case let .reset(theme, section, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.resetStatistics(section) }) case let .resetTimestamp(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -416,8 +416,8 @@ func networkUsageStatsController(context: AccountContext) -> ViewController { let signal = combineLatest(context.sharedContext.presentationData, section.get(), stats.get()) |> deliverOnMainQueue |> map { presentationData, section, stats -> (ItemListControllerState, (ItemListNodeState, Any)) in - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .sectionControl([presentationData.strings.NetworkUsageSettings_Cellular, presentationData.strings.NetworkUsageSettings_Wifi], 0), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: networkUsageStatsControllerEntries(presentationData: presentationData, section: section, stats: stats), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .sectionControl([presentationData.strings.NetworkUsageSettings_Cellular, presentationData.strings.NetworkUsageSettings_Wifi], 0), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: networkUsageStatsControllerEntries(presentationData: presentationData, section: section, stats: stats), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift index 424e0b6206..9d36248e23 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift @@ -202,11 +202,11 @@ private enum ProxySettingsControllerEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ProxySettingsControllerArguments switch self { case let .enabled(theme, text, value, createsNew): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: !createsNew, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: !createsNew, enabled: true, sectionId: self.section, style: .blocks, updated: { value in if createsNew { arguments.addNewServer() } else { @@ -214,7 +214,7 @@ private enum ProxySettingsControllerEntry: ItemListNodeEntry { } }) case let .serversHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .addServer(theme, text, _): return ProxySettingsActionItem(theme: theme, title: text, icon: .add, sectionId: self.section, editing: false, action: { arguments.addNewServer() @@ -234,11 +234,11 @@ private enum ProxySettingsControllerEntry: ItemListNodeEntry { arguments.shareProxyList() }) case let .useForCalls(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleUseForCalls(value) }) case let .useForCallsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -315,10 +315,10 @@ public enum ProxySettingsControllerMode { public func proxySettingsController(context: AccountContext, mode: ProxySettingsControllerMode = .default) -> ViewController { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - return proxySettingsController(accountManager: context.sharedContext.accountManager, context: context, postbox: context.account.postbox, network: context.account.network, mode: mode, theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: context.sharedContext.presentationData |> map { ($0.theme, $0.strings) }) + return proxySettingsController(accountManager: context.sharedContext.accountManager, context: context, postbox: context.account.postbox, network: context.account.network, mode: mode, presentationData: presentationData, updatedPresentationData: context.sharedContext.presentationData) } -public func proxySettingsController(accountManager: AccountManager, context: AccountContext? = nil, postbox: Postbox, network: Network, mode: ProxySettingsControllerMode, theme: PresentationTheme, strings: PresentationStrings, updatedPresentationData: Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError>) -> ViewController { +public func proxySettingsController(accountManager: AccountManager, context: AccountContext? = nil, postbox: Postbox, network: Network, mode: ProxySettingsControllerMode, presentationData: PresentationData, updatedPresentationData: Signal) -> ViewController { var presentControllerImpl: ((ViewController, Any?) -> Void)? var pushControllerImpl: ((ViewController) -> Void)? var dismissImpl: (() -> Void)? @@ -347,7 +347,7 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc return current }).start() }, addNewServer: { - pushControllerImpl?(proxyServerSettingsController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, accountManager: accountManager, postbox: postbox, network: network, currentSettings: nil)) + pushControllerImpl?(proxyServerSettingsController(presentationData: presentationData, updatedPresentationData: updatedPresentationData, accountManager: accountManager, postbox: postbox, network: network, currentSettings: nil)) }, activateServer: { server in let _ = updateProxySettingsInteractively(accountManager: accountManager, { current in var current = current @@ -360,7 +360,7 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc return current }).start() }, editServer: { server in - pushControllerImpl?(proxyServerSettingsController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, accountManager: accountManager, postbox: postbox, network: network, currentSettings: server)) + pushControllerImpl?(proxyServerSettingsController(presentationData: presentationData, updatedPresentationData: updatedPresentationData, accountManager: accountManager, postbox: postbox, network: network, currentSettings: server)) }, removeServer: { server in let _ = updateProxySettingsInteractively(accountManager: accountManager, { current in var current = current @@ -407,10 +407,10 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc }) let signal = combineLatest(updatedPresentationData, statePromise.get(), proxySettings.get(), statusesContext.statuses(), network.connectionStatus) - |> map { themeAndStrings, state, proxySettings, statuses, connectionStatus -> (ItemListControllerState, (ItemListNodeState, Any)) in + |> map { presentationData, state, proxySettings, statuses, connectionStatus -> (ItemListControllerState, (ItemListNodeState, Any)) in var leftNavigationButton: ItemListNavigationButton? if case .modal = mode { - leftNavigationButton = ItemListNavigationButton(content: .text(themeAndStrings.strings.Common_Cancel), style: .regular, enabled: true, action: { + leftNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Cancel), style: .regular, enabled: true, action: { dismissImpl?() }) } @@ -419,7 +419,7 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc if proxySettings.servers.isEmpty { rightNavigationButton = nil } else if state.editing { - rightNavigationButton = ItemListNavigationButton(content: .text(strings.Common_Done), style: .bold, enabled: true, action: { + rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Done), style: .bold, enabled: true, action: { updateState { state in var state = state state.editing = false @@ -427,7 +427,7 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc } }) } else { - rightNavigationButton = ItemListNavigationButton(content: .text(strings.Common_Edit), style: .regular, enabled: true, action: { + rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Edit), style: .regular, enabled: true, action: { updateState { state in var state = state state.editing = true @@ -436,13 +436,13 @@ public func proxySettingsController(accountManager: AccountManager, context: Acc }) } - let controllerState = ItemListControllerState(theme: themeAndStrings.0, title: .text(themeAndStrings.1.SocksProxySetup_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: themeAndStrings.1.Common_Back)) - let listState = ItemListNodeState(entries: proxySettingsControllerEntries(theme: themeAndStrings.0, strings: themeAndStrings.1, state: state, proxySettings: proxySettings, statuses: statuses, connectionStatus: connectionStatus), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.SocksProxySetup_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: proxySettingsControllerEntries(theme: presentationData.theme, strings: presentationData.strings, state: state, proxySettings: proxySettings, statuses: statuses, connectionStatus: connectionStatus), style: .blocks) return (controllerState, (listState, arguments)) } - let controller = ItemListController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, state: signal, tabBarItem: nil) + let controller = ItemListController(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: updatedPresentationData |> map(ItemListPresentationData.init(_:)), state: signal, tabBarItem: nil) controller.navigationPresentation = .modal presentControllerImpl = { [weak controller] c, a in controller?.present(c, in: .window(.root), with: a) diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift index aa56df559d..0302f15264 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift @@ -25,27 +25,27 @@ public final class ProxyServerActionSheetController: ActionSheetController { convenience public init(context: AccountContext, server: ProxyServerSettings) { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.init(theme: presentationData.theme, strings: presentationData.strings, accountManager: context.sharedContext.accountManager, postbox: context.account.postbox, network: context.account.network, server: server, presentationData: context.sharedContext.presentationData) + self.init(presentationData: presentationData, accountManager: context.sharedContext.accountManager, postbox: context.account.postbox, network: context.account.network, server: server, updatedPresentationData: context.sharedContext.presentationData) } - public init(theme: PresentationTheme, strings: PresentationStrings, accountManager: AccountManager, postbox: Postbox, network: Network, server: ProxyServerSettings, presentationData: Signal?) { - let sheetTheme = ActionSheetControllerTheme(presentationTheme: theme) + public init(presentationData: PresentationData, accountManager: AccountManager, postbox: Postbox, network: Network, server: ProxyServerSettings, updatedPresentationData: Signal?) { + let sheetTheme = ActionSheetControllerTheme(presentationTheme: presentationData.theme) super.init(theme: sheetTheme) self._ready.set(.single(true)) var items: [ActionSheetItem] = [] if case .mtp = server.connection { - items.append(ActionSheetTextItem(title: strings.SocksProxySetup_AdNoticeHelp)) + items.append(ActionSheetTextItem(title: presentationData.strings.SocksProxySetup_AdNoticeHelp)) } - items.append(ProxyServerInfoItem(strings: strings, network: network, server: server)) - items.append(ProxyServerActionItem(accountManager:accountManager, postbox: postbox, network: network, presentationTheme: theme, strings: strings, server: server, dismiss: { [weak self] success in + items.append(ProxyServerInfoItem(strings: presentationData.strings, network: network, server: server)) + items.append(ProxyServerActionItem(accountManager:accountManager, postbox: postbox, network: network, presentationData: presentationData, server: server, dismiss: { [weak self] success in guard let strongSelf = self, !strongSelf.isDismissed else { return } strongSelf.isDismissed = true if success { - strongSelf.present(OverlayStatusController(theme: theme, type: .shieldSuccess(strings.SocksProxySetup_ProxyEnabled, false)), in: .window(.root)) + strongSelf.present(OverlayStatusController(theme: presentationData.theme, type: .shieldSuccess(presentationData.strings.SocksProxySetup_ProxyEnabled, false)), in: .window(.root)) } strongSelf.dismissAnimated() }, present: { [weak self] c, a in @@ -54,14 +54,14 @@ public final class ProxyServerActionSheetController: ActionSheetController { self.setItemGroups([ ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [ - ActionSheetButtonItem(title: strings.Common_Cancel, action: { [weak self] in + ActionSheetButtonItem(title: presentationData.strings.Common_Cancel, action: { [weak self] in self?.dismissAnimated() }) ]) ]) - if let presentationData = presentationData { - self.presentationDisposable = presentationData.start(next: { [weak self] presentationData in + if let updatedPresentationData = updatedPresentationData { + self.presentationDisposable = updatedPresentationData.start(next: { [weak self] presentationData in if let strongSelf = self { strongSelf.theme = ActionSheetControllerTheme(presentationTheme: presentationData.theme) } @@ -267,25 +267,23 @@ private final class ProxyServerActionItem: ActionSheetItem { private let accountManager: AccountManager private let postbox: Postbox private let network: Network - private let presentationTheme: PresentationTheme - private let strings: PresentationStrings + private let presentationData: PresentationData private let server: ProxyServerSettings private let dismiss: (Bool) -> Void private let present: (ViewController, Any?) -> Void - init(accountManager: AccountManager, postbox: Postbox, network: Network, presentationTheme: PresentationTheme, strings: PresentationStrings, server: ProxyServerSettings, dismiss: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) { + init(accountManager: AccountManager, postbox: Postbox, network: Network, presentationData: PresentationData, server: ProxyServerSettings, dismiss: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) { self.accountManager = accountManager self.postbox = postbox self.network = network - self.presentationTheme = presentationTheme - self.strings = strings + self.presentationData = presentationData self.server = server self.dismiss = dismiss self.present = present } func node(theme: ActionSheetControllerTheme) -> ActionSheetItemNode { - return ProxyServerActionItemNode(accountManager: self.accountManager, postbox: self.postbox, network: self.network, presentationTheme: self.presentationTheme, theme: theme, strings: self.strings, server: self.server, dismiss: self.dismiss, present: self.present) + return ProxyServerActionItemNode(accountManager: self.accountManager, postbox: self.postbox, network: self.network, presentationData: self.presentationData, theme: theme, server: self.server, dismiss: self.dismiss, present: self.present) } func updateNode(_ node: ActionSheetItemNode) { @@ -296,9 +294,8 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { private let accountManager: AccountManager private let postbox: Postbox private let network: Network - private let presentationTheme: PresentationTheme + private let presentationData: PresentationData private let theme: ActionSheetControllerTheme - private let strings: PresentationStrings private let server: ProxyServerSettings private let dismiss: (Bool) -> Void private let present: (ViewController, Any?) -> Void @@ -310,13 +307,12 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { private let disposable = MetaDisposable() private var revertSettings: ProxySettings? - init(accountManager: AccountManager, postbox: Postbox, network: Network, presentationTheme: PresentationTheme, theme: ActionSheetControllerTheme, strings: PresentationStrings, server: ProxyServerSettings, dismiss: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) { + init(accountManager: AccountManager, postbox: Postbox, network: Network, presentationData: PresentationData, theme: ActionSheetControllerTheme, server: ProxyServerSettings, dismiss: @escaping (Bool) -> Void, present: @escaping (ViewController, Any?) -> Void) { self.accountManager = accountManager self.postbox = postbox self.network = network self.theme = theme - self.presentationTheme = presentationTheme - self.strings = strings + self.presentationData = presentationData self.server = server self.dismiss = dismiss self.present = present @@ -324,7 +320,7 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { self.titleNode = ImmediateTextNode() self.titleNode.isUserInteractionEnabled = false self.titleNode.displaysAsynchronously = false - self.titleNode.attributedText = NSAttributedString(string: strings.SocksProxySetup_ConnectAndSave, font: Font.regular(20.0), textColor: theme.controlAccentColor) + self.titleNode.attributedText = NSAttributedString(string: presentationData.strings.SocksProxySetup_ConnectAndSave, font: Font.regular(20.0), textColor: theme.controlAccentColor) self.activityIndicator = ActivityIndicator(type: .custom(theme.controlAccentColor, 22.0, 1.5, false)) self.activityIndicator.isHidden = true @@ -401,7 +397,7 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { if let strongSelf = self { strongSelf.revertSettings = previousSettings strongSelf.buttonNode.isUserInteractionEnabled = false - strongSelf.titleNode.attributedText = NSAttributedString(string: strongSelf.strings.SocksProxySetup_Connecting, font: Font.regular(20.0), textColor: strongSelf.theme.primaryTextColor) + strongSelf.titleNode.attributedText = NSAttributedString(string: strongSelf.presentationData.strings.SocksProxySetup_Connecting, font: Font.regular(20.0), textColor: strongSelf.theme.primaryTextColor) strongSelf.activityIndicator.isHidden = false strongSelf.setNeedsLayout() @@ -433,11 +429,11 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { let _ = updateProxySettingsInteractively(accountManager: strongSelf.accountManager, { _ in return previousSettings }) - strongSelf.titleNode.attributedText = NSAttributedString(string: strongSelf.strings.SocksProxySetup_ConnectAndSave, font: Font.regular(20.0), textColor: strongSelf.theme.controlAccentColor) + strongSelf.titleNode.attributedText = NSAttributedString(string: strongSelf.presentationData.strings.SocksProxySetup_ConnectAndSave, font: Font.regular(20.0), textColor: strongSelf.theme.controlAccentColor) strongSelf.buttonNode.isUserInteractionEnabled = true strongSelf.setNeedsLayout() - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationTheme), title: nil, text: strongSelf.strings.SocksProxySetup_FailedToConnect, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), nil) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.SocksProxySetup_FailedToConnect, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), nil) } } })) diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift index 54b3fcaa95..68dcaa32c1 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift @@ -118,17 +118,17 @@ private enum ProxySettingsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! proxyServerSettingsControllerArguments switch self { case let .usePasteboardSettings(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.usePasteboardSettings() }) case let .usePasteboardInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .modeSocks5(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateState { state in var state = state state.mode = .socks5 @@ -136,7 +136,7 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }) case let .modeMtp(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateState { state in var state = state state.mode = .mtp @@ -144,9 +144,9 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }) case let .connectionHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .connectionServer(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.host = value @@ -154,7 +154,7 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }, action: {}) case let .connectionPort(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: placeholder, type: .number, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: placeholder, type: .number, sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.port = value @@ -162,9 +162,9 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }, action: {}) case let .credentialsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .credentialsUsername(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: placeholder, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: placeholder, sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.username = value @@ -172,7 +172,7 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }, action: {}) case let .credentialsPassword(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: placeholder, type: .password, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: placeholder, type: .password, sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.password = value @@ -180,7 +180,7 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }, action: {}) case let .credentialsSecret(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: placeholder, type: .regular(capitalization: false, autocorrection: false), sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.secret = value @@ -188,7 +188,7 @@ private enum ProxySettingsEntry: ItemListNodeEntry { } }, action: {}) case let .share(theme, text, enabled): - return ItemListActionItem(theme: theme, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.share() }) } @@ -225,7 +225,7 @@ private struct ProxyServerSettingsControllerState: Equatable { } } -private func proxyServerSettingsControllerEntries(presentationData: (theme: PresentationTheme, strings: PresentationStrings), state: ProxyServerSettingsControllerState, pasteboardSettings: ProxyServerSettings?) -> [ProxySettingsEntry] { +private func proxyServerSettingsControllerEntries(presentationData: PresentationData, state: ProxyServerSettingsControllerState, pasteboardSettings: ProxyServerSettings?) -> [ProxySettingsEntry] { var entries: [ProxySettingsEntry] = [] if let _ = pasteboardSettings { @@ -271,10 +271,10 @@ private func proxyServerSettings(with state: ProxyServerSettingsControllerState) public func proxyServerSettingsController(context: AccountContext, currentSettings: ProxyServerSettings? = nil) -> ViewController { let presentationData = context.sharedContext.currentPresentationData.with { $0 } - return proxyServerSettingsController(context: context, theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: context.sharedContext.presentationData |> map { ($0.theme, $0.strings) }, accountManager: context.sharedContext.accountManager, postbox: context.account.postbox, network: context.account.network, currentSettings: currentSettings) + return proxyServerSettingsController(context: context, presentationData: presentationData, updatedPresentationData: context.sharedContext.presentationData, accountManager: context.sharedContext.accountManager, postbox: context.account.postbox, network: context.account.network, currentSettings: currentSettings) } -func proxyServerSettingsController(context: AccountContext? = nil, theme: PresentationTheme, strings: PresentationStrings, updatedPresentationData: Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError>, accountManager: AccountManager, postbox: Postbox, network: Network, currentSettings: ProxyServerSettings?) -> ViewController { +func proxyServerSettingsController(context: AccountContext? = nil, presentationData: PresentationData, updatedPresentationData: Signal, accountManager: AccountManager, postbox: Postbox, network: Network, currentSettings: ProxyServerSettings?) -> ViewController { var currentMode: ProxyServerSettingsControllerMode = .socks5 var currentUsername: String? var currentPassword: String? @@ -366,13 +366,13 @@ func proxyServerSettingsController(context: AccountContext? = nil, theme: Presen } }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.SocksProxySetup_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: proxyServerSettingsControllerEntries(presentationData: presentationData, state: state, pasteboardSettings: pasteboardSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.SocksProxySetup_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: proxyServerSettingsControllerEntries(presentationData: presentationData, state: state, pasteboardSettings: pasteboardSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } - let controller = ItemListController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, state: signal, tabBarItem: nil) + let controller = ItemListController(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: updatedPresentationData |> map(ItemListPresentationData.init(_:)), state: signal, tabBarItem: nil) controller.navigationPresentation = .modal presentControllerImpl = { [weak controller] c, d in controller?.present(c, in: .window(.root), with: d) @@ -389,7 +389,7 @@ func proxyServerSettingsController(context: AccountContext? = nil, theme: Presen let link = shareLink(for: server) controller?.view.endEditing(true) if #available(iOSApplicationExtension 9.0, iOS 9.0, *) { - let controller = ShareProxyServerActionSheetController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, link: link) + let controller = ShareProxyServerActionSheetController(presentationData: presentationData, updatedPresentationData: updatedPresentationData, link: link) presentControllerImpl?(controller, nil) } else if let context = context { let controller = ShareController(context: context, subject: .url(link), preferredAction: .default, showInChat: nil, externalShare: true, immediateExternalShare: true, switchableAccounts: []) diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxySettingsServerItem.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxySettingsServerItem.swift index 3cbecc17e9..bde8b6ce21 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxySettingsServerItem.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxySettingsServerItem.swift @@ -240,20 +240,20 @@ private final class ProxySettingsServerItemNode: ItemListRevealOptionsItemNode { titleAttributedString.append(NSAttributedString(string: ":\(item.server.port)", font: titleFont, textColor: item.theme.list.itemSecondaryTextColor)) let statusAttributedString = NSAttributedString(string: item.label, font: statusFont, textColor: item.labelAccent ? item.theme.list.itemAccentColor : item.theme.list.itemSecondaryTextColor) - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? - var reorderControlSizeAndApply: (CGSize, (Bool) -> ItemListEditableReorderControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? + var reorderControlSizeAndApply: (CGFloat, (CGFloat, Bool) -> ItemListEditableReorderControlNode)? let editingOffset: CGFloat var reorderInset: CGFloat = 0.0 if item.editing.editing { - let sizeAndApply = editableControlLayout(64.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 - let reorderSizeAndApply = reorderControlLayout(65.0, item.theme) + let reorderSizeAndApply = reorderControlLayout(item.theme) reorderControlSizeAndApply = reorderSizeAndApply - reorderInset = reorderSizeAndApply.0.width + reorderInset = reorderSizeAndApply.0 } else { editingOffset = 0.0 } @@ -310,9 +310,9 @@ private final class ProxySettingsServerItemNode: ItemListRevealOptionsItemNode { } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -341,13 +341,13 @@ private final class ProxySettingsServerItemNode: ItemListRevealOptionsItemNode { if let reorderControlSizeAndApply = reorderControlSizeAndApply { if strongSelf.reorderControlNode == nil { - let reorderControlNode = reorderControlSizeAndApply.1(false) + let reorderControlNode = reorderControlSizeAndApply.1(layout.contentSize.height, false) strongSelf.reorderControlNode = reorderControlNode strongSelf.addSubnode(reorderControlNode) reorderControlNode.alpha = 0.0 transition.updateAlpha(node: reorderControlNode, alpha: 1.0) } - let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0.width, y: 0.0), size: reorderControlSizeAndApply.0) + let reorderControlFrame = CGRect(origin: CGPoint(x: params.width + revealOffset - params.rightInset - reorderControlSizeAndApply.0, y: 0.0), size: CGSize(width: reorderControlSizeAndApply.0, height: layout.contentSize.height)) strongSelf.reorderControlNode?.frame = reorderControlFrame } else if let reorderControlNode = strongSelf.reorderControlNode { strongSelf.reorderControlNode = nil diff --git a/submodules/SettingsUI/Sources/Data and Storage/SaveIncomingMediaController.swift b/submodules/SettingsUI/Sources/Data and Storage/SaveIncomingMediaController.swift index f0874558e7..695c8f7ddb 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/SaveIncomingMediaController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/SaveIncomingMediaController.swift @@ -60,25 +60,25 @@ private enum SaveIncomingMediaEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! SaveIncomingMediaControllerArguments switch self { case let .header(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .contacts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggle(.contact) }) case let .otherPrivate(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggle(.otherPrivate) }) case let .groups(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggle(.group) }) case let .channels(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: true, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggle(.channel) }) } @@ -125,8 +125,8 @@ func saveIncomingMediaController(context: AccountContext) -> ViewController { automaticMediaDownloadSettings = MediaAutoDownloadSettings.defaultSettings } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.SaveIncomingPhotosSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: saveIncomingMediaControllerEntries(presentationData: presentationData, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.SaveIncomingPhotosSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: saveIncomingMediaControllerEntries(presentationData: presentationData, settings: automaticMediaDownloadSettings), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/ShareProxyServerActionSheetController.swift b/submodules/SettingsUI/Sources/Data and Storage/ShareProxyServerActionSheetController.swift index e05db4b554..6ec8d0002e 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ShareProxyServerActionSheetController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ShareProxyServerActionSheetController.swift @@ -21,8 +21,8 @@ public final class ShareProxyServerActionSheetController: ActionSheetController private var isDismissed: Bool = false - public init(theme: PresentationTheme, strings: PresentationStrings, updatedPresentationData: Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError>, link: String) { - let sheetTheme = ActionSheetControllerTheme(presentationTheme: theme) + public init(presentationData: PresentationData, updatedPresentationData: Signal, link: String) { + let sheetTheme = ActionSheetControllerTheme(presentationTheme: presentationData.theme) super.init(theme: sheetTheme) let presentActivityController: (Any) -> Void = { [weak self] item in @@ -35,10 +35,10 @@ public final class ShareProxyServerActionSheetController: ActionSheetController } var items: [ActionSheetItem] = [] - items.append(ProxyServerQRCodeItem(strings: strings, link: link, ready: { [weak self] in + items.append(ProxyServerQRCodeItem(strings: presentationData.strings, link: link, ready: { [weak self] in self?._ready.set(.single(true)) })) - items.append(ActionSheetButtonItem(title: strings.SocksProxySetup_ShareQRCode, action: { [weak self] in + items.append(ActionSheetButtonItem(title: presentationData.strings.SocksProxySetup_ShareQRCode, action: { [weak self] in self?.dismissAnimated() let _ = (qrCode(string: link, color: .black, backgroundColor: .white, icon: .proxy) |> map { _, generator -> UIImage? in @@ -52,22 +52,22 @@ public final class ShareProxyServerActionSheetController: ActionSheetController } }) })) - items.append(ActionSheetButtonItem(title: strings.SocksProxySetup_ShareLink, action: { [weak self] in + items.append(ActionSheetButtonItem(title: presentationData.strings.SocksProxySetup_ShareLink, action: { [weak self] in self?.dismissAnimated() presentActivityController(link) })) self.setItemGroups([ ActionSheetItemGroup(items: items), ActionSheetItemGroup(items: [ - ActionSheetButtonItem(title: strings.Common_Cancel, action: { [weak self] in + ActionSheetButtonItem(title: presentationData.strings.Common_Cancel, action: { [weak self] in self?.dismissAnimated() }) ]) ]) - self.presentationDisposable = updatedPresentationData.start(next: { [weak self] theme, strings in + self.presentationDisposable = updatedPresentationData.start(next: { [weak self] presentationData in if let strongSelf = self { - strongSelf.theme = ActionSheetControllerTheme(presentationTheme: theme) + strongSelf.theme = ActionSheetControllerTheme(presentationTheme: presentationData.theme) } }) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift index 02736f64b7..bf8d091e9e 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/StorageUsageController.swift @@ -195,36 +195,36 @@ private enum StorageUsageEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! StorageUsageControllerArguments switch self { case let .keepMediaHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .keepMedia(theme, strings, value): return KeepMediaDurationPickerItem(theme: theme, strings: strings, value: value, sectionId: self.section, updated: { updatedValue in arguments.updateKeepMediaTimeout(updatedValue) }) case let .keepMediaInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .storageHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .storageUsage(theme, dateTimeFormat, categories): return StorageUsageItem(theme: theme, dateTimeFormat: dateTimeFormat, categories: categories, sectionId: self.section) case let .collecting(theme, text): return CalculatingCacheSizeItem(theme: theme, title: text, sectionId: self.section, style: .blocks) case let .clearAll(theme, text, enabled): - return ItemListActionItem(theme: theme, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { if enabled { arguments.openClearAll() } }) case let .peersHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .peer(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer, chatPeer, value, revealed): var options: [ItemListPeerItemRevealOption] = [ItemListPeerItemRevealOption(type: .destructive, title: strings.ClearCache_Clear, action: { arguments.clearPeerMedia(peer.id) })] - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, aliasHandling: .threatSelfAsSaved, nameColor: chatPeer == nil ? .primary : .secret, presence: nil, text: .none, label: .disclosure(value), editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, aliasHandling: .threatSelfAsSaved, nameColor: chatPeer == nil ? .primary : .secret, presence: nil, text: .none, label: .disclosure(value), editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: ItemListPeerItemRevealOptions(options: options), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { let resolvedPeer = chatPeer ?? peer arguments.openPeerMedia(resolvedPeer.id) }, setPeerIdWithRevealedOptions: { peerId, fromPeerId in @@ -924,8 +924,8 @@ public func storageUsageController(context: AccountContext, cacheUsagePromise: P dismissImpl?() }) : nil - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Cache_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: storageUsageControllerEntries(presentationData: presentationData, cacheSettings: cacheSettings, cacheStats: cacheStats, state: state), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Cache_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: storageUsageControllerEntries(presentationData: presentationData, cacheSettings: cacheSettings, cacheStats: cacheStats, state: state), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Data and Storage/VoiceCallDataSavingController.swift b/submodules/SettingsUI/Sources/Data and Storage/VoiceCallDataSavingController.swift index 2fc320cfbb..c773aefaef 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/VoiceCallDataSavingController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/VoiceCallDataSavingController.swift @@ -79,23 +79,23 @@ private enum VoiceCallDataSavingEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! VoiceCallDataSavingControllerArguments switch self { case let .never(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateSelection(.never) }) case let .cellular(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateSelection(.cellular) }) case let .always(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateSelection(.always) }) case let .info(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -155,8 +155,8 @@ func voiceCallDataSavingController(context: AccountContext) -> ViewController { let dataSaving = effectiveDataSaving(for: sharedSettings.0, autodownloadSettings: sharedSettings.1) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.CallSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: voiceCallDataSavingControllerEntries(presentationData: presentationData, dataSaving: dataSaving), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.CallSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: voiceCallDataSavingControllerEntries(presentationData: presentationData, dataSaving: dataSaving), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/WebBrowserSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/WebBrowserSettingsController.swift index 8ab63004f7..5a66daadac 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/WebBrowserSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/WebBrowserSettingsController.swift @@ -65,11 +65,11 @@ private enum WebBrowserSettingsControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! WebBrowserSettingsControllerArguments switch self { case let .browserHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .browser(theme, title, application, identifier, selected, _): return WebBrowserItem(account: arguments.context.account, theme: theme, title: title, application: application, checked: selected, sectionId: self.section) { arguments.updateDefaultBrowser(identifier) @@ -109,8 +109,8 @@ public func webBrowserSettingsController(context: AccountContext) -> ViewControl |> map { presentationData, sharedData -> (ItemListControllerState, (ItemListNodeState, Any)) in let settings = (sharedData.entries[ApplicationSpecificSharedDataKeys.webBrowserSettings] as? WebBrowserSettings) ?? WebBrowserSettings.defaultSettings - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.WebBrowser_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: webBrowserSettingsControllerEntries(context: context, presentationData: presentationData, selectedBrowser: settings.defaultWebBrowser), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.WebBrowser_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: webBrowserSettingsControllerEntries(context: context, presentationData: presentationData, selectedBrowser: settings.defaultWebBrowser), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/DebugAccountsController.swift b/submodules/SettingsUI/Sources/DebugAccountsController.swift index 1e525ff0a5..decc358cc5 100644 --- a/submodules/SettingsUI/Sources/DebugAccountsController.swift +++ b/submodules/SettingsUI/Sources/DebugAccountsController.swift @@ -73,15 +73,15 @@ private enum DebugAccountsControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! DebugAccountsControllerArguments switch self { case let .record(theme, record, current): - return ItemListCheckboxItem(theme: theme, title: "\(UInt64(bitPattern: record.id.int64))", style: .left, checked: current, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: "\(UInt64(bitPattern: record.id.int64))", style: .left, checked: current, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.switchAccount(record.id) }) case let .loginNewAccount(theme): - return ItemListActionItem(theme: theme, title: "Login to another account", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Login to another account", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.loginNewAccount() }) } @@ -135,8 +135,8 @@ public func debugAccountsController(context: AccountContext, accountManager: Acc let signal = combineLatest(context.sharedContext.presentationData, accountManager.accountRecords()) |> map { presentationData, view -> (ItemListControllerState, (ItemListNodeState, Any)) in - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text("Accounts"), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: debugAccountsControllerEntries(view: view, presentationData: presentationData), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text("Accounts"), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: debugAccountsControllerEntries(view: view, presentationData: presentationData), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/DebugController.swift b/submodules/SettingsUI/Sources/DebugController.swift index da6e82135e..e68e2211af 100644 --- a/submodules/SettingsUI/Sources/DebugController.swift +++ b/submodules/SettingsUI/Sources/DebugController.swift @@ -147,11 +147,11 @@ private enum DebugControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! DebugControllerArguments switch self { case let .sendLogs(theme): - return ItemListDisclosureItem(theme: theme, title: "Send Logs", label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: "Send Logs", label: "", sectionId: self.section, style: .blocks, action: { let _ = (Logger.shared.collectLogs() |> deliverOnMainQueue).start(next: { logs in let presentationData = arguments.sharedContext.currentPresentationData.with { $0 } @@ -202,7 +202,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .sendOneLog(theme): - return ItemListDisclosureItem(theme: theme, title: "Send Latest Log", label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: "Send Latest Log", label: "", sectionId: self.section, style: .blocks, action: { let _ = (Logger.shared.collectLogs() |> deliverOnMainQueue).start(next: { logs in let presentationData = arguments.sharedContext.currentPresentationData.with { $0 } @@ -257,7 +257,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .sendNotificationLogs(theme): - return ItemListDisclosureItem(theme: theme, title: "Send Notification Logs", label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: "Send Notification Logs", label: "", sectionId: self.section, style: .blocks, action: { let _ = (Logger(basePath: arguments.sharedContext.basePath + "/notificationServiceLogs").collectLogs() |> deliverOnMainQueue).start(next: { logs in guard let context = arguments.context else { @@ -280,7 +280,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .sendCriticalLogs(theme): - return ItemListDisclosureItem(theme: theme, title: "Send Critical Logs", label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: "Send Critical Logs", label: "", sectionId: self.section, style: .blocks, action: { let _ = (Logger.shared.collectShortLogFiles() |> deliverOnMainQueue).start(next: { logs in let presentationData = arguments.sharedContext.currentPresentationData.with { $0 } @@ -331,38 +331,38 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .accounts(theme): - return ItemListDisclosureItem(theme: theme, title: "Accounts", label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: "Accounts", label: "", sectionId: self.section, style: .blocks, action: { guard let context = arguments.context else { return } arguments.pushController(debugAccountsController(context: context, accountManager: arguments.sharedContext.accountManager)) }) case let .logToFile(theme, value): - return ItemListSwitchItem(theme: theme, title: "Log to File", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Log to File", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateLoggingSettings(accountManager: arguments.sharedContext.accountManager, { $0.withUpdatedLogToFile(value) }).start() }) case let .logToConsole(theme, value): - return ItemListSwitchItem(theme: theme, title: "Log to Console", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Log to Console", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateLoggingSettings(accountManager: arguments.sharedContext.accountManager, { $0.withUpdatedLogToConsole(value) }).start() }) case let .redactSensitiveData(theme, value): - return ItemListSwitchItem(theme: theme, title: "Remove Sensitive Data", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Remove Sensitive Data", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateLoggingSettings(accountManager: arguments.sharedContext.accountManager, { $0.withUpdatedRedactSensitiveData(value) }).start() }) case let .enableRaiseToSpeak(theme, value): - return ItemListSwitchItem(theme: theme, title: "Enable Raise to Speak", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Enable Raise to Speak", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateMediaInputSettingsInteractively(accountManager: arguments.sharedContext.accountManager, { $0.withUpdatedEnableRaiseToSpeak(value) }).start() }) case let .keepChatNavigationStack(theme, value): - return ItemListSwitchItem(theme: theme, title: "Keep Chat Stack", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Keep Chat Stack", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in var settings = settings settings.keepChatNavigationStack = value @@ -370,7 +370,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .skipReadHistory(theme, value): - return ItemListSwitchItem(theme: theme, title: "Skip read history", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Skip read history", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in var settings = settings settings.skipReadHistory = value @@ -378,7 +378,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .crashOnSlowQueries(theme, value): - return ItemListSwitchItem(theme: theme, title: "Crash when slow", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Crash when slow", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = updateExperimentalUISettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in var settings = settings settings.crashOnLongQueries = value @@ -386,13 +386,13 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .clearTips(theme): - return ItemListActionItem(theme: theme, title: "Clear Tips", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Clear Tips", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { let _ = (arguments.sharedContext.accountManager.transaction { transaction -> Void in transaction.clearNotices() }).start() }) case let .reimport(theme): - return ItemListActionItem(theme: theme, title: "Reimport Application Data", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Reimport Application Data", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { let appGroupName = "group.\(Bundle.main.bundleIdentifier!)" let maybeAppGroupUrl = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: appGroupName) @@ -407,7 +407,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { } }) case let .resetData(theme): - return ItemListActionItem(theme: theme, title: "Reset Data", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Reset Data", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { let presentationData = arguments.sharedContext.currentPresentationData.with { $0 } let actionSheet = ActionSheetController(presentationTheme: presentationData.theme) actionSheet.setItemGroups([ActionSheetItemGroup(items: [ @@ -426,7 +426,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { arguments.presentController(actionSheet, nil) }) case let .resetDatabase(theme): - return ItemListActionItem(theme: theme, title: "Clear Database", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Clear Database", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { guard let context = arguments.context else { return } @@ -448,7 +448,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { arguments.presentController(actionSheet, nil) }) case let .resetHoles(theme): - return ItemListActionItem(theme: theme, title: "Reset Holes", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Reset Holes", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { guard let context = arguments.context else { return } @@ -463,13 +463,13 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .resetBiometricsData(theme): - return ItemListActionItem(theme: theme, title: "Reset Biometrics Data", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Reset Biometrics Data", kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { let _ = updatePresentationPasscodeSettingsInteractively(accountManager: arguments.sharedContext.accountManager, { settings in return settings.withUpdatedBiometricsDomainState(nil).withUpdatedShareBiometricsDomainState(nil) }).start() }) case let .optimizeDatabase(theme): - return ItemListActionItem(theme: theme, title: "Optimize Database", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: "Optimize Database", kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { guard let context = arguments.context else { return } @@ -485,7 +485,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }) }) case let .photoPreview(theme, value): - return ItemListSwitchItem(theme: theme, title: "Photo Preview", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Photo Preview", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = arguments.sharedContext.accountManager.transaction ({ transaction in transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalUISettings, { settings in var settings = settings as? ExperimentalUISettings ?? ExperimentalUISettings.defaultSettings @@ -495,7 +495,7 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .knockoutWallpaper(theme, value): - return ItemListSwitchItem(theme: theme, title: "Knockout Wallpaper", value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: "Knockout Wallpaper", value: value, sectionId: self.section, style: .blocks, updated: { value in let _ = arguments.sharedContext.accountManager.transaction ({ transaction in transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalUISettings, { settings in var settings = settings as? ExperimentalUISettings ?? ExperimentalUISettings.defaultSettings @@ -505,13 +505,13 @@ private enum DebugControllerEntry: ItemListNodeEntry { }).start() }) case let .hostInfo(theme, string): - return ItemListTextItem(theme: theme, text: .plain(string), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(string), sectionId: self.section) case let .versionInfo(theme): let bundle = Bundle.main let bundleId = bundle.bundleIdentifier ?? "" let bundleVersion = bundle.infoDictionary?["CFBundleShortVersionString"] ?? "" let bundleBuild = bundle.infoDictionary?[kCFBundleVersionKey as String] ?? "" - return ItemListTextItem(theme: theme, text: .plain("\(bundleId)\n\(bundleVersion) (\(bundleBuild))"), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain("\(bundleId)\n\(bundleVersion) (\(bundleBuild))"), sectionId: self.section) } } } @@ -612,8 +612,8 @@ public func debugController(sharedContext: SharedAccountContext, context: Accoun }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text("Debug"), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: debugControllerEntries(presentationData: presentationData, loggingSettings: loggingSettings, mediaInputSettings: mediaInputSettings, experimentalSettings: experimentalSettings, networkSettings: networkSettings, hasLegacyAppData: hasLegacyAppData), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text("Debug"), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: debugControllerEntries(presentationData: presentationData, loggingSettings: loggingSettings, mediaInputSettings: mediaInputSettings, experimentalSettings: experimentalSettings, networkSettings: networkSettings, hasLegacyAppData: hasLegacyAppData), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/EditSettingsController.swift b/submodules/SettingsUI/Sources/EditSettingsController.swift index 5d6a514cb4..2ab81e2ea5 100644 --- a/submodules/SettingsUI/Sources/EditSettingsController.swift +++ b/submodules/SettingsUI/Sources/EditSettingsController.swift @@ -191,37 +191,37 @@ private enum SettingsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! EditSettingsItemArguments switch self { case let .userInfo(theme, strings, dateTimeFormat, peer, cachedData, state, updatingImage): - return ItemListAvatarAndNameInfoItem(account: arguments.context.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .editSettings, peer: peer, presence: TelegramUserPresence(status: .present(until: Int32.max), lastActivity: 0), cachedData: cachedData, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.context.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .editSettings, peer: peer, presence: TelegramUserPresence(status: .present(until: Int32.max), lastActivity: 0), cachedData: cachedData, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.avatarTapAction() }, context: arguments.avatarAndNameInfoContext, updatingImage: updatingImage) case let .userInfoNotice(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .bioText(theme, currentText, placeholder): - return ItemListMultilineInputItem(theme: theme, text: currentText, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 70, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in + return ItemListMultilineInputItem(presentationData: presentationData, text: currentText, placeholder: placeholder, maxLength: ItemListMultilineInputItemTextLimit(value: 70, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in arguments.updateBioText(currentText, updatedText) }, tag: EditSettingsEntryTag.bio) case let .bioInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .phoneNumber(theme, text, number): - return ItemListDisclosureItem(theme: theme, title: text, label: number, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: number, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.pushController(ChangePhoneNumberIntroController(context: arguments.context, phoneNumber: number)) }) case let .username(theme, text, address): - return ItemListDisclosureItem(theme: theme, title: text, label: address, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: address, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.pushController(usernameSetupController(context: arguments.context)) }) case let .addAccount(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .center, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .center, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.addAccount() }) case let .logOut(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .center, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .center, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.logout() }) } @@ -438,8 +438,8 @@ func editSettingsController(context: AccountContext, currentName: ItemListAvatar }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.EditProfile_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: editSettingsEntries(presentationData: presentationData, state: state, view: view, canAddAccounts: canAddAccounts), style: .blocks, ensureVisibleItemTag: focusOnItemTag) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.EditProfile_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: editSettingsEntries(presentationData: presentationData, state: state, view: view, canAddAccounts: canAddAccounts), style: .blocks, ensureVisibleItemTag: focusOnItemTag) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift index 0f2e2d931f..9c439efab3 100644 --- a/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift +++ b/submodules/SettingsUI/Sources/Language Selection/LocalizationListControllerNode.swift @@ -52,10 +52,10 @@ private enum LanguageListEntry: Comparable, Identifiable { return lhs.index() < rhs.index() } - func item(theme: PresentationTheme, strings: PresentationStrings, searchMode: Bool, openSearch: @escaping () -> Void, selectLocalization: @escaping (LocalizationInfo) -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void) -> ListViewItem { + func item(presentationData: PresentationData, searchMode: Bool, openSearch: @escaping () -> Void, selectLocalization: @escaping (LocalizationInfo) -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void) -> ListViewItem { switch self { case let .localization(_, info, type, selected, activity, revealed, editing): - return LocalizationListItem(theme: theme, strings: strings, id: info.languageCode, title: info.title, subtitle: info.localizedTitle, checked: selected, activity: activity, editing: LocalizationListItemEditing(editable: !selected && !searchMode && !info.isOfficial, editing: editing, revealed: !selected && revealed, reorderable: false), sectionId: type == .official ? LanguageListSection.official.rawValue : LanguageListSection.unofficial.rawValue, alwaysPlain: searchMode, action: { + return LocalizationListItem(presentationData: ItemListPresentationData(presentationData), id: info.languageCode, title: info.title, subtitle: info.localizedTitle, checked: selected, activity: activity, editing: LocalizationListItemEditing(editable: !selected && !searchMode && !info.isOfficial, editing: editing, revealed: !selected && revealed, reorderable: false), sectionId: type == .official ? LanguageListSection.official.rawValue : LanguageListSection.unofficial.rawValue, alwaysPlain: searchMode, action: { selectLocalization(info) }, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem) } @@ -69,12 +69,12 @@ private struct LocalizationListSearchContainerTransition { let isSearching: Bool } -private func preparedLanguageListSearchContainerTransition(theme: PresentationTheme, strings: PresentationStrings, from fromEntries: [LanguageListEntry], to toEntries: [LanguageListEntry], selectLocalization: @escaping (LocalizationInfo) -> Void, isSearching: Bool, forceUpdate: Bool) -> LocalizationListSearchContainerTransition { +private func preparedLanguageListSearchContainerTransition(presentationData: PresentationData, from fromEntries: [LanguageListEntry], to toEntries: [LanguageListEntry], selectLocalization: @escaping (LocalizationInfo) -> Void, isSearching: Bool, forceUpdate: Bool) -> LocalizationListSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries, allUpdated: forceUpdate) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(theme: theme, strings: strings, searchMode: true, openSearch: {}, selectLocalization: selectLocalization, setItemWithRevealedOptions: { _, _ in }, removeItem: { _ in }), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(theme: theme, strings: strings, searchMode: true, openSearch: {}, selectLocalization: selectLocalization, setItemWithRevealedOptions: { _, _ in }, removeItem: { _ in }), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, searchMode: true, openSearch: {}, selectLocalization: selectLocalization, setItemWithRevealedOptions: { _, _ in }, removeItem: { _ in }), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, searchMode: true, openSearch: {}, selectLocalization: selectLocalization, setItemWithRevealedOptions: { _, _ in }, removeItem: { _ in }), directionHint: nil) } return LocalizationListSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, isSearching: isSearching) } @@ -92,12 +92,12 @@ private final class LocalizationListSearchContainerNode: SearchDisplayController private var presentationData: PresentationData private var presentationDataDisposable: Disposable? - private let themeAndStringsPromise: Promise<(PresentationTheme, PresentationStrings)> + private let presentationDataPromise: Promise init(context: AccountContext, listState: LocalizationListState, selectLocalization: @escaping (LocalizationInfo) -> Void, applyingCode: Signal) { self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.themeAndStringsPromise = Promise((self.presentationData.theme, self.presentationData.strings)) + self.presentationDataPromise = Promise(self.presentationData) self.dimNode = ASDisplayNode() self.dimNode.backgroundColor = UIColor.black.withAlphaComponent(0.5) @@ -134,18 +134,18 @@ private final class LocalizationListSearchContainerNode: SearchDisplayController } let previousEntriesHolder = Atomic<([LanguageListEntry], PresentationTheme, PresentationStrings)?>(value: nil) - self.searchDisposable.set(combineLatest(queue: .mainQueue(), foundItems, self.themeAndStringsPromise.get(), applyingCode).start(next: { [weak self] items, themeAndStrings, applyingCode in + self.searchDisposable.set(combineLatest(queue: .mainQueue(), foundItems, self.presentationDataPromise.get(), applyingCode).start(next: { [weak self] items, presentationData, applyingCode in guard let strongSelf = self else { return } var entries: [LanguageListEntry] = [] if let items = items { for item in items { - entries.append(.localization(index: entries.count, info: item, type: .official, selected: themeAndStrings.1.primaryComponent.languageCode == item.languageCode, activity: applyingCode == item.languageCode, revealed: false, editing: false)) + entries.append(.localization(index: entries.count, info: item, type: .official, selected: presentationData.strings.primaryComponent.languageCode == item.languageCode, activity: applyingCode == item.languageCode, revealed: false, editing: false)) } } - let previousEntriesAndPresentationData = previousEntriesHolder.swap((entries, themeAndStrings.0, themeAndStrings.1)) - let transition = preparedLanguageListSearchContainerTransition(theme: themeAndStrings.0, strings: themeAndStrings.1, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, selectLocalization: selectLocalization, isSearching: items != nil, forceUpdate: previousEntriesAndPresentationData?.1 !== themeAndStrings.0 || previousEntriesAndPresentationData?.2 !== themeAndStrings.1) + let previousEntriesAndPresentationData = previousEntriesHolder.swap((entries, presentationData.theme, presentationData.strings)) + let transition = preparedLanguageListSearchContainerTransition(presentationData: presentationData, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, selectLocalization: selectLocalization, isSearching: items != nil, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings) strongSelf.enqueueTransition(transition) })) @@ -159,7 +159,7 @@ private final class LocalizationListSearchContainerNode: SearchDisplayController if previousTheme !== presentationData.theme || previousStrings !== presentationData.strings { strongSelf.updateThemeAndStrings(theme: presentationData.theme, strings: presentationData.strings) - strongSelf.themeAndStringsPromise.set(.single((presentationData.theme, presentationData.strings))) + strongSelf.presentationDataPromise.set(.single(presentationData)) } } }) @@ -272,12 +272,12 @@ private struct LanguageListNodeTransition { let animated: Bool } -private func preparedLanguageListNodeTransition(theme: PresentationTheme, strings: PresentationStrings, from fromEntries: [LanguageListEntry], to toEntries: [LanguageListEntry], openSearch: @escaping () -> Void, selectLocalization: @escaping (LocalizationInfo) -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void, firstTime: Bool, isLoading: Bool, forceUpdate: Bool, animated: Bool) -> LanguageListNodeTransition { +private func preparedLanguageListNodeTransition(presentationData: PresentationData, from fromEntries: [LanguageListEntry], to toEntries: [LanguageListEntry], openSearch: @escaping () -> Void, selectLocalization: @escaping (LocalizationInfo) -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void, firstTime: Bool, isLoading: Bool, forceUpdate: Bool, animated: Bool) -> LanguageListNodeTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries, allUpdated: forceUpdate) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(theme: theme, strings: strings, searchMode: false, openSearch: openSearch, selectLocalization: selectLocalization, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(theme: theme, strings: strings, searchMode: false, openSearch: openSearch, selectLocalization: selectLocalization, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, searchMode: false, openSearch: openSearch, selectLocalization: selectLocalization, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, searchMode: false, openSearch: openSearch, selectLocalization: selectLocalization, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem), directionHint: nil) } return LanguageListNodeTransition(deletions: deletions, insertions: insertions, updates: updates, firstTime: firstTime, isLoading: isLoading, animated: animated) } @@ -299,7 +299,7 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { private var activityIndicator: ActivityIndicator? private var searchDisplayController: SearchDisplayController? - private let presentationDataValue = Promise<(PresentationTheme, PresentationStrings)>() + private let presentationDataValue = Promise() private var updatedDisposable: Disposable? private var listDisposable: Disposable? private let applyDisposable = MetaDisposable() @@ -316,7 +316,7 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { init(context: AccountContext, presentationData: PresentationData, navigationBar: NavigationBar, requestActivateSearch: @escaping () -> Void, requestDeactivateSearch: @escaping () -> Void, updateCanStartEditing: @escaping (Bool?) -> Void, present: @escaping (ViewController, Any?) -> Void) { self.context = context self.presentationData = presentationData - self.presentationDataValue.set(.single((presentationData.theme, presentationData.strings))) + self.presentationDataValue.set(.single(presentationData)) self.navigationBar = navigationBar self.requestActivateSearch = requestActivateSearch self.requestDeactivateSearch = requestDeactivateSearch @@ -411,8 +411,8 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { entries.append(.localization(index: entries.count, info: info, type: .official, selected: info.languageCode == activeLanguageCode, activity: applyingCode == info.languageCode, revealed: revealedCode == info.languageCode, editing: false)) } } - let previousEntriesAndPresentationData = previousEntriesHolder.swap((entries, presentationData.0, presentationData.1)) - let transition = preparedLanguageListNodeTransition(theme: presentationData.0, strings: presentationData.1, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, openSearch: openSearch, selectLocalization: { [weak self] info in self?.selectLocalization(info) }, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem, firstTime: previousEntriesAndPresentationData == nil, isLoading: entries.isEmpty, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.0 || previousEntriesAndPresentationData?.2 !== presentationData.1, animated: (previousEntriesAndPresentationData?.0.count ?? 0) >= entries.count) + let previousEntriesAndPresentationData = previousEntriesHolder.swap((entries, presentationData.theme, presentationData.strings)) + let transition = preparedLanguageListNodeTransition(presentationData: presentationData, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, openSearch: openSearch, selectLocalization: { [weak self] info in self?.selectLocalization(info) }, setItemWithRevealedOptions: setItemWithRevealedOptions, removeItem: removeItem, firstTime: previousEntriesAndPresentationData == nil, isLoading: entries.isEmpty, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings, animated: (previousEntriesAndPresentationData?.0.count ?? 0) >= entries.count) strongSelf.enqueueTransition(transition) }) self.updatedDisposable = synchronizedLocalizationListState(postbox: context.account.postbox, network: context.account.network).start() @@ -426,7 +426,7 @@ final class LocalizationListControllerNode: ViewControllerTracingNode { func updatePresentationData(_ presentationData: PresentationData) { self.presentationData = presentationData - self.presentationDataValue.set(.single((presentationData.theme, presentationData.strings))) + self.presentationDataValue.set(.single(presentationData)) self.backgroundColor = presentationData.theme.list.blocksBackgroundColor self.listNode.keepTopItemOverscrollBackground = ListViewKeepTopItemOverscrollBackground(color: presentationData.theme.chatList.backgroundColor, direction: true) self.searchDisplayController?.updatePresentationData(presentationData) diff --git a/submodules/SettingsUI/Sources/Language Selection/LocalizationListItem.swift b/submodules/SettingsUI/Sources/Language Selection/LocalizationListItem.swift index 80da7638fe..f82df3a6b4 100644 --- a/submodules/SettingsUI/Sources/Language Selection/LocalizationListItem.swift +++ b/submodules/SettingsUI/Sources/Language Selection/LocalizationListItem.swift @@ -17,8 +17,7 @@ struct LocalizationListItemEditing: Equatable { } class LocalizationListItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let id: String let title: String let subtitle: String @@ -31,9 +30,8 @@ class LocalizationListItem: ListViewItem, ItemListItem { let setItemWithRevealedOptions: (String?, String?) -> Void let removeItem: (String) -> Void - init(theme: PresentationTheme, strings: PresentationStrings, id: String, title: String, subtitle: String, checked: Bool, activity: Bool, editing: LocalizationListItemEditing, sectionId: ItemListSectionId, alwaysPlain: Bool, action: @escaping () -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void) { - self.theme = theme - self.strings = strings + init(presentationData: ItemListPresentationData, id: String, title: String, subtitle: String, checked: Bool, activity: Bool, editing: LocalizationListItemEditing, sectionId: ItemListSectionId, alwaysPlain: Bool, action: @escaping () -> Void, setItemWithRevealedOptions: @escaping (String?, String?) -> Void, removeItem: @escaping (String) -> Void) { + self.presentationData = presentationData self.id = id self.title = title self.subtitle = subtitle @@ -96,9 +94,6 @@ class LocalizationListItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.regular(17.0) -private let subtitleFont = Font.regular(13.0) - class LocalizationListItemNode: ItemListRevealOptionsItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -176,38 +171,38 @@ class LocalizationListItemNode: ItemListRevealOptionsItemNode { return { item, params, neighbors in var leftInset: CGFloat = params.leftInset + let titleFont = Font.regular(item.presentationData.fontSize.itemListBaseFontSize) + let subtitleFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 13.0 / 17.0)) + + let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 50.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + + let (subtitleLayout, subtitleApply) = makeSubtitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.subtitle, font: subtitleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 50.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let insets = itemListNeighborsGroupedInsets(neighbors) - let contentSize = CGSize(width: params.width, height: 58.0) + let contentSize = CGSize(width: params.width, height: titleLayout.size.height + 1.0 + subtitleLayout.size.height + 8.0 * 2.0) let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? var editingOffset: CGFloat = 0.0 if item.editing.editing { - let sizeAndApply = editableControlLayout(layout.contentSize.height, item.theme, false) + let sizeAndApply = editableControlLayout(item.presentationData.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 } leftInset += 16.0 - let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.title, font: titleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 50.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - - let (subtitleLayout, subtitleApply) = makeSubtitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: item.subtitle, font: subtitleFont, textColor: item.theme.list.itemPrimaryTextColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 50.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) - let separatorHeight = UIScreenPixel var updateCheckImage: UIImage? var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme - } - - if currentItem?.theme !== item.theme { - updateCheckImage = PresentationResourcesItemList.checkIconImage(item.theme) + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme + updateCheckImage = PresentationResourcesItemList.checkIconImage(item.presentationData.theme) } return (layout, { [weak self] animated in @@ -226,16 +221,16 @@ class LocalizationListItemNode: ItemListRevealOptionsItemNode { if let updateCheckImage = updateCheckImage { strongSelf.iconNode.image = updateCheckImage - strongSelf.activityNode.type = ActivityIndicatorType.custom(item.theme.list.itemAccentColor, 22.0, 0.0, false) + strongSelf.activityNode.type = ActivityIndicatorType.custom(item.presentationData.theme.list.itemAccentColor, 22.0, 0.0, false) } strongSelf.activityNode.isHidden = !item.activity if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let _ = titleApply() @@ -275,12 +270,12 @@ class LocalizationListItemNode: ItemListRevealOptionsItemNode { strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - bottomStripeInset, height: separatorHeight)) transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + leftInset, y: 8.0), size: titleLayout.size)) - transition.updateFrame(node: strongSelf.subtitleNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + leftInset, y: 31.0), size: subtitleLayout.size)) + transition.updateFrame(node: strongSelf.subtitleNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + leftInset, y: strongSelf.titleNode.frame.maxY + 1.0), size: subtitleLayout.size)) if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -312,7 +307,7 @@ class LocalizationListItemNode: ItemListRevealOptionsItemNode { strongSelf.updateLayout(size: layout.contentSize, leftInset: params.leftInset, rightInset: params.rightInset) if item.editing.editable { - strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.strings.Common_Delete, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)])) + strongSelf.setRevealOptions((left: [], right: [ItemListRevealOption(key: 0, title: item.presentationData.strings.Common_Delete, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)])) } else { strongSelf.setRevealOptions((left: [], right: [])) } diff --git a/submodules/SettingsUI/Sources/LogoutOptionsController.swift b/submodules/SettingsUI/Sources/LogoutOptionsController.swift index 4c1d21f9f3..9daaab5181 100644 --- a/submodules/SettingsUI/Sources/LogoutOptionsController.swift +++ b/submodules/SettingsUI/Sources/LogoutOptionsController.swift @@ -73,37 +73,37 @@ private enum LogoutOptionsEntry: ItemListNodeEntry, Equatable { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! LogoutOptionsItemArguments switch self { case let .alternativeHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .addAccount(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesSettings.addAccount, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesSettings.addAccount, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.addAccount() }) case let .setPasscode(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesSettings.setPasscode, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesSettings.setPasscode, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.setPasscode() }) case let .clearCache(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesSettings.clearCache, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesSettings.clearCache, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.clearCache() }) case let .changePhoneNumber(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesSettings.changePhoneNumber, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesSettings.changePhoneNumber, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.changePhoneNumber() }) case let .contactSupport(theme, title, text): - return ItemListDisclosureItem(theme: theme, icon: PresentationResourcesSettings.support, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: PresentationResourcesSettings.support, title: title, label: text, labelStyle: .multilineDetailText, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.contactSupport() }) case let .logout(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.logout() }) case let .logoutInfo(theme, title): - return ItemListTextItem(theme: theme, text: .plain(title), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(title), sectionId: self.section) } } } @@ -239,8 +239,8 @@ func logoutOptionsController(context: AccountContext, navigationController: Navi break } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.LogoutOptions_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: logoutOptionsEntries(presentationData: presentationData, canAddAccounts: canAddAccounts, hasPasscode: hasPasscode, hasWallets: hasWallets), style: .blocks) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.LogoutOptions_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: logoutOptionsEntries(presentationData: presentationData, canAddAccounts: canAddAccounts, hasPasscode: hasPasscode, hasWallets: hasWallets), style: .blocks) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionControllerNode.swift b/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionControllerNode.swift index 4401cee2c0..a58deefad9 100644 --- a/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionControllerNode.swift +++ b/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionControllerNode.swift @@ -510,7 +510,7 @@ private enum NotificationExceptionEntry : ItemListNodeEntry { case addException(PresentationTheme, PresentationStrings, NotificationExceptionMode.Mode, Bool) case removeAll(PresentationTheme, PresentationStrings) - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! NotificationExceptionArguments switch self { case let .search(theme, strings): @@ -527,11 +527,11 @@ private enum NotificationExceptionEntry : ItemListNodeEntry { case .channels: icon = PresentationResourcesItemList.addChannelIcon(theme) } - return ItemListPeerActionItem(theme: theme, icon: icon, title: strings.Notification_Exceptions_AddException, alwaysPlain: true, sectionId: self.section, editing: editing, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: icon, title: strings.Notification_Exceptions_AddException, alwaysPlain: true, sectionId: self.section, editing: editing, action: { arguments.selectPeer() }) case let .peer(_, peer, theme, strings, dateTimeFormat, nameDisplayOrder, value, _, revealed, editing, isSearching): - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .text(value), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: editing, revealed: revealed), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .text(value), label: .none, editing: ItemListPeerItemEditing(editable: true, editing: editing, revealed: revealed), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.openPeer(peer) }, setPeerIdWithRevealedOptions: { peerId, fromPeerId in arguments.updateRevealedPeerId(peerId) @@ -539,12 +539,12 @@ private enum NotificationExceptionEntry : ItemListNodeEntry { arguments.deletePeer(peer) }, hasTopStripe: false, hasTopGroupInset: false, noInsets: isSearching) case let .addPeer(_, peer, theme, strings, _, nameDisplayOrder): - return ContactsPeerItem(theme: theme, strings: strings, sortOrder: nameDisplayOrder, displayOrder: nameDisplayOrder, account: arguments.account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), options: [], actionIcon: .add, index: nil, header: ChatListSearchItemHeader(type: .addToExceptions, theme: theme, strings: strings, actionTitle: nil, action: nil), action: { _ in + return ContactsPeerItem(presentationData: presentationData, sortOrder: nameDisplayOrder, displayOrder: nameDisplayOrder, account: arguments.account, peerMode: .peer, peer: .peer(peer: peer, chatPeer: peer), status: .none, enabled: true, selection: .none, editing: ContactsPeerItemEditing(editable: false, editing: false, revealed: false), options: [], actionIcon: .add, index: nil, header: ChatListSearchItemHeader(type: .addToExceptions, theme: theme, strings: strings, actionTitle: nil, action: nil), action: { _ in arguments.openPeer(peer) }, setPeerIdWithRevealedOptions: { _, _ in }) case let .removeAll(theme, strings): - return ItemListActionItem(theme: theme, title: strings.Notification_Exceptions_DeleteAll, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: strings.Notification_Exceptions_DeleteAll, kind: .destructive, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.removeAll() }) } @@ -651,12 +651,12 @@ private struct NotificationExceptionNodeTransition { let animated: Bool } -private func preparedExceptionsListNodeTransition(theme: PresentationTheme, strings: PresentationStrings, from fromEntries: [NotificationExceptionEntry], to toEntries: [NotificationExceptionEntry], arguments: NotificationExceptionArguments, firstTime: Bool, forceUpdate: Bool, animated: Bool) -> NotificationExceptionNodeTransition { +private func preparedExceptionsListNodeTransition(presentationData: ItemListPresentationData, from fromEntries: [NotificationExceptionEntry], to toEntries: [NotificationExceptionEntry], arguments: NotificationExceptionArguments, firstTime: Bool, forceUpdate: Bool, animated: Bool) -> NotificationExceptionNodeTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries, allUpdated: forceUpdate) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } return NotificationExceptionNodeTransition(deletions: deletions, insertions: insertions, updates: updates, firstTime: firstTime, animated: animated) } @@ -995,7 +995,7 @@ final class NotificationExceptionsControllerNode: ViewControllerTracingNode { animated = false } - let transition = preparedExceptionsListNodeTransition(theme: presentationData.theme, strings: presentationData.strings, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, arguments: arguments, firstTime: previousEntriesAndPresentationData == nil, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings, animated: animated) + let transition = preparedExceptionsListNodeTransition(presentationData: ItemListPresentationData(presentationData), from: previousEntriesAndPresentationData?.0 ?? [], to: entries, arguments: arguments, firstTime: previousEntriesAndPresentationData == nil, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings, animated: animated) self?.listNode.keepTopItemOverscrollBackground = entries.count <= 1 ? nil : ListViewKeepTopItemOverscrollBackground(color: presentationData.theme.chatList.backgroundColor, direction: true) @@ -1152,12 +1152,12 @@ private struct NotificationExceptionsSearchContainerTransition { let isSearching: Bool } -private func preparedNotificationExceptionsSearchContainerTransition(theme: PresentationTheme, strings: PresentationStrings, from fromEntries: [NotificationExceptionEntry], to toEntries: [NotificationExceptionEntry], arguments: NotificationExceptionArguments, isSearching: Bool, forceUpdate: Bool) -> NotificationExceptionsSearchContainerTransition { +private func preparedNotificationExceptionsSearchContainerTransition(presentationData: ItemListPresentationData, from fromEntries: [NotificationExceptionEntry], to toEntries: [NotificationExceptionEntry], arguments: NotificationExceptionArguments, isSearching: Bool, forceUpdate: Bool) -> NotificationExceptionsSearchContainerTransition { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries, allUpdated: forceUpdate) let deletions = deleteIndices.map { ListViewDeleteItem(index: $0, directionHint: nil) } - let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } - let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(arguments), directionHint: nil) } + let insertions = indicesAndItems.map { ListViewInsertItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } + let updates = updateIndices.map { ListViewUpdateItem(index: $0.0, previousIndex: $0.2, item: $0.1.item(presentationData: presentationData, arguments: arguments), directionHint: nil) } return NotificationExceptionsSearchContainerTransition(deletions: deletions, insertions: insertions, updates: updates, isSearching: isSearching) } @@ -1266,7 +1266,7 @@ private final class NotificationExceptionsSearchContainerNode: SearchDisplayCont let entries = notificationsExceptionEntries(presentationData: presentationData, state: state.0, query: state.1, foundPeers: foundPeers) let previousEntriesAndPresentationData = previousEntriesHolder.swap((entries, presentationData.theme, presentationData.strings)) - let transition = preparedNotificationExceptionsSearchContainerTransition(theme: presentationData.theme, strings: presentationData.strings, from: previousEntriesAndPresentationData?.0 ?? [], to: entries, arguments: arguments, isSearching: state.1 != nil && !state.1!.isEmpty, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings) + let transition = preparedNotificationExceptionsSearchContainerTransition(presentationData: ItemListPresentationData(presentationData), from: previousEntriesAndPresentationData?.0 ?? [], to: entries, arguments: arguments, isSearching: state.1 != nil && !state.1!.isEmpty, forceUpdate: previousEntriesAndPresentationData?.1 !== presentationData.theme || previousEntriesAndPresentationData?.2 !== presentationData.strings) self?.enqueueTransition(transition) })) diff --git a/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionSettingsController.swift b/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionSettingsController.swift index dec3d00836..15b7590aa4 100644 --- a/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionSettingsController.swift +++ b/submodules/SettingsUI/Sources/Notifications/Exceptions/NotificationExceptionSettingsController.swift @@ -156,11 +156,11 @@ private enum NotificationPeerExceptionEntry: ItemListNodeEntry { return lhs.index < rhs.index } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! NotificationPeerExceptionArguments switch self { case let .remove(_, theme, strings): - return ItemListActionItem(theme: theme, title: strings.Notification_Exceptions_RemoveFromExceptions, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: strings.Notification_Exceptions_RemoveFromExceptions, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.removeFromExceptions() }) case let .switcher(_, theme, strings, mode, selected): @@ -171,11 +171,11 @@ private enum NotificationPeerExceptionEntry: ItemListNodeEntry { case .alwaysOff: title = strings.Notification_Exceptions_AlwaysOff } - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectMode(mode) }) case let .switcherHeader(_, theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .displayPreviews(_, theme, strings, value, selected): let title: String switch value { @@ -184,25 +184,25 @@ private enum NotificationPeerExceptionEntry: ItemListNodeEntry { case .alwaysOff: title = strings.Notification_Exceptions_AlwaysOff } - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectDisplayPreviews(value) }) case let .displayPreviewsHeader(_, theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .soundModernHeader(_, theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .soundClassicHeader(_, theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .none(_, _, theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: true, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: true, sectionId: self.section, action: { arguments.selectSound(.none) }) case let .default(_, _, theme, text, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectSound(.default) }) case let .sound(_, _, theme, text, sound, selected): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: selected, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.selectSound(sound) }) } @@ -374,8 +374,8 @@ func notificationPeerExceptionController(context: AccountContext, peer: Peer, mo arguments.complete() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: notificationPeerExceptionEntries(presentationData: presentationData, state: state), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder)), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: notificationPeerExceptionEntries(presentationData: presentationData, state: state), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Notifications/NotificationsAndSounds.swift b/submodules/SettingsUI/Sources/Notifications/NotificationsAndSounds.swift index 58655c1eb4..8aa9dee531 100644 --- a/submodules/SettingsUI/Sources/Notifications/NotificationsAndSounds.swift +++ b/submodules/SettingsUI/Sources/Notifications/NotificationsAndSounds.swift @@ -558,37 +558,37 @@ private enum NotificationsAndSoundsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! NotificationsAndSoundsArguments switch self { case let .accountsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .allAccounts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateNotificationsFromAllAccounts(updatedValue) }, tag: self.tag) case let .accountsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .permissionInfo(theme, title, text, suppressed): - return ItemListInfoItem(theme: theme, title: title, text: .plain(text), style: .blocks, sectionId: self.section, closeAction: suppressed ? nil : { + return ItemListInfoItem(presentationData: presentationData, title: title, text: .plain(text), style: .blocks, sectionId: self.section, closeAction: suppressed ? nil : { arguments.suppressWarning() }) case let .permissionEnable(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.authorizeNotifications() }) case let .messageHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .messageAlerts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateMessageAlerts(updatedValue) }, tag: self.tag) case let .messagePreviews(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateMessagePreviews(updatedValue) }, tag: self.tag) case let .messageSound(theme, text, value, sound): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { let controller = notificationSoundSelectionController(context: arguments.context, isModal: true, currentSound: sound, defaultSound: nil, completion: { [weak arguments] value in arguments?.updateMessageSound(value) }) @@ -596,24 +596,24 @@ private enum NotificationsAndSoundsEntry: ItemListNodeEntry { }) case let .userExceptions(theme, strings, text, value): let label = value.settings.count > 0 ? strings.Notifications_Exceptions(Int32(value.settings.count)) : strings.Notification_Exceptions_Add - return ItemListDisclosureItem(theme: theme, title: text, label: label, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: label, sectionId: self.section, style: .blocks, action: { let controller = NotificationExceptionsController(context: arguments.context, mode: value, updatedMode: arguments.updatedExceptionMode) arguments.pushController(controller) }) case let .messageNotice(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .groupHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .groupAlerts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateGroupAlerts(updatedValue) }, tag: self.tag) case let .groupPreviews(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateGroupPreviews(updatedValue) }, tag: self.tag) case let .groupSound(theme, text, value, sound): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { let controller = notificationSoundSelectionController(context: arguments.context, isModal: true, currentSound: sound, defaultSound: nil, completion: { [weak arguments] value in arguments?.updateGroupSound(value) }) @@ -621,24 +621,24 @@ private enum NotificationsAndSoundsEntry: ItemListNodeEntry { }) case let .groupExceptions(theme, strings, text, value): let label = value.settings.count > 0 ? strings.Notifications_Exceptions(Int32(value.settings.count)) : strings.Notification_Exceptions_Add - return ItemListDisclosureItem(theme: theme, title: text, label: label, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: label, sectionId: self.section, style: .blocks, action: { let controller = NotificationExceptionsController(context: arguments.context, mode: value, updatedMode: arguments.updatedExceptionMode) arguments.pushController(controller) }) case let .groupNotice(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .channelHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .channelAlerts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateChannelAlerts(updatedValue) }, tag: self.tag) case let .channelPreviews(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateChannelPreviews(updatedValue) }, tag: self.tag) case let .channelSound(theme, text, value, sound): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { let controller = notificationSoundSelectionController(context: arguments.context, isModal: true, currentSound: sound, defaultSound: nil, completion: { [weak arguments] value in arguments?.updateChannelSound(value) }) @@ -646,62 +646,62 @@ private enum NotificationsAndSoundsEntry: ItemListNodeEntry { }) case let .channelExceptions(theme, strings, text, value): let label = value.settings.count > 0 ? strings.Notifications_Exceptions(Int32(value.settings.count)) : strings.Notification_Exceptions_Add - return ItemListDisclosureItem(theme: theme, title: text, label: label, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: label, sectionId: self.section, style: .blocks, action: { let controller = NotificationExceptionsController(context: arguments.context, mode: value, updatedMode: arguments.updatedExceptionMode) arguments.pushController(controller) }) case let .channelNotice(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .inAppHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .inAppSounds(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateInAppSounds(updatedValue) }, tag: self.tag) case let .inAppVibrate(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateInAppVibration(updatedValue) }, tag: self.tag) case let .inAppPreviews(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateInAppPreviews(updatedValue) }, tag: self.tag) case let .displayNamesOnLockscreen(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateDisplayNameOnLockscreen(updatedValue) }, tag: self.tag) case let .displayNamesOnLockscreenInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text.replacingOccurrences(of: "]", with: "]()")), sectionId: self.section, linkAction: { _ in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text.replacingOccurrences(of: "]", with: "]()")), sectionId: self.section, linkAction: { _ in arguments.openAppSettings() }) case let .badgeHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .includePublicGroups(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateIncludeTag(.publicGroups, updatedValue) }, tag: self.tag) case let .includeChannels(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateIncludeTag(.channels, updatedValue) }, tag: self.tag) case let .unreadCountCategory(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateTotalUnreadCountCategory(updatedValue) }, tag: self.tag) case let .unreadCountCategoryInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .joinedNotifications(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateJoinedNotifications(updatedValue) }, tag: self.tag) case let .joinedNotificationsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .reset(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.resetNotifications() }, tag: self.tag) case let .resetNotice(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -1074,8 +1074,8 @@ public func notificationsAndSoundsController(context: AccountContext, exceptions } } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Notifications_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: entries, style: .blocks, ensureVisibleItemTag: focusOnItemTag, initialScrollToItem: scrollToItem) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Notifications_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: entries, style: .blocks, ensureVisibleItemTag: focusOnItemTag, initialScrollToItem: scrollToItem) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/BlockedPeersController.swift b/submodules/SettingsUI/Sources/Privacy and Security/BlockedPeersController.swift index 3464fd0f3b..0ac8d17e94 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/BlockedPeersController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/BlockedPeersController.swift @@ -121,15 +121,15 @@ private enum BlockedPeersEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! BlockedPeersControllerArguments switch self { case let .add(theme, text): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.addPersonIcon(theme), title: text, sectionId: self.section, editing: false, action: { arguments.addPeer() }) case let .peerItem(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer, editing, enabled): - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .none, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: nil, text: .none, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { arguments.openPeer(peer) }, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) @@ -294,8 +294,8 @@ public func blockedPeersController(context: AccountContext, blockedPeersContext: let previousStateValue = previousState previousState = blockedPeersState - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.BlockedUsers_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: blockedPeersControllerEntries(presentationData: presentationData, state: state, blockedPeersState: blockedPeersState), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previousStateValue != nil && previousStateValue!.peers.count >= blockedPeersState.peers.count, scrollEnabled: emptyStateItem == nil) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.BlockedUsers_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: blockedPeersControllerEntries(presentationData: presentationData, state: state, blockedPeersState: blockedPeersState), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previousStateValue != nil && previousStateValue!.peers.count >= blockedPeersState.peers.count, scrollEnabled: emptyStateItem == nil) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/ConfirmPhoneNumberController.swift b/submodules/SettingsUI/Sources/Privacy and Security/ConfirmPhoneNumberController.swift index 1b4c8bb18c..ac27bd6795 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/ConfirmPhoneNumberController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/ConfirmPhoneNumberController.swift @@ -85,11 +85,11 @@ private enum ConfirmPhoneNumberCodeEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ConfirmPhoneNumberCodeControllerArguments switch self { case let .codeEntry(theme, strings, title, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: title, textColor: .black), text: text, placeholder: "", type: .number, spacing: 10.0, tag: ConfirmPhoneNumberCodeTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: title, textColor: .black), text: text, placeholder: "", type: .number, spacing: 10.0, tag: ConfirmPhoneNumberCodeTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() @@ -108,7 +108,7 @@ private enum ConfirmPhoneNumberCodeEntry: ItemListNodeEntry { if !nextOptionText.isEmpty { result += "\n\n" + nextOptionText } - return ItemListTextItem(theme: theme, text: .markdown(result), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(result), sectionId: self.section) } } } @@ -169,7 +169,7 @@ private final class ConfirmPhoneNumberCodeControllerImpl: ItemListController, Co self.applyCodeImpl = applyCodeImpl let presentationData = context.sharedContext.currentPresentationData.with { $0 } - super.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: context.sharedContext.presentationData |> map { ($0.theme, $0.strings) }, state: state, tabBarItem: nil) + super.init(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: context.sharedContext.presentationData |> map(ItemListPresentationData.init(_:)), state: state, tabBarItem: nil) } required init(coder aDecoder: NSCoder) { @@ -311,8 +311,8 @@ public func confirmPhoneNumberCodeController(context: AccountContext, phoneNumbe }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.CancelResetAccount_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: confirmPhoneNumberCodeControllerEntries(presentationData: presentationData, state: state, phoneNumber: phoneNumber, codeData: data, timeout: timeout, strings: presentationData.strings, theme: presentationData.theme), style: .blocks, focusItemTag: ConfirmPhoneNumberCodeTag.input, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.CancelResetAccount_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: confirmPhoneNumberCodeControllerEntries(presentationData: presentationData, state: state, phoneNumber: phoneNumber, codeData: data, timeout: timeout, strings: presentationData.strings, theme: presentationData.theme), style: .blocks, focusItemTag: ConfirmPhoneNumberCodeTag.input, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/CreatePasswordController.swift b/submodules/SettingsUI/Sources/Privacy and Security/CreatePasswordController.swift index 539981eb97..5be4d7c79c 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/CreatePasswordController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/CreatePasswordController.swift @@ -118,29 +118,29 @@ private enum CreatePasswordEntry: ItemListNodeEntry, Equatable { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! CreatePasswordControllerArguments switch self { case let .passwordHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .password(theme, strings, text, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: value, placeholder: text, type: .password, returnKeyType: .next, spacing: 0.0, tag: CreatePasswordEntryTag.password, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: value, placeholder: text, type: .password, returnKeyType: .next, spacing: 0.0, tag: CreatePasswordEntryTag.password, sectionId: self.section, textUpdated: { updatedText in arguments.updateFieldText(.password, updatedText) }, action: { arguments.selectNextInputItem(CreatePasswordEntryTag.password) }) case let .passwordConfirmation(theme, strings, text, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: value, placeholder: text, type: .password, returnKeyType: .next, spacing: 0.0, tag: CreatePasswordEntryTag.passwordConfirmation, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: value, placeholder: text, type: .password, returnKeyType: .next, spacing: 0.0, tag: CreatePasswordEntryTag.passwordConfirmation, sectionId: self.section, textUpdated: { updatedText in arguments.updateFieldText(.passwordConfirmation, updatedText) }, action: { arguments.selectNextInputItem(CreatePasswordEntryTag.passwordConfirmation) }) case let .passwordInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .hintHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .hint(theme, strings, text, value, last): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: value, placeholder: text, type: .regular(capitalization: true, autocorrection: false), returnKeyType: last ? .done : .next, spacing: 0.0, tag: CreatePasswordEntryTag.hint, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: value, placeholder: text, type: .regular(capitalization: true, autocorrection: false), returnKeyType: last ? .done : .next, spacing: 0.0, tag: CreatePasswordEntryTag.hint, sectionId: self.section, textUpdated: { updatedText in arguments.updateFieldText(.hint, updatedText) }, action: { if last { @@ -150,21 +150,21 @@ private enum CreatePasswordEntry: ItemListNodeEntry, Equatable { } }) case let .hintInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .emailHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .email(theme, strings, text, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: value, placeholder: text, type: .email, returnKeyType: .done, spacing: 0.0, tag: CreatePasswordEntryTag.email, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: value, placeholder: text, type: .email, returnKeyType: .done, spacing: 0.0, tag: CreatePasswordEntryTag.email, sectionId: self.section, textUpdated: { updatedText in arguments.updateFieldText(.email, updatedText) }, action: { arguments.save() }) case let .emailInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .emailConfirmation(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .emailCancel(theme, text, enabled): - return ItemListActionItem(theme: theme, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.cancelEmailConfirmation() }) } @@ -406,8 +406,8 @@ func createPasswordController(context: AccountContext, createPasswordContext: Cr title = presentationData.strings.FastTwoStepSetup_Title } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: createPasswordControllerEntries(presentationData: presentationData, context: createPasswordContext, state: state), style: .blocks, focusItemTag: CreatePasswordEntryTag.password, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: createPasswordControllerEntries(presentationData: presentationData, context: createPasswordContext, state: state), style: .blocks, focusItemTag: CreatePasswordEntryTag.password, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/DataPrivacySettingsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/DataPrivacySettingsController.swift index 04e059923d..92be569268 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/DataPrivacySettingsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/DataPrivacySettingsController.swift @@ -209,49 +209,49 @@ private enum PrivacyAndSecurityEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! DataPrivacyControllerArguments switch self { case let .contactsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .deleteContacts(theme, text, value): - return ItemListActionItem(theme: theme, title: text, kind: value ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: value ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.deleteContacts() }) case let .syncContacts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateSyncContacts(updatedValue) }) case let .syncContactsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .frequentContacts(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enableInteractiveChanges: !value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enableInteractiveChanges: !value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateSuggestFrequentContacts(updatedValue) }) case let .frequentContactsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .chatsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .deleteCloudDrafts(theme, text, value): - return ItemListActionItem(theme: theme, title: text, kind: value ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: value ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.deleteCloudDrafts() }) case let .paymentHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .clearPaymentInfo(theme, text, enabled): - return ItemListActionItem(theme: theme, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: enabled ? .generic : .disabled, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.clearPaymentInfo() }) case let .paymentInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .secretChatLinkPreviewsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .secretChatLinkPreviews(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { updatedValue in arguments.updateSecretChatLinkPreviews(updatedValue) }) case let .secretChatLinkPreviewsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -515,12 +515,12 @@ public func dataPrivacyController(context: AccountContext) -> ViewController { let rightNavigationButton: ItemListNavigationButton? = nil - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.PrivateDataSettings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.PrivateDataSettings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) let previousStateValue = previousState.swap(state) let animateChanges = false - let listState = ItemListNodeState(entries: dataPrivacyControllerEntries(presentationData: presentationData, state: state, secretChatLinkPreviews: secretChatLinkPreviews, synchronizeDeviceContacts: synchronizeDeviceContacts, frequentContacts: suggestRecentPeers), style: .blocks, animateChanges: animateChanges) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: dataPrivacyControllerEntries(presentationData: presentationData, state: state, secretChatLinkPreviews: secretChatLinkPreviews, synchronizeDeviceContacts: synchronizeDeviceContacts, frequentContacts: suggestRecentPeers), style: .blocks, animateChanges: animateChanges) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/PasscodeOptionsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/PasscodeOptionsController.swift index 3b4c1fe359..2cd30f4d2f 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/PasscodeOptionsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/PasscodeOptionsController.swift @@ -106,27 +106,27 @@ private enum PasscodeOptionsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! PasscodeOptionsControllerArguments switch self { case let .togglePasscode(theme, title, value): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { if value { arguments.turnPasscodeOff() } }) case let .changePasscode(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.changePasscode() }) case let .settingInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .autoLock(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.changePasscodeTimeout() }) case let .touchId(theme, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.changeTouchId(value) }) } @@ -363,8 +363,8 @@ func passcodeOptionsController(context: AccountContext) -> ViewController { let signal = combineLatest(context.sharedContext.presentationData, statePromise.get(), passcodeOptionsDataPromise.get()) |> deliverOnMainQueue |> map { presentationData, state, passcodeOptionsData -> (ItemListControllerState, (ItemListNodeState, Any)) in - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.PasscodeSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: passcodeOptionsControllerEntries(presentationData: presentationData, state: state, passcodeOptionsData: passcodeOptionsData), style: .blocks, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.PasscodeSettings_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: passcodeOptionsControllerEntries(presentationData: presentationData, state: state, passcodeOptionsData: passcodeOptionsData), style: .blocks, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift b/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift index 438bc08cdd..dd8e67b148 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/PrivacyAndSecurityController.swift @@ -249,67 +249,67 @@ private enum PrivacyAndSecurityEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! PrivacyAndSecurityControllerArguments switch self { case let .privacyHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .blockedPeers(theme, text, value): - return ItemListDisclosureItem(theme: theme, icon: UIImage(bundleImageName: "Settings/MenuIcons/Blocked")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: UIImage(bundleImageName: "Settings/MenuIcons/Blocked")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openBlockedUsers() }) case let .phoneNumberPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openPhoneNumberPrivacy() }) case let .lastSeenPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openLastSeenPrivacy() }) case let .profilePhotoPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openProfilePhotoPrivacy() }) case let .forwardPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openForwardPrivacy() }) case let .groupPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openGroupsPrivacy() }) case let .selectivePrivacyInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .voiceCallPrivacy(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openVoiceCallPrivacy() }) case let .passcode(theme, text, hasFaceId, value): - return ItemListDisclosureItem(theme: theme, icon: UIImage(bundleImageName: hasFaceId ? "Settings/MenuIcons/FaceId" : "Settings/MenuIcons/TouchId")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: UIImage(bundleImageName: hasFaceId ? "Settings/MenuIcons/FaceId" : "Settings/MenuIcons/TouchId")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openPasscode() }) case let .twoStepVerification(theme, text, value, data): - return ItemListDisclosureItem(theme: theme, icon: UIImage(bundleImageName: "Settings/MenuIcons/TwoStepAuth")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: UIImage(bundleImageName: "Settings/MenuIcons/TwoStepAuth")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openTwoStepVerification(data) }) case let .activeSessions(theme, text, value): - return ItemListDisclosureItem(theme: theme, icon: UIImage(bundleImageName: "Settings/MenuIcons/Sessions")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: UIImage(bundleImageName: "Settings/MenuIcons/Sessions")?.precomposed(), title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openActiveSessions() }) case let .accountHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .accountTimeout(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.setupAccountAutoremove() }, tag: PrivacyAndSecurityEntryTag.accountTimeout) case let .accountInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .dataSettings(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openDataSettings() }) case let .dataSettingsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -746,9 +746,9 @@ public func privacyAndSecurityController(context: AccountContext, initialSetting rightNavigationButton = ItemListNavigationButton(content: .none, style: .activity, enabled: true, action: {}) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.PrivacySettings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.PrivacySettings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: privacyAndSecurityControllerEntries(presentationData: presentationData, state: state, privacySettings: privacySettings, accessChallengeData: accessChallengeData.data, blockedPeerCount: blockedPeersState.totalCount, activeSessionsCount: activeSessionsState.sessions.count, twoStepAuthData: twoStepAuthData), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: privacyAndSecurityControllerEntries(presentationData: presentationData, state: state, privacySettings: privacySettings, accessChallengeData: accessChallengeData.data, blockedPeerCount: blockedPeersState.totalCount, activeSessionsCount: activeSessionsState.sessions.count, twoStepAuthData: twoStepAuthData), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListRecentSessionItem.swift b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListRecentSessionItem.swift index b5d3a63945..b6b69bbbf3 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListRecentSessionItem.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListRecentSessionItem.swift @@ -37,8 +37,7 @@ enum ItemListRecentSessionItemText { } final class ItemListRecentSessionItem: ListViewItem, ItemListItem { - let theme: PresentationTheme - let strings: PresentationStrings + let presentationData: ItemListPresentationData let dateTimeFormat: PresentationDateTimeFormat let session: RecentAccountSession let enabled: Bool @@ -49,9 +48,8 @@ final class ItemListRecentSessionItem: ListViewItem, ItemListItem { let setSessionIdWithRevealedOptions: (Int64?, Int64?) -> Void let removeSession: (Int64) -> Void - init(theme: PresentationTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, session: RecentAccountSession, enabled: Bool, editable: Bool, editing: Bool, revealed: Bool, sectionId: ItemListSectionId, setSessionIdWithRevealedOptions: @escaping (Int64?, Int64?) -> Void, removeSession: @escaping (Int64) -> Void) { - self.theme = theme - self.strings = strings + init(presentationData: ItemListPresentationData, dateTimeFormat: PresentationDateTimeFormat, session: RecentAccountSession, enabled: Bool, editable: Bool, editing: Bool, revealed: Bool, sectionId: ItemListSectionId, setSessionIdWithRevealedOptions: @escaping (Int64?, Int64?) -> Void, removeSession: @escaping (Int64) -> Void) { + self.presentationData = presentationData self.dateTimeFormat = dateTimeFormat self.session = session self.enabled = enabled @@ -102,9 +100,6 @@ final class ItemListRecentSessionItem: ListViewItem, ItemListItem { } } -private let titleFont = Font.medium(15.0) -private let textFont = Font.regular(13.0) - class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { private let backgroundNode: ASDisplayNode private let topStripeNode: ASDisplayNode @@ -179,8 +174,15 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { return { item, params, neighbors in var updatedTheme: PresentationTheme? - if currentItem?.theme !== item.theme { - updatedTheme = item.theme + let titleFont = Font.medium(floor(item.presentationData.fontSize.itemListBaseFontSize * 15.0 / 17.0)) + let textFont = Font.regular(floor(item.presentationData.fontSize.itemListBaseFontSize * 13.0 / 17.0)) + + let verticalInset: CGFloat = 10.0 + let titleSpacing: CGFloat = 1.0 + let textSpacing: CGFloat = 3.0 + + if currentItem?.presentationData.theme !== item.presentationData.theme { + updatedTheme = item.presentationData.theme } var titleAttributedString: NSAttributedString? @@ -190,14 +192,14 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { let peerRevealOptions: [ItemListRevealOption] if item.editable && item.enabled { - peerRevealOptions = [ItemListRevealOption(key: 0, title: item.strings.AuthSessions_Terminate, icon: .none, color: item.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.theme.list.itemDisclosureActions.destructive.foregroundColor)] + peerRevealOptions = [ItemListRevealOption(key: 0, title: item.presentationData.strings.AuthSessions_Terminate, icon: .none, color: item.presentationData.theme.list.itemDisclosureActions.destructive.fillColor, textColor: item.presentationData.theme.list.itemDisclosureActions.destructive.foregroundColor)] } else { peerRevealOptions = [] } let rightInset: CGFloat = params.rightInset - titleAttributedString = NSAttributedString(string: "\(item.session.appName) \(item.session.appVersion)", font: titleFont, textColor: item.theme.list.itemPrimaryTextColor) + titleAttributedString = NSAttributedString(string: "\(item.session.appName) \(item.session.appVersion)", font: titleFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) var appString = "" if !item.session.deviceModel.isEmpty { @@ -218,25 +220,25 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { appString += item.session.systemVersion } - appAttributedString = NSAttributedString(string: appString, font: textFont, textColor: item.theme.list.itemPrimaryTextColor) - locationAttributedString = NSAttributedString(string: "\(item.session.ip) — \(item.session.country)", font: textFont, textColor: item.theme.list.itemSecondaryTextColor) + appAttributedString = NSAttributedString(string: appString, font: textFont, textColor: item.presentationData.theme.list.itemPrimaryTextColor) + locationAttributedString = NSAttributedString(string: "\(item.session.ip) — \(item.session.country)", font: textFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) if item.session.isCurrent { - labelAttributedString = NSAttributedString(string: item.strings.Presence_online, font: textFont, textColor: item.theme.list.itemAccentColor) + labelAttributedString = NSAttributedString(string: item.presentationData.strings.Presence_online, font: textFont, textColor: item.presentationData.theme.list.itemAccentColor) } else { let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) - let dateText = stringForRelativeTimestamp(strings: item.strings, relativeTimestamp: item.session.activityDate, relativeTo: timestamp, dateTimeFormat: item.dateTimeFormat) - labelAttributedString = NSAttributedString(string: dateText, font: textFont, textColor: item.theme.list.itemSecondaryTextColor) + let dateText = stringForRelativeTimestamp(strings: item.presentationData.strings, relativeTimestamp: item.session.activityDate, relativeTo: timestamp, dateTimeFormat: item.dateTimeFormat) + labelAttributedString = NSAttributedString(string: dateText, font: textFont, textColor: item.presentationData.theme.list.itemSecondaryTextColor) } let leftInset: CGFloat = 15.0 + params.leftInset - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? let editingOffset: CGFloat if item.editing { - let sizeAndApply = editableControlLayout(75.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.presentationData.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 } else { editingOffset = 0.0 } @@ -247,7 +249,7 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { let (locationLayout, locationApply) = makeLocationLayout(TextNodeLayoutArguments(attributedString: locationAttributedString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - editingOffset - rightInset, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let insets = itemListNeighborsGroupedInsets(neighbors) - let contentSize = CGSize(width: params.width, height: 75.0) + let contentSize = CGSize(width: params.width, height: verticalInset * 2.0 + titleLayout.size.height + titleSpacing + appLayout.size.height + textSpacing + locationLayout.size.height) let separatorHeight = UIScreenPixel let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) @@ -267,10 +269,10 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { strongSelf.layoutParams = (item, params, neighbors) if let _ = updatedTheme { - strongSelf.topStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor - strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor - strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor + strongSelf.topStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.bottomStripeNode.backgroundColor = item.presentationData.theme.list.itemBlocksSeparatorColor + strongSelf.backgroundNode.backgroundColor = item.presentationData.theme.list.itemBlocksBackgroundColor + strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor } let revealOffset = strongSelf.revealOffset @@ -300,9 +302,9 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) @@ -370,17 +372,17 @@ class ItemListRecentSessionItemNode: ItemListRevealOptionsItemNode { strongSelf.bottomStripeNode.isHidden = hasCorners } - strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil + strongSelf.maskNode.image = hasCorners ? PresentationResourcesItemList.cornersImage(item.presentationData.theme, top: hasTopCorners, bottom: hasBottomCorners) : nil strongSelf.backgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: params.width, height: contentSize.height + min(insets.top, separatorHeight) + min(insets.bottom, separatorHeight))) strongSelf.maskNode.frame = strongSelf.backgroundNode.frame.insetBy(dx: params.leftInset, dy: 0.0) transition.updateFrame(node: strongSelf.topStripeNode, frame: CGRect(origin: CGPoint(x: 0.0, y: -min(insets.top, separatorHeight)), size: CGSize(width: layoutSize.width, height: separatorHeight))) transition.updateFrame(node: strongSelf.bottomStripeNode, frame: CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height + bottomStripeOffset), size: CGSize(width: layoutSize.width - bottomStripeInset, height: separatorHeight))) - transition.updateFrame(node: strongSelf.labelNode, frame: CGRect(origin: CGPoint(x: revealOffset + params.width - labelLayout.size.width - 15.0 - rightInset, y: 10.0), size: labelLayout.size)) - transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: 10.0), size: titleLayout.size)) - transition.updateFrame(node: strongSelf.appNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: 30.0), size: appLayout.size)) - transition.updateFrame(node: strongSelf.locationNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: 50.0), size: locationLayout.size)) + transition.updateFrame(node: strongSelf.labelNode, frame: CGRect(origin: CGPoint(x: revealOffset + params.width - labelLayout.size.width - 15.0 - rightInset, y: verticalInset), size: labelLayout.size)) + transition.updateFrame(node: strongSelf.titleNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: verticalInset), size: titleLayout.size)) + transition.updateFrame(node: strongSelf.appNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: strongSelf.titleNode.frame.maxY + titleSpacing), size: appLayout.size)) + transition.updateFrame(node: strongSelf.locationNode, frame: CGRect(origin: CGPoint(x: leftInset + revealOffset + editingOffset, y: strongSelf.appNode.frame.maxY + textSpacing), size: locationLayout.size)) strongSelf.highlightedBackgroundNode.frame = CGRect(origin: CGPoint(x: 0.0, y: -UIScreenPixel), size: CGSize(width: params.width, height: 75.0 + UIScreenPixel + UIScreenPixel)) diff --git a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift index 9a949e1910..1a6467bfaf 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift @@ -226,13 +226,13 @@ class ItemListWebsiteItemNode: ItemListRevealOptionsItemNode { let leftInset: CGFloat = 15.0 + params.leftInset - var editableControlSizeAndApply: (CGSize, () -> ItemListEditableControlNode)? + var editableControlSizeAndApply: (CGFloat, (CGFloat) -> ItemListEditableControlNode)? let editingOffset: CGFloat if item.editing { - let sizeAndApply = editableControlLayout(75.0, item.theme, false) + let sizeAndApply = editableControlLayout(item.theme, false) editableControlSizeAndApply = sizeAndApply - editingOffset = sizeAndApply.0.width + editingOffset = sizeAndApply.0 } else { editingOffset = 0.0 } @@ -300,9 +300,9 @@ class ItemListWebsiteItemNode: ItemListRevealOptionsItemNode { } if let editableControlSizeAndApply = editableControlSizeAndApply { - let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: editableControlSizeAndApply.0) + let editableControlFrame = CGRect(origin: CGPoint(x: params.leftInset + revealOffset, y: 0.0), size: CGSize(width: editableControlSizeAndApply.0, height: layout.contentSize.height)) if strongSelf.editableControlNode == nil { - let editableControlNode = editableControlSizeAndApply.1() + let editableControlNode = editableControlSizeAndApply.1(layout.contentSize.height) editableControlNode.tapped = { if let strongSelf = self { strongSelf.setRevealOptionsOpened(true, animated: true) diff --git a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift index 7a94a462ef..ae4b11d53c 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift @@ -240,39 +240,39 @@ private enum RecentSessionsEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! RecentSessionsControllerArguments switch self { case let .currentSessionHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .currentSession(theme, strings, dateTimeFormat, session): - return ItemListRecentSessionItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, session: session, enabled: true, editable: false, editing: false, revealed: false, sectionId: self.section, setSessionIdWithRevealedOptions: { _, _ in + return ItemListRecentSessionItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, session: session, enabled: true, editable: false, editing: false, revealed: false, sectionId: self.section, setSessionIdWithRevealedOptions: { _, _ in }, removeSession: { _ in }) case let .terminateOtherSessions(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.terminateOtherSessions() }) case let .terminateAllWebSessions(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .destructive, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.terminateAllWebSessions() }) case let .currentSessionInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .pendingSessionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .pendingSession(_, theme, strings, dateTimeFormat, session, enabled, editing, revealed): - return ItemListRecentSessionItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, session: session, enabled: enabled, editable: true, editing: editing, revealed: revealed, sectionId: self.section, setSessionIdWithRevealedOptions: { previousId, id in + return ItemListRecentSessionItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, session: session, enabled: enabled, editable: true, editing: editing, revealed: revealed, sectionId: self.section, setSessionIdWithRevealedOptions: { previousId, id in arguments.setSessionIdWithRevealedOptions(previousId, id) }, removeSession: { id in arguments.removeSession(id) }) case let .pendingSessionsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .otherSessionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .session(_, theme, strings, dateTimeFormat, session, enabled, editing, revealed): - return ItemListRecentSessionItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, session: session, enabled: enabled, editable: true, editing: editing, revealed: revealed, sectionId: self.section, setSessionIdWithRevealedOptions: { previousId, id in + return ItemListRecentSessionItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, session: session, enabled: enabled, editable: true, editing: editing, revealed: revealed, sectionId: self.section, setSessionIdWithRevealedOptions: { previousId, id in arguments.setSessionIdWithRevealedOptions(previousId, id) }, removeSession: { id in arguments.removeSession(id) @@ -638,8 +638,8 @@ public func recentSessionsController(context: AccountContext, activeSessionsCont animateChanges = false } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: title, leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: entries, style: .blocks, emptyStateItem: emptyStateItem, crossfadeState: crossfadeState, animateChanges: animateChanges, scrollEnabled: emptyStateItem == nil) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: title, leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: entries, style: .blocks, emptyStateItem: emptyStateItem, crossfadeState: crossfadeState, animateChanges: animateChanges, scrollEnabled: emptyStateItem == nil) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift index 8ab56b4298..330cadc7b0 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsController.swift @@ -345,85 +345,85 @@ private enum SelectivePrivacySettingsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! SelectivePrivacySettingsControllerArguments switch self { case let .forwardsPreviewHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, multiline: true, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, multiline: true, sectionId: self.section) case let .forwardsPreview(theme, wallpaper, fontSize, strings, dateTimeFormat, nameDisplayOrder, peerName, linkEnabled, tooltipText): return ForwardPrivacyChatPreviewItem(context: arguments.context, theme: theme, strings: strings, sectionId: self.section, fontSize: fontSize, wallpaper: wallpaper, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, peerName: peerName, linkEnabled: linkEnabled, tooltipText: tooltipText) case let .settingHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, multiline: true, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, multiline: true, sectionId: self.section) case let .everybody(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateType(.everybody) }) case let .contacts(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateType(.contacts) }) case let .nobody(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateType(.nobody) }) case let .settingInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .exceptionsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .disableFor(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openSelective(.main, false) }) case let .enableFor(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openSelective(.main, true) }) case let .peersInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .callsP2PHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .callsP2PAlways(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateCallP2PMode?(.everybody) }) case let .callsP2PContacts(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateCallP2PMode?(.contacts) }) case let .callsP2PNever(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateCallP2PMode?(.nobody) }) case let .callsP2PInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .callsP2PDisableFor(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openSelective(.callP2P, false) }) case let .callsP2PEnableFor(theme, title, value): - return ItemListDisclosureItem(theme: theme, title: title, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: title, label: value, sectionId: self.section, style: .blocks, action: { arguments.openSelective(.callP2P, true) }) case let .callsP2PPeersInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .callsIntegrationEnabled(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.updateCallIntegrationEnabled?(value) }) case let .callsIntegrationInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .phoneDiscoveryHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .phoneDiscoveryEverybody(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updatePhoneDiscovery?(true) }) case let .phoneDiscoveryMyContacts(theme, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updatePhoneDiscovery?(false) }) case let .phoneDiscoveryInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -954,8 +954,8 @@ func selectivePrivacySettingsController(context: AccountContext, kind: Selective case .phoneNumber: title = presentationData.strings.Privacy_PhoneNumber } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: selectivePrivacySettingsControllerEntries(presentationData: presentationData, kind: kind, state: state, peerName: peerName ?? ""), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: selectivePrivacySettingsControllerEntries(presentationData: presentationData, kind: kind, state: state, peerName: peerName ?? ""), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsPeersController.swift b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsPeersController.swift index 459fddb8f1..f66e0fd7a9 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsPeersController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/SelectivePrivacySettingsPeersController.swift @@ -148,7 +148,7 @@ private enum SelectivePrivacyPeersEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! SelectivePrivacyPeersControllerArguments switch self { case let .peerItem(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer, editing, enabled): @@ -167,7 +167,7 @@ private enum SelectivePrivacyPeersEntry: ItemListNodeEntry { } } } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer.peer, presence: nil, text: text, label: .none, editing: editing, switchValue: nil, enabled: enabled, selectable: true, sectionId: self.section, action: { arguments.openPeer(peer.peer.id) }, setPeerIdWithRevealedOptions: { previousId, id in arguments.setPeerIdWithRevealedOptions(previousId, id) @@ -175,7 +175,7 @@ private enum SelectivePrivacyPeersEntry: ItemListNodeEntry { arguments.removePeer(peerId) }) case let .addItem(theme, text, editing): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, editing: editing, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, sectionId: self.section, editing: editing, action: { arguments.addPeer() }) } @@ -373,8 +373,8 @@ public func selectivePrivacyPeersController(context: AccountContext, title: Stri let previous = previousPeers previousPeers = peers - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: selectivePrivacyPeersControllerEntries(presentationData: presentationData, state: state, peers: peers), style: .blocks, emptyStateItem: nil, animateChanges: previous != nil && previous!.count >= peers.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: selectivePrivacyPeersControllerEntries(presentationData: presentationData, state: state, peers: peers), style: .blocks, emptyStateItem: nil, animateChanges: previous != nil && previous!.count >= peers.count) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationPasswordEntryController.swift b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationPasswordEntryController.swift index c02f94bf8b..6a4ab372c1 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationPasswordEntryController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationPasswordEntryController.swift @@ -121,33 +121,33 @@ private enum TwoStepVerificationPasswordEntryEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! TwoStepVerificationPasswordEntryControllerArguments switch self { case let .passwordEntryTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .passwordEntry(theme, strings, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: "", type: .password, spacing: 0.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: "", type: .password, spacing: 0.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() }) case let .hintTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .hintEntry(theme, strings, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: "", type: .password, spacing: 0.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: "", textColor: .black), text: text, placeholder: "", type: .password, spacing: 0.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() }) case let .emailEntry(theme, strings, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: strings.TwoStepAuth_Email, textColor: .black), text: text, placeholder: "", type: .email, spacing: 10.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: strings.TwoStepAuth_Email, textColor: .black), text: text, placeholder: "", type: .email, spacing: 10.0, tag: TwoStepVerificationPasswordEntryTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() }) case let .emailInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -433,8 +433,8 @@ func twoStepVerificationPasswordEntryController(context: AccountContext, mode: T title = presentationData.strings.TwoStepAuth_EmailTitle } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: twoStepVerificationPasswordEntryControllerEntries(presentationData: presentationData, state: state, mode: mode), style: .blocks, focusItemTag: TwoStepVerificationPasswordEntryTag.input, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: twoStepVerificationPasswordEntryControllerEntries(presentationData: presentationData, state: state, mode: mode), style: .blocks, focusItemTag: TwoStepVerificationPasswordEntryTag.input, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationResetController.swift b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationResetController.swift index 3aac1dcfb5..2f6091ea8e 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationResetController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationResetController.swift @@ -87,17 +87,17 @@ private enum TwoStepVerificationResetEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! TwoStepVerificationResetControllerArguments switch self { case let .codeEntry(theme, strings, placeholder, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: placeholder, textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: "", type: .password, spacing: 10.0, tag: TwoStepVerificationResetTag.input, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: placeholder, textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: "", type: .password, spacing: 10.0, tag: TwoStepVerificationResetTag.input, sectionId: self.section, textUpdated: { updatedText in arguments.updateEntryText(updatedText) }, action: { arguments.next() }) case let .codeInfo(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) } } } @@ -225,8 +225,8 @@ func twoStepVerificationResetController(context: AccountContext, emailPattern: S }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.TwoStepAuth_RecoveryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: twoStepVerificationResetControllerEntries(presentationData: presentationData, state: state, emailPattern: emailPattern), style: .blocks, focusItemTag: TwoStepVerificationResetTag.input, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.TwoStepAuth_RecoveryTitle), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: twoStepVerificationResetControllerEntries(presentationData: presentationData, state: state, emailPattern: emailPattern), style: .blocks, focusItemTag: TwoStepVerificationResetTag.input, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationUnlockController.swift b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationUnlockController.swift index e2e79c9341..b05e9b0f37 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationUnlockController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/TwoStepVerificationUnlockController.swift @@ -123,57 +123,57 @@ private enum TwoStepVerificationUnlockSettingsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! TwoStepVerificationUnlockSettingsControllerArguments switch self { case let .passwordEntry(theme, strings, text, value): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: text, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: "", type: .password, spacing: 10.0, tag: TwoStepVerificationUnlockSettingsEntryTag.password, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: text, textColor: theme.list.itemPrimaryTextColor), text: value, placeholder: "", type: .password, spacing: 10.0, tag: TwoStepVerificationUnlockSettingsEntryTag.password, sectionId: self.section, textUpdated: { updatedText in arguments.updatePasswordText(updatedText) }, action: { arguments.checkPassword() }) case let .passwordEntryInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section, linkAction: { action in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section, linkAction: { action in switch action { case .tap: arguments.openForgotPassword() } }) case let .passwordSetup(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openSetupPassword() }) case let .passwordSetupInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .changePassword(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openSetupPassword() }) case let .turnPasswordOff(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openDisablePassword() }) case let .setupRecoveryEmail(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openSetupEmail() }) case let .passwordInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .pendingEmailConfirmInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .pendingEmailConfirmCode(theme, strings, title, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: ""), text: text, placeholder: title, type: .number, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: ""), text: text, placeholder: title, type: .number, sectionId: self.section, textUpdated: { value in arguments.updateEmailCode(value) }, action: {}) case let .pendingEmailInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section, linkAction: { action in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section, linkAction: { action in switch action { case .tap: arguments.openResetPendingEmail() } }) case let .pendingEmailOpenConfirm(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openConfirmEmail() }) } @@ -808,8 +808,8 @@ func twoStepVerificationUnlockSettingsController(context: AccountContext, mode: } } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: twoStepVerificationUnlockSettingsControllerEntries(presentationData: presentationData, state: state, data: data), style: .blocks, focusItemTag: didAppear ? TwoStepVerificationUnlockSettingsEntryTag.password : nil, emptyStateItem: emptyStateItem, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: twoStepVerificationUnlockSettingsControllerEntries(presentationData: presentationData, state: state, data: data), style: .blocks, focusItemTag: didAppear ? TwoStepVerificationUnlockSettingsEntryTag.password : nil, emptyStateItem: emptyStateItem, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift b/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift index 98ae0b2a24..130d421f03 100644 --- a/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift +++ b/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift @@ -676,7 +676,7 @@ private func appearanceSearchableItems(context: AccountContext) -> [SettingsSear SettingsSearchableItem(id: .appearance(0), title: strings.Settings_Appearance, alternate: synonyms(strings.SettingsSearch_Synonyms_Appearance_Title), icon: icon, breadcrumbs: [], present: { context, _, present in presentAppearanceSettings(context, present, nil) }), - SettingsSearchableItem(id: .appearance(1), title: strings.Appearance_TextSize, alternate: synonyms(strings.SettingsSearch_Synonyms_Appearance_TextSize), icon: icon, breadcrumbs: [strings.Settings_Appearance], present: { context, _, present in + SettingsSearchableItem(id: .appearance(1), title: strings.Appearance_TextSizeSetting, alternate: synonyms(strings.SettingsSearch_Synonyms_Appearance_TextSize), icon: icon, breadcrumbs: [strings.Settings_Appearance], present: { context, _, present in presentAppearanceSettings(context, present, .fontSize) }), SettingsSearchableItem(id: .appearance(2), title: strings.Settings_ChatBackground, alternate: synonyms(strings.SettingsSearch_Synonyms_Appearance_ChatBackground), icon: icon, breadcrumbs: [strings.Settings_Appearance], present: { context, _, present in diff --git a/submodules/SettingsUI/Sources/SettingsController.swift b/submodules/SettingsUI/Sources/SettingsController.swift index 6e008b0e47..bc8349bb7b 100644 --- a/submodules/SettingsUI/Sources/SettingsController.swift +++ b/submodules/SettingsUI/Sources/SettingsController.swift @@ -464,11 +464,11 @@ private indirect enum SettingsEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! SettingsItemArguments switch self { case let .userInfo(account, theme, strings, dateTimeFormat, peer, cachedData, state, updatingImage): - return ItemListAvatarAndNameInfoItem(account: account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .settings, peer: peer, presence: TelegramUserPresence(status: .present(until: Int32.max), lastActivity: 0), cachedData: cachedData, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { _ in + return ItemListAvatarAndNameInfoItem(account: account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .settings, peer: peer, presence: TelegramUserPresence(status: .present(until: Int32.max), lastActivity: 0), cachedData: cachedData, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { _ in }, avatarTapped: { arguments.avatarTapAction() }, context: arguments.avatarAndNameInfoContext, updatingImage: updatingImage, action: { @@ -477,25 +477,25 @@ private indirect enum SettingsEntry: ItemListNodeEntry { arguments.displayCopyContextMenu() }) case let .setProfilePhoto(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.changeProfilePhoto() }) case let .setUsername(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openUsername() }) case let .phoneInfo(theme, title, text): - return ItemListInfoItem(theme: theme, title: title, text: .markdown(text), style: .blocks, sectionId: self.section, linkAction: { action in + return ItemListInfoItem(presentationData: presentationData, title: title, text: .markdown(text), style: .blocks, sectionId: self.section, linkAction: { action in if case .tap = action { arguments.openFaq("q-i-have-a-new-phone-number-what-do-i-do") } }, closeAction: nil) case let .keepPhone(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.keepPhone() }) case let .changePhone(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openPhoneNumberChange() }) case let .account(_, account, theme, strings, dateTimeFormat, peer, badgeCount, revealed): @@ -503,7 +503,7 @@ private indirect enum SettingsEntry: ItemListNodeEntry { if badgeCount > 0 { label = .badge(compactNumericCountString(Int(badgeCount), decimalSeparator: dateTimeFormat.decimalSeparator)) } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: PresentationDateTimeFormat(timeFormat: .regular, dateFormat: .dayFirst, dateSeparator: ".", decimalSeparator: ".", groupingSeparator: ""), nameDisplayOrder: .firstLast, account: account, peer: peer, height: .generic, aliasHandling: .standard, nameStyle: .plain, presence: nil, text: .none, label: label, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: PresentationDateTimeFormat(timeFormat: .regular, dateFormat: .dayFirst, dateSeparator: ".", decimalSeparator: ".", groupingSeparator: ""), nameDisplayOrder: .firstLast, account: account, peer: peer, height: .generic, aliasHandling: .standard, nameStyle: .plain, presence: nil, text: .none, label: label, editing: ItemListPeerItemEditing(editable: true, editing: false, revealed: revealed), revealOptions: nil, switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: { arguments.switchToAccount(account.id) }, setPeerIdWithRevealedOptions: { lhs, rhs in var lhsAccountId: AccountRecordId? @@ -521,63 +521,63 @@ private indirect enum SettingsEntry: ItemListNodeEntry { arguments.accountContextAction(account.id, node, gesture) }, tag: SettingsEntryTag.account(account.id)) case let .addAccount(theme, text): - return ItemListPeerActionItem(theme: theme, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, alwaysPlain: false, sectionId: self.section, height: .generic, editing: false, action: { + return ItemListPeerActionItem(presentationData: presentationData, icon: PresentationResourcesItemList.plusIconImage(theme), title: text, alwaysPlain: false, sectionId: self.section, height: .generic, editing: false, action: { arguments.addAccount() }) case let .proxy(theme, image, text, value): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openProxy() }) case let .savedMessages(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openSavedMessages() }, clearHighlightAutomatically: false) case let .recentCalls(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openRecentCalls() }, clearHighlightAutomatically: false) case let .stickers(theme, image, text, value, archivedPacks): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, labelStyle: .badge(theme.list.itemAccentColor), sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, labelStyle: .badge(theme.list.itemAccentColor), sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openStickerPacks(archivedPacks) }, clearHighlightAutomatically: false) case let .notificationsAndSounds(theme, image, text, exceptionsList, warning): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: warning ? "!" : "", labelStyle: warning ? .badge(theme.list.itemDestructiveColor) : .text, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: warning ? "!" : "", labelStyle: warning ? .badge(theme.list.itemDestructiveColor) : .text, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openNotificationsAndSounds(exceptionsList) }, clearHighlightAutomatically: false) case let .privacyAndSecurity(theme, image, text, privacySettings): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openPrivacyAndSecurity(privacySettings) }, clearHighlightAutomatically: false) case let .dataAndStorage(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openDataAndStorage() }, clearHighlightAutomatically: false) case let .themes(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openThemes() }, clearHighlightAutomatically: false) case let .language(theme, image, text, value): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openLanguage() }, clearHighlightAutomatically: false) case let .passport(theme, image, text, value): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openPassport() }) case let .wallet(theme, image, text, value): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openWallet() }) case let .watch(theme, image, text, value): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openWatch() }, clearHighlightAutomatically: false) case let .askAQuestion(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openSupport() }) case let .faq(theme, image, text): - return ItemListDisclosureItem(theme: theme, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: image, title: text, label: "", sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.openFaq(nil) }, clearHighlightAutomatically: false) } @@ -693,12 +693,11 @@ private final class SettingsControllerImpl: ItemListController, SettingsControll self.contextValue.set(.single(currentContext)) let updatedPresentationData = self.contextValue.get() - |> mapToSignal { context -> Signal<(theme: PresentationTheme, strings: PresentationStrings), NoError> in + |> mapToSignal { context -> Signal in return context.sharedContext.presentationData - |> map { ($0.theme, $0.strings) } } - super.init(theme: presentationData.theme, strings: presentationData.strings, updatedPresentationData: updatedPresentationData, state: state, tabBarItem: tabBarItem) + super.init(presentationData: ItemListPresentationData(presentationData), updatedPresentationData: updatedPresentationData |> map(ItemListPresentationData.init(_:)), state: state, tabBarItem: tabBarItem) self.accountsAndPeersDisposable = (accountsAndPeers |> deliverOnMainQueue).start(next: { [weak self] value in @@ -1292,7 +1291,7 @@ public func settingsController(context: AccountContext, accountManager: AccountM arguments.openEditing() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Settings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Settings_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) var unreadTrendingStickerPacks = 0 for item in featuredAndArchived.0 { @@ -1321,7 +1320,7 @@ public func settingsController(context: AccountContext, accountManager: AccountM }, getNavigationController: getNavigationControllerImpl, exceptionsList: notifyExceptions.get(), archivedStickerPacks: archivedPacks.get(), privacySettings: privacySettings.get(), hasWallet: hasWallet) let (hasWallet, hasPassport, hasWatchApp) = hasWalletPassportAndWatch - let listState = ItemListNodeState(entries: settingsEntries(account: context.account, presentationData: presentationData, state: state, view: view, proxySettings: proxySettings, notifyExceptions: preferencesAndExceptions.1, notificationsAuthorizationStatus: preferencesAndExceptions.2, notificationsWarningSuppressed: preferencesAndExceptions.3, unreadTrendingStickerPacks: unreadTrendingStickerPacks, archivedPacks: featuredAndArchived.1, privacySettings: preferencesAndExceptions.4, hasWallet: hasWallet, hasPassport: hasPassport, hasWatchApp: hasWatchApp, accountsAndPeers: accountsAndPeers.1, inAppNotificationSettings: inAppNotificationSettings, experimentalUISettings: experimentalUISettings, displayPhoneNumberConfirmation: preferencesAndExceptions.5), style: .blocks, searchItem: searchItem, initialScrollToItem: ListViewScrollToItem(index: 0, position: .top(-navigationBarSearchContentHeight), animated: false, curve: .Default(duration: 0.0), directionHint: .Up)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: settingsEntries(account: context.account, presentationData: presentationData, state: state, view: view, proxySettings: proxySettings, notifyExceptions: preferencesAndExceptions.1, notificationsAuthorizationStatus: preferencesAndExceptions.2, notificationsWarningSuppressed: preferencesAndExceptions.3, unreadTrendingStickerPacks: unreadTrendingStickerPacks, archivedPacks: featuredAndArchived.1, privacySettings: preferencesAndExceptions.4, hasWallet: hasWallet, hasPassport: hasPassport, hasWatchApp: hasWatchApp, accountsAndPeers: accountsAndPeers.1, inAppNotificationSettings: inAppNotificationSettings, experimentalUISettings: experimentalUISettings, displayPhoneNumberConfirmation: preferencesAndExceptions.5), style: .blocks, searchItem: searchItem, initialScrollToItem: ListViewScrollToItem(index: 0, position: .top(-navigationBarSearchContentHeight), animated: false, curve: .Default(duration: 0.0), directionHint: .Up)) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift index b6727c786d..66167b54be 100644 --- a/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/ArchivedStickerPacksController.swift @@ -154,13 +154,13 @@ private enum ArchivedStickerPacksEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ArchivedStickerPacksControllerArguments switch self { case let .info(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .pack(_, theme, strings, info, topItem, count, animatedStickers, enabled, editing): - return ItemListStickerPackItem(theme: theme, strings: strings, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: .installation(installed: false), editing: editing, enabled: enabled, playAnimatedStickers: animatedStickers, sectionId: self.section, action: { + return ItemListStickerPackItem(presentationData: presentationData, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: .installation(installed: false), editing: editing, enabled: enabled, playAnimatedStickers: animatedStickers, sectionId: self.section, action: { arguments.openStickerPack(info) }, setPackIdWithRevealedOptions: { current, previous in arguments.setPackIdWithRevealedOptions(current, previous) @@ -414,9 +414,9 @@ public func archivedStickerPacksController(context: AccountContext, mode: Archiv emptyStateItem = ItemListLoadingIndicatorEmptyStateItem(theme: presentationData.theme) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.StickerPacksSettings_ArchivedPacks), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.StickerPacksSettings_ArchivedPacks), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: archivedStickerPacksControllerEntries(presentationData: presentationData, state: state, packs: packs, installedView: installedView, stickerSettings: stickerSettings), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previous != nil && packs != nil && (previous! != 0 && previous! >= packs!.count - 10)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: archivedStickerPacksControllerEntries(presentationData: presentationData, state: state, packs: packs, installedView: installedView, stickerSettings: stickerSettings), style: .blocks, emptyStateItem: emptyStateItem, animateChanges: previous != nil && packs != nil && (previous! != 0 && previous! >= packs!.count - 10)) return (controllerState, (listState, arguments)) } |> afterDisposed { actionsDisposable.dispose() diff --git a/submodules/SettingsUI/Sources/Stickers/FeaturedStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/FeaturedStickerPacksController.swift index ae1c2cd704..815a8c1967 100644 --- a/submodules/SettingsUI/Sources/Stickers/FeaturedStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/FeaturedStickerPacksController.swift @@ -117,11 +117,11 @@ private enum FeaturedStickerPacksEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! FeaturedStickerPacksControllerArguments switch self { case let .pack(_, theme, strings, info, unread, topItem, count, playAnimatedStickers, installed): - return ItemListStickerPackItem(theme: theme, strings: strings, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: unread, control: .installation(installed: installed), editing: ItemListStickerPackItemEditing(editable: false, editing: false, revealed: false, reorderable: false), enabled: true, playAnimatedStickers: playAnimatedStickers, sectionId: self.section, action: { + return ItemListStickerPackItem(presentationData: presentationData, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: unread, control: .installation(installed: installed), editing: ItemListStickerPackItemEditing(editable: false, editing: false, revealed: false, reorderable: false), enabled: true, playAnimatedStickers: playAnimatedStickers, sectionId: self.section, action: { arguments.openStickerPack(info) }, setPackIdWithRevealedOptions: { _, _ in }, addPack: { @@ -226,9 +226,9 @@ public func featuredStickerPacksController(context: AccountContext) -> ViewContr let previous = previousPackCount previousPackCount = packCount - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.FeaturedStickerPacks_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.FeaturedStickerPacks_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: featuredStickerPacksControllerEntries(presentationData: presentationData, state: state, view: view, featured: featured, unreadPacks: initialUnreadPacks, stickerSettings: stickerSettings), style: .blocks, animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: featuredStickerPacksControllerEntries(presentationData: presentationData, state: state, view: view, featured: featured, unreadPacks: initialUnreadPacks, stickerSettings: stickerSettings), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { actionsDisposable.dispose() diff --git a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift index 0e929357ee..185820fe53 100644 --- a/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift +++ b/submodules/SettingsUI/Sources/Stickers/InstalledStickerPacksController.swift @@ -289,35 +289,35 @@ private indirect enum InstalledStickerPacksEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! InstalledStickerPacksControllerArguments switch self { case let .suggestOptions(theme, text, value): - return ItemListDisclosureItem(theme: theme, title: text, label: value, sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: value, sectionId: self.section, style: .blocks, action: { arguments.openSuggestOptions() }, tag: InstalledStickerPacksEntryTag.suggestOptions) case let .trending(theme, text, count): - return ItemListDisclosureItem(theme: theme, title: text, label: count == 0 ? "" : "\(count)", labelStyle: .badge(theme.list.itemAccentColor), sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: count == 0 ? "" : "\(count)", labelStyle: .badge(theme.list.itemAccentColor), sectionId: self.section, style: .blocks, action: { arguments.openFeatured() }) case let .masks(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openMasks() }) case let .archived(theme, text, count, archived): - return ItemListDisclosureItem(theme: theme, title: text, label: count == 0 ? "" : "\(count)", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: count == 0 ? "" : "\(count)", sectionId: self.section, style: .blocks, action: { arguments.openArchived(archived) }) case let .animatedStickers(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleAnimatedStickers(value) }) case let .animatedStickersInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .packsTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .pack(_, theme, strings, info, topItem, count, animatedStickers, enabled, editing): - return ItemListStickerPackItem(theme: theme, strings: strings, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: .none, editing: editing, enabled: enabled, playAnimatedStickers: animatedStickers, sectionId: self.section, action: { + return ItemListStickerPackItem(presentationData: presentationData, account: arguments.account, packInfo: info, itemCount: count, topItem: topItem, unread: false, control: .none, editing: editing, enabled: enabled, playAnimatedStickers: animatedStickers, sectionId: self.section, action: { arguments.openStickerPack(info) }, setPackIdWithRevealedOptions: { current, previous in arguments.setPackIdWithRevealedOptions(current, previous) @@ -326,7 +326,7 @@ private indirect enum InstalledStickerPacksEntry: ItemListNodeEntry { arguments.removePack(ArchivedStickerPackItem(info: info, topItems: topItem != nil ? [topItem!] : [])) }) case let .packsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section, linkAction: { _ in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section, linkAction: { _ in arguments.openStickersBot() }) } @@ -658,9 +658,9 @@ public func installedStickerPacksController(context: AccountContext, mode: Insta title = presentationData.strings.MaskStickerSettings_Title } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: installedStickerPacksControllerEntries(presentationData: presentationData, state: state, mode: mode, view: view, temporaryPackOrder: temporaryPackOrder, featured: featuredAndArchived.0, archived: featuredAndArchived.1, stickerSettings: stickerSettings), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: previous != nil && packCount != nil && (previous! != 0 && previous! >= packCount! - 10)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: installedStickerPacksControllerEntries(presentationData: presentationData, state: state, mode: mode, view: view, temporaryPackOrder: temporaryPackOrder, featured: featuredAndArchived.0, archived: featuredAndArchived.1, stickerSettings: stickerSettings), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: previous != nil && packCount != nil && (previous! != 0 && previous! >= packCount! - 10)) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceController.swift b/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceController.swift index 4ba0f94379..ef44096ebb 100644 --- a/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceController.swift +++ b/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceController.swift @@ -60,8 +60,7 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont return self.displayNode as! TermsOfServiceControllerNode } - private let theme: TermsOfServiceControllerTheme - private let strings: PresentationStrings + private let presentationData: PresentationData private let text: String private let entities: [MessageTextEntity] private let ageConfirmation: Int32? @@ -76,7 +75,7 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont public var inProgress: Bool = false { didSet { if self.inProgress { - let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.theme.accent)) + let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.presentationData.theme.list.itemAccentColor)) self.navigationItem.rightBarButtonItem = item } else { self.navigationItem.rightBarButtonItem = nil @@ -85,9 +84,8 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont } } - public init(theme: TermsOfServiceControllerTheme, strings: PresentationStrings, text: String, entities: [MessageTextEntity], ageConfirmation: Int32?, signingUp: Bool, accept: @escaping (String?) -> Void, decline: @escaping () -> Void, openUrl: @escaping (String) -> Void) { - self.theme = theme - self.strings = strings + public init(presentationData: PresentationData, text: String, entities: [MessageTextEntity], ageConfirmation: Int32?, signingUp: Bool, accept: @escaping (String?) -> Void, decline: @escaping () -> Void, openUrl: @escaping (String) -> Void) { + self.presentationData = presentationData self.text = text self.entities = entities self.ageConfirmation = ageConfirmation @@ -96,13 +94,13 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont self.decline = decline self.openUrl = openUrl - super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: NavigationBarTheme(buttonColor: self.theme.accent, disabledButtonColor: self.theme.disabled, primaryTextColor: self.theme.primary, backgroundColor: self.theme.navigationBackground, separatorColor: self.theme.navigationSeparator, badgeBackgroundColor: .clear, badgeStrokeColor: .clear, badgeTextColor: .clear), strings: NavigationBarStrings(back: strings.Common_Back, close: strings.Common_Close))) + super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme), strings: NavigationBarStrings(back: presentationData.strings.Common_Back, close: presentationData.strings.Common_Close))) - self.statusBar.statusBarStyle = self.theme.statusBarStyle + self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style - self.title = self.strings.Login_TermsOfServiceHeader + self.title = self.presentationData.strings.Login_TermsOfServiceHeader - self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.strings.Common_Back, style: .plain, target: nil, action: nil) + self.navigationItem.backBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Back, style: .plain, target: nil, action: nil) self.scrollToTop = { [weak self] in self?.controllerNode.scrollToTop() @@ -117,7 +115,7 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont } override public func loadDisplayNode() { - self.displayNode = TermsOfServiceControllerNode(theme: self.theme, strings: self.strings, text: self.text, entities: self.entities, ageConfirmation: self.ageConfirmation, leftAction: { [weak self] in + self.displayNode = TermsOfServiceControllerNode(presentationData: self.presentationData, text: self.text, entities: self.entities, ageConfirmation: self.ageConfirmation, leftAction: { [weak self] in guard let strongSelf = self else { return } @@ -125,16 +123,16 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont let text: String let declineTitle: String if strongSelf.signingUp { - text = strongSelf.strings.Login_TermsOfServiceSignupDecline - declineTitle = strongSelf.strings.Login_TermsOfServiceDecline + text = strongSelf.presentationData.strings.Login_TermsOfServiceSignupDecline + declineTitle = strongSelf.presentationData.strings.Login_TermsOfServiceDecline } else { - text = strongSelf.strings.PrivacyPolicy_DeclineMessage - declineTitle = strongSelf.strings.PrivacyPolicy_DeclineDeclineAndDelete + text = strongSelf.presentationData.strings.PrivacyPolicy_DeclineMessage + declineTitle = strongSelf.presentationData.strings.PrivacyPolicy_DeclineDeclineAndDelete } - let theme: PresentationTheme = strongSelf.theme.presentationTheme - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: theme), title: strongSelf.strings.PrivacyPolicy_Decline, text: text, actions: [TextAlertAction(type: .destructiveAction, title: declineTitle, action: { + let theme: PresentationTheme = strongSelf.presentationData.theme + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.PrivacyPolicy_Decline, text: text, actions: [TextAlertAction(type: .destructiveAction, title: declineTitle, action: { self?.decline() - }), TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_Cancel, action: { + }), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { })], actionLayout: .vertical), in: .window(.root)) }, rightAction: { [weak self] in guard let strongSelf = self else { @@ -142,8 +140,8 @@ public class TermsOfServiceController: ViewController, StandalonePresentableCont } if let ageConfirmation = strongSelf.ageConfirmation { - let theme: PresentationTheme = strongSelf.theme.presentationTheme - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: theme), title: strongSelf.strings.PrivacyPolicy_AgeVerificationTitle, text: strongSelf.strings.PrivacyPolicy_AgeVerificationMessage("\(ageConfirmation)").0, actions: [TextAlertAction(type: .genericAction, title: strongSelf.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: strongSelf.strings.PrivacyPolicy_AgeVerificationAgree, action: { + let theme: PresentationTheme = strongSelf.presentationData.theme + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.PrivacyPolicy_AgeVerificationTitle, text: strongSelf.presentationData.strings.PrivacyPolicy_AgeVerificationMessage("\(ageConfirmation)").0, actions: [TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {}), TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.PrivacyPolicy_AgeVerificationAgree, action: { self?.accept(self?.proccessBotNameAfterAccept) })]), in: .window(.root)) } else { diff --git a/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceControllerNode.swift b/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceControllerNode.swift index cf5c360569..a7c862b51a 100644 --- a/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceControllerNode.swift +++ b/submodules/SettingsUI/Sources/Terms of Service/TermsOfServiceControllerNode.swift @@ -10,8 +10,7 @@ import TelegramPresentationData import TextFormat final class TermsOfServiceControllerNode: ViewControllerTracingNode { - private let theme: TermsOfServiceControllerTheme - private let strings: PresentationStrings + private let presentationData: PresentationData private let text: String private let entities: [MessageTextEntity] private let ageConfirmation: Int32? @@ -43,9 +42,8 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { } } - init(theme: TermsOfServiceControllerTheme, strings: PresentationStrings, text: String, entities: [MessageTextEntity], ageConfirmation: Int32?, leftAction: @escaping () -> Void, rightAction: @escaping () -> Void, openUrl: @escaping (String) -> Void, present: @escaping (ViewController, Any?) -> Void, setToProcceedBot:@escaping(String)->Void) { - self.theme = theme - self.strings = strings + init(presentationData: PresentationData, text: String, entities: [MessageTextEntity], ageConfirmation: Int32?, leftAction: @escaping () -> Void, rightAction: @escaping () -> Void, openUrl: @escaping (String) -> Void, present: @escaping (ViewController, Any?) -> Void, setToProcceedBot:@escaping(String)->Void) { + self.presentationData = presentationData self.text = text self.entities = entities self.ageConfirmation = ageConfirmation @@ -59,7 +57,10 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { self.contentTextNode = ImmediateTextNode() self.contentTextNode.displaysAsynchronously = false self.contentTextNode.maximumNumberOfLines = 0 - self.contentTextNode.attributedText = stringWithAppliedEntities(text, entities: entities, baseColor: theme.primary, linkColor: theme.accent, baseFont: Font.regular(15.0), linkFont: Font.regular(15.0), boldFont: Font.semibold(15.0), italicFont: Font.italic(15.0), boldItalicFont: Font.semiboldItalic(15.0), fixedFont: Font.monospace(15.0), blockQuoteFont: Font.regular(15.0)) + + let fontSize = floor(presentationData.fontSize.baseDisplaySize * 15.0 / 17.0) + + self.contentTextNode.attributedText = stringWithAppliedEntities(text, entities: entities, baseColor: presentationData.theme.list.itemPrimaryTextColor, linkColor: presentationData.theme.list.itemAccentColor, baseFont: Font.regular(fontSize), linkFont: Font.regular(fontSize), boldFont: Font.semibold(fontSize), italicFont: Font.italic(fontSize), boldItalicFont: Font.semiboldItalic(fontSize), fixedFont: Font.monospace(fontSize), blockQuoteFont: Font.regular(fontSize)) self.toolbarNode = ASDisplayNode() self.toolbarSeparatorNode = ASDisplayNode() @@ -67,20 +68,20 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { self.leftActionTextNode = ImmediateTextNode() self.leftActionTextNode.displaysAsynchronously = false self.leftActionTextNode.isUserInteractionEnabled = false - self.leftActionTextNode.attributedText = NSAttributedString(string: self.strings.PrivacyPolicy_Decline, font: Font.regular(17.0), textColor: self.theme.accent) + self.leftActionTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.PrivacyPolicy_Decline, font: Font.regular(presentationData.fontSize.baseDisplaySize), textColor: self.presentationData.theme.list.itemAccentColor) self.rightActionNode = HighlightableButtonNode() self.rightActionTextNode = ImmediateTextNode() self.rightActionTextNode.displaysAsynchronously = false self.rightActionTextNode.isUserInteractionEnabled = false - self.rightActionTextNode.attributedText = NSAttributedString(string: self.strings.PrivacyPolicy_Accept, font: Font.semibold(17.0), textColor: self.theme.accent) + self.rightActionTextNode.attributedText = NSAttributedString(string: self.presentationData.strings.PrivacyPolicy_Accept, font: Font.semibold(presentationData.fontSize.baseDisplaySize), textColor: self.presentationData.theme.list.itemAccentColor) super.init() - self.backgroundColor = self.theme.listBackground - self.toolbarNode.backgroundColor = self.theme.navigationBackground - self.toolbarSeparatorNode.backgroundColor = self.theme.navigationSeparator + self.backgroundColor = self.presentationData.theme.list.blocksBackgroundColor + self.toolbarNode.backgroundColor = self.presentationData.theme.rootController.navigationBar.backgroundColor + self.toolbarSeparatorNode.backgroundColor = self.presentationData.theme.rootController.navigationBar.separatorColor - self.contentBackgroundNode.backgroundColor = self.theme.itemBackground + self.contentBackgroundNode.backgroundColor = self.presentationData.theme.list.itemBlocksBackgroundColor self.addSubnode(self.scrollNode) self.scrollNode.addSubnode(self.contentBackgroundNode) @@ -119,7 +120,7 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { self.leftActionNode.addTarget(self, action: #selector(self.leftActionPressed), forControlEvents: .touchUpInside) self.rightActionNode.addTarget(self, action: #selector(self.rightActionPressed), forControlEvents: .touchUpInside) - self.contentTextNode.linkHighlightColor = self.theme.accent.withAlphaComponent(0.5) + self.contentTextNode.linkHighlightColor = self.presentationData.theme.list.itemAccentColor.withAlphaComponent(0.5) self.contentTextNode.highlightAttributeAction = { attributes in if let _ = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] { return NSAttributedString.Key(rawValue: TelegramTextAttributes.URL) @@ -136,16 +137,16 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { guard let strongSelf = self else { return } - let theme: PresentationTheme = strongSelf.theme.presentationTheme + let theme: PresentationTheme = strongSelf.presentationData.theme let actionSheet = ActionSheetController(presentationTheme: theme) actionSheet.setItemGroups([ActionSheetItemGroup(items: [ - ActionSheetTextItem(title: strongSelf.strings.Login_TermsOfService_ProceedBot(mention).0), - ActionSheetButtonItem(title: strongSelf.strings.PrivacyPolicy_Accept, color: .accent, action: { [weak actionSheet] in + ActionSheetTextItem(title: strongSelf.presentationData.strings.Login_TermsOfService_ProceedBot(mention).0), + ActionSheetButtonItem(title: strongSelf.presentationData.strings.PrivacyPolicy_Accept, color: .accent, action: { [weak actionSheet] in actionSheet?.dismissAnimated() setToProcceedBot(mention) rightAction() }) - ]), ActionSheetItemGroup(items: [ActionSheetButtonItem(title: strongSelf.strings.Common_Cancel, action: { [weak actionSheet] in + ]), ActionSheetItemGroup(items: [ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, action: { [weak actionSheet] in actionSheet?.dismissAnimated() })])]) strongSelf.present(actionSheet, nil) @@ -168,20 +169,20 @@ final class TermsOfServiceControllerNode: ViewControllerTracingNode { return } if let url = attributes[NSAttributedString.Key(rawValue: TelegramTextAttributes.URL)] as? String { - let theme: PresentationTheme = strongSelf.theme.presentationTheme + let theme: PresentationTheme = strongSelf.presentationData.theme let actionSheet = ActionSheetController(presentationTheme: theme) actionSheet.setItemGroups([ActionSheetItemGroup(items: [ ActionSheetTextItem(title: url), - ActionSheetButtonItem(title: strongSelf.strings.Conversation_LinkDialogOpen, color: .accent, action: { [weak actionSheet] in + ActionSheetButtonItem(title: strongSelf.presentationData.strings.Conversation_LinkDialogOpen, color: .accent, action: { [weak actionSheet] in actionSheet?.dismissAnimated() self?.openUrl(url) }), - ActionSheetButtonItem(title: strongSelf.strings.Conversation_LinkDialogCopy, color: .accent, action: { [weak actionSheet] in + ActionSheetButtonItem(title: strongSelf.presentationData.strings.Conversation_LinkDialogCopy, color: .accent, action: { [weak actionSheet] in actionSheet?.dismissAnimated() UIPasteboard.general.string = url }) ]), ActionSheetItemGroup(items: [ - ActionSheetButtonItem(title: strongSelf.strings.Common_Cancel, color: .accent, action: { [weak actionSheet] in + ActionSheetButtonItem(title: strongSelf.presentationData.strings.Common_Cancel, color: .accent, action: { [weak actionSheet] in actionSheet?.dismissAnimated() }) ])]) diff --git a/submodules/SettingsUI/Sources/Text Size/TextSizeSelectionController.swift b/submodules/SettingsUI/Sources/Text Size/TextSizeSelectionController.swift new file mode 100644 index 0000000000..28ede8025f --- /dev/null +++ b/submodules/SettingsUI/Sources/Text Size/TextSizeSelectionController.swift @@ -0,0 +1,816 @@ +import Foundation +import UIKit +import Display +import Postbox +import SwiftSignalKit +import AsyncDisplayKit +import TelegramCore +import SyncCore +import TelegramPresentationData +import TelegramUIPreferences +import AccountContext +import ChatListUI +import WallpaperResources +import LegacyComponents +import ItemListUI + +private func generateMaskImage(color: UIColor) -> UIImage? { + return generateImage(CGSize(width: 1.0, height: 80.0), opaque: false, rotatedContext: { size, context in + let bounds = CGRect(origin: CGPoint(), size: size) + context.clear(bounds) + + let gradientColors = [color.withAlphaComponent(0.0).cgColor, color.cgColor, color.cgColor] as CFArray + + var locations: [CGFloat] = [0.0, 0.75, 1.0] + let colorSpace = CGColorSpaceCreateDeviceRGB() + let gradient = CGGradient(colorsSpace: colorSpace, colors: gradientColors, locations: &locations)! + + context.drawLinearGradient(gradient, start: CGPoint(x: 0.0, y: 0.0), end: CGPoint(x: 0.0, y: 80.0), options: CGGradientDrawingOptions()) + }) +} + +private final class TextSizeSelectionControllerNode: ASDisplayNode, UIScrollViewDelegate { + private let context: AccountContext + private var presentationThemeSettings: PresentationThemeSettings + private var presentationData: PresentationData + + private let referenceTimestamp: Int32 + + private let scrollNode: ASScrollNode + private let pageControlBackgroundNode: ASDisplayNode + private let pageControlNode: PageControlNode + + private let chatListBackgroundNode: ASDisplayNode + private var chatNodes: [ListViewItemNode]? + private let maskNode: ASImageNode + + private let separatorNode: ASDisplayNode + + private let chatContainerNode: ASDisplayNode + private let messagesContainerNode: ASDisplayNode + private let instantChatBackgroundNode: WallpaperBackgroundNode + private let remoteChatBackgroundNode: TransformImageNode + private let blurredNode: BlurredImageNode + private var dateHeaderNode: ListViewItemHeaderNode? + private var messageNodes: [ListViewItemNode]? + + private let toolbarNode: TextSelectionToolbarNode + + private var validLayout: (ContainerViewLayout, CGFloat)? + + private var wallpaperDisposable: Disposable? + private var colorDisposable: Disposable? + private var statusDisposable: Disposable? + private var fetchDisposable = MetaDisposable() + + init(context: AccountContext, presentationThemeSettings: PresentationThemeSettings, dismiss: @escaping () -> Void, apply: @escaping (Bool, PresentationFontSize) -> Void) { + self.context = context + + self.presentationData = context.sharedContext.currentPresentationData.with { $0 } + self.presentationThemeSettings = presentationThemeSettings + + let calendar = Calendar(identifier: .gregorian) + var components = calendar.dateComponents(Set([.era, .year, .month, .day, .hour, .minute, .second]), from: Date()) + components.hour = 13 + components.minute = 0 + components.second = 0 + self.referenceTimestamp = Int32(calendar.date(from: components)?.timeIntervalSince1970 ?? 0.0) + + self.scrollNode = ASScrollNode() + + self.pageControlBackgroundNode = ASDisplayNode() + self.pageControlBackgroundNode.backgroundColor = UIColor(rgb: 0x000000, alpha: 0.3) + self.pageControlBackgroundNode.cornerRadius = 10.5 + + self.pageControlNode = PageControlNode(dotSpacing: 7.0, dotColor: .white, inactiveDotColor: UIColor.white.withAlphaComponent(0.4)) + + self.chatListBackgroundNode = ASDisplayNode() + + self.chatContainerNode = ASDisplayNode() + self.chatContainerNode.clipsToBounds = true + + self.messagesContainerNode = ASDisplayNode() + self.messagesContainerNode.clipsToBounds = true + self.messagesContainerNode.transform = CATransform3DMakeScale(1.0, -1.0, 1.0) + + self.instantChatBackgroundNode = WallpaperBackgroundNode() + self.instantChatBackgroundNode.displaysAsynchronously = false + self.instantChatBackgroundNode.image = chatControllerBackgroundImage(theme: presentationData.theme, wallpaper: presentationData.theme.chat.defaultWallpaper, mediaBox: context.sharedContext.accountManager.mediaBox, knockoutMode: context.sharedContext.immediateExperimentalUISettings.knockoutWallpaper) + if case .gradient = presentationData.theme.chat.defaultWallpaper { + self.instantChatBackgroundNode.imageContentMode = .scaleToFill + } + self.instantChatBackgroundNode.motionEnabled = presentationData.theme.chat.defaultWallpaper.settings?.motion ?? false + self.instantChatBackgroundNode.view.contentMode = .scaleAspectFill + + self.remoteChatBackgroundNode = TransformImageNode() + self.remoteChatBackgroundNode.backgroundColor = presentationData.theme.chatList.backgroundColor + self.remoteChatBackgroundNode.view.contentMode = .scaleAspectFill + + self.blurredNode = BlurredImageNode() + self.blurredNode.blurView.contentMode = .scaleAspectFill + + self.toolbarNode = TextSelectionToolbarNode(presentationThemeSettings: self.presentationThemeSettings, presentationData: self.presentationData) + + if case let .file(file) = presentationData.theme.chat.defaultWallpaper, file.id == 0 { + self.remoteChatBackgroundNode.isHidden = false + self.toolbarNode.setDoneEnabled(false) + } else { + self.remoteChatBackgroundNode.isHidden = true + } + + self.maskNode = ASImageNode() + self.maskNode.displaysAsynchronously = false + self.maskNode.displayWithoutProcessing = true + self.maskNode.contentMode = .scaleToFill + + self.separatorNode = ASDisplayNode() + self.separatorNode.backgroundColor = self.presentationData.theme.rootController.tabBar.separatorColor + + super.init() + + self.setViewBlock({ + return UITracingLayerView() + }) + + self.backgroundColor = self.presentationData.theme.list.plainBackgroundColor + + self.chatListBackgroundNode.backgroundColor = self.presentationData.theme.chatList.backgroundColor + self.maskNode.image = generateMaskImage(color: self.presentationData.theme.chatList.backgroundColor) + + if case let .color(value) = self.presentationData.theme.chat.defaultWallpaper { + self.instantChatBackgroundNode.backgroundColor = UIColor(rgb: UInt32(bitPattern: value)) + } + + self.pageControlNode.isUserInteractionEnabled = false + self.pageControlNode.pagesCount = 2 + + self.addSubnode(self.scrollNode) + self.chatListBackgroundNode.addSubnode(self.maskNode) + self.addSubnode(self.pageControlBackgroundNode) + self.addSubnode(self.pageControlNode) + self.addSubnode(self.toolbarNode) + + self.scrollNode.addSubnode(self.chatListBackgroundNode) + self.scrollNode.addSubnode(self.chatContainerNode) + + self.chatContainerNode.addSubnode(self.instantChatBackgroundNode) + self.chatContainerNode.addSubnode(self.remoteChatBackgroundNode) + self.chatContainerNode.addSubnode(self.messagesContainerNode) + + self.addSubnode(self.separatorNode) + + self.toolbarNode.cancel = { + dismiss() + } + self.toolbarNode.done = { [weak self] in + guard let strongSelf = self else { + return + } + apply(strongSelf.presentationThemeSettings.useSystemFont, strongSelf.presentationThemeSettings.fontSize) + } + self.toolbarNode.updateUseSystemFont = { [weak self] value in + guard let strongSelf = self else { + return + } + strongSelf.presentationThemeSettings.useSystemFont = value + strongSelf.updatePresentationThemeSettings(strongSelf.presentationThemeSettings) + } + self.toolbarNode.updateCustomFontSize = { [weak self] value in + guard let strongSelf = self else { + return + } + strongSelf.presentationThemeSettings.fontSize = value + strongSelf.updatePresentationThemeSettings(strongSelf.presentationThemeSettings) + } + + if case let .file(file) = self.presentationData.theme.chat.defaultWallpaper { + if file.settings.blur { + self.chatContainerNode.addSubnode(self.blurredNode) + } + } + + self.remoteChatBackgroundNode.imageUpdated = { [weak self] image in + if let strongSelf = self, strongSelf.blurredNode.supernode != nil { + var image = image + if let imageToScale = image { + let actualSize = CGSize(width: imageToScale.size.width * imageToScale.scale, height: imageToScale.size.height * imageToScale.scale) + if actualSize.width > 1280.0 || actualSize.height > 1280.0 { + image = TGScaleImageToPixelSize(image, actualSize.fitted(CGSize(width: 1280.0, height: 1280.0))) + } + } + strongSelf.blurredNode.image = image + strongSelf.blurredNode.blurView.blurRadius = 45.0 + } + } + + let _ = (chatServiceBackgroundColor(wallpaper: self.presentationData.chatWallpaper, mediaBox: context.account.postbox.mediaBox) + |> deliverOnMainQueue).start(next: { [weak self] serviceColor in + self?.pageControlBackgroundNode.backgroundColor = serviceColor + }) + + let applyWallpaper: (TelegramWallpaper) -> Void = { [weak self] wallpaper in + guard let strongSelf = self else { + return + } + if case let .file(file) = wallpaper { + let dimensions = file.file.dimensions ?? PixelDimensions(width: 100, height: 100) + let displaySize = dimensions.cgSize.dividedByScreenScale().integralFloor + + var convertedRepresentations: [ImageRepresentationWithReference] = [] + for representation in file.file.previewRepresentations { + convertedRepresentations.append(ImageRepresentationWithReference(representation: representation, reference: MediaResourceReference.media(media: .standalone(media: file.file), resource: representation.resource))) + } + convertedRepresentations.append(ImageRepresentationWithReference(representation: .init(dimensions: dimensions, resource: file.file.resource), reference: .media(media: .standalone(media: file.file), resource: file.file.resource))) + + let signal: Signal<(TransformImageArguments) -> DrawingContext?, NoError> + let fileReference = FileMediaReference.standalone(media: file.file) + if file.isPattern { + signal = patternWallpaperImage(account: context.account, accountManager: context.sharedContext.accountManager, representations: convertedRepresentations, mode: .screen, autoFetchFullSize: false) + } else { + signal = wallpaperImage(account: context.account, accountManager: context.sharedContext.accountManager, fileReference: fileReference, representations: convertedRepresentations, alwaysShowThumbnailFirst: false, autoFetchFullSize: false) + |> afterNext { next in + if let _ = context.sharedContext.accountManager.mediaBox.completedResourcePath(file.file.resource) { + } else if let path = context.account.postbox.mediaBox.completedResourcePath(file.file.resource), let data = try? Data(contentsOf: URL(fileURLWithPath: path)) { + context.sharedContext.accountManager.mediaBox.storeResourceData(file.file.resource.id, data: data) + } + } + } + strongSelf.remoteChatBackgroundNode.setSignal(signal) + + strongSelf.fetchDisposable.set(freeMediaFileInteractiveFetched(account: context.account, fileReference: .standalone(media: file.file)).start()) + + let account = strongSelf.context.account + let statusSignal = strongSelf.context.sharedContext.accountManager.mediaBox.resourceStatus(file.file.resource) + |> take(1) + |> mapToSignal { status -> Signal in + if case .Local = status { + return .single(status) + } else { + return account.postbox.mediaBox.resourceStatus(file.file.resource) + } + } + + strongSelf.statusDisposable = (statusSignal + |> deliverOnMainQueue).start(next: { [weak self] status in + if let strongSelf = self, case .Local = status { + strongSelf.toolbarNode.setDoneEnabled(true) + } + }) + + var patternColor: UIColor? + var patternIntensity: CGFloat = 0.5 + if let color = file.settings.color { + if let intensity = file.settings.intensity { + patternIntensity = CGFloat(intensity) / 100.0 + } + patternColor = UIColor(rgb: UInt32(bitPattern: color), alpha: patternIntensity) + } + + strongSelf.remoteChatBackgroundNode.asyncLayout()(TransformImageArguments(corners: ImageCorners(), imageSize: displaySize, boundingSize: displaySize, intrinsicInsets: UIEdgeInsets(), emptyColor: patternColor))() + } + } + applyWallpaper(self.presentationData.chatWallpaper) + } + + deinit { + self.colorDisposable?.dispose() + self.wallpaperDisposable?.dispose() + self.statusDisposable?.dispose() + self.fetchDisposable.dispose() + } + + override func didLoad() { + super.didLoad() + + self.scrollNode.view.disablesInteractiveTransitionGestureRecognizer = true + self.scrollNode.view.showsHorizontalScrollIndicator = false + self.scrollNode.view.isPagingEnabled = true + self.scrollNode.view.delegate = self + self.pageControlNode.setPage(0.0) + } + + func updateFontSize() { + if let (layout, navigationBarHeight) = self.validLayout { + self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate) + } + } + + func scrollViewDidScroll(_ scrollView: UIScrollView) { + let bounds = scrollView.bounds + if !bounds.width.isZero { + self.pageControlNode.setPage(scrollView.contentOffset.x / bounds.width) + } + } + + func animateIn(completion: (() -> Void)? = nil) { + if let (layout, _) = self.validLayout, case .compact = layout.metrics.widthClass { + self.layer.animatePosition(from: CGPoint(x: self.layer.position.x, y: self.layer.position.y + self.layer.bounds.size.height), to: self.layer.position, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring) + } + } + + func animateOut(completion: (() -> Void)? = nil) { + if let (layout, _) = self.validLayout, case .compact = layout.metrics.widthClass { + self.layer.animatePosition(from: self.layer.position, to: CGPoint(x: self.layer.position.x, y: self.layer.position.y + self.layer.bounds.size.height), duration: 0.2, timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, removeOnCompletion: false, completion: { _ in + completion?() + }) + } else { + completion?() + } + } + + private func updateChatsLayout(layout: ContainerViewLayout, topInset: CGFloat, transition: ContainedViewLayoutTransition) { + var items: [ChatListItem] = [] + + let interaction = ChatListNodeInteraction(activateSearch: {}, peerSelected: { _ in }, togglePeerSelected: { _ in }, messageSelected: { _, _, _ in}, groupSelected: { _ in }, addContact: { _ in }, setPeerIdWithRevealedOptions: { _, _ in }, setItemPinned: { _, _ in }, setPeerMuted: { _, _ in }, deletePeer: { _ in }, updatePeerGrouping: { _, _ in }, togglePeerMarkedUnread: { _, _ in}, toggleArchivedFolderHiddenByDefault: {}, activateChatPreview: { _, _, gesture in + gesture?.cancel() + }) + let chatListPresentationData = ChatListPresentationData(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true) + + let peers = SimpleDictionary() + let messages = SimpleDictionary() + let selfPeer = TelegramUser(id: self.context.account.peerId, accessHash: nil, firstName: nil, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer1 = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: 1), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_1_Name, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer2 = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: 2), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_2_Name, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer3 = TelegramChannel(id: PeerId(namespace: Namespaces.Peer.CloudChannel, id: 3), accessHash: nil, title: self.presentationData.strings.Appearance_ThemePreview_ChatList_3_Name, username: nil, photo: [], creationDate: 0, version: 0, participationStatus: .member, info: .group(.init(flags: [])), flags: [], restrictionInfo: nil, adminRights: nil, bannedRights: nil, defaultBannedRights: nil) + let peer3Author = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: 4), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_3_AuthorName, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer4 = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: 4), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_4_Name, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer5 = TelegramChannel(id: PeerId(namespace: Namespaces.Peer.CloudChannel, id: 5), accessHash: nil, title: self.presentationData.strings.Appearance_ThemePreview_ChatList_5_Name, username: nil, photo: [], creationDate: 0, version: 0, participationStatus: .member, info: .broadcast(.init(flags: [])), flags: [], restrictionInfo: nil, adminRights: nil, bannedRights: nil, defaultBannedRights: nil) + let peer6 = TelegramUser(id: PeerId(namespace: Namespaces.Peer.SecretChat, id: 5), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_6_Name, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + let peer7 = TelegramUser(id: PeerId(namespace: Namespaces.Peer.CloudUser, id: 6), accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_ChatList_7_Name, lastName: nil, username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + + let timestamp = self.referenceTimestamp + + let timestamp1 = timestamp + 120 + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: 0, messageIndex: MessageIndex(id: MessageId(peerId: peer1.id, namespace: 0, id: 0), timestamp: timestamp1)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer1.id, namespace: 0, id: 0), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp1, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: selfPeer, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_1_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer1), combinedReadState: CombinedPeerReadState(states: [(Namespaces.Message.Cloud, PeerReadState.idBased(maxIncomingReadId: 0, maxOutgoingReadId: 0, maxKnownId: 0, count: 0, markedUnread: false))]), notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + let presenceTimestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970 + 60 * 60) + let timestamp2 = timestamp + 3660 + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer2.id, namespace: 0, id: 0), timestamp: timestamp2)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer2.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp2, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer2, text: "", attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer2), combinedReadState: nil, notificationSettings: nil, presence: TelegramUserPresence(status: .present(until: presenceTimestamp), lastActivity: presenceTimestamp), summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: [(peer2, .typingText)], isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + let timestamp3 = timestamp + 3200 + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer3.id, namespace: 0, id: 0), timestamp: timestamp3)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer3.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp3, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer3Author, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_3_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer3), combinedReadState: nil, notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + let timestamp4 = timestamp + 3000 + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer4.id, namespace: 0, id: 0), timestamp: timestamp4)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer4.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp4, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer4, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_4_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer4), combinedReadState: nil, notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + let timestamp5 = timestamp + 1000 + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer5.id, namespace: 0, id: 0), timestamp: timestamp5)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer4.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp5, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer5, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_5_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer5), combinedReadState: nil, notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer6.id, namespace: 0, id: 0), timestamp: timestamp - 360)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer6.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp - 360, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer6, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_6_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer6), combinedReadState: CombinedPeerReadState(states: [(Namespaces.Message.Cloud, PeerReadState.idBased(maxIncomingReadId: 0, maxOutgoingReadId: 0, maxKnownId: 0, count: 1, markedUnread: false))]), notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + items.append(ChatListItem(presentationData: chatListPresentationData, context: self.context, peerGroupId: .root, index: ChatListIndex(pinningIndex: nil, messageIndex: MessageIndex(id: MessageId(peerId: peer7.id, namespace: 0, id: 0), timestamp: timestamp - 420)), content: .peer(message: Message(stableId: 0, stableVersion: 0, id: MessageId(peerId: peer7.id, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: timestamp - 420, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peer6, text: self.presentationData.strings.Appearance_ThemePreview_ChatList_7_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []), peer: RenderedPeer(peer: peer7), combinedReadState: nil, notificationSettings: nil, presence: nil, summaryInfo: ChatListMessageTagSummaryInfo(tagSummaryCount: nil, actionsSummaryCount: nil), embeddedState: nil, inputActivities: nil, isAd: false, ignoreUnreadBadge: false, displayAsMessage: false), editing: false, hasActiveRevealControls: false, selected: false, header: nil, enableContextActions: false, hiddenOffset: false, interaction: interaction)) + + let width: CGFloat + if case .regular = layout.metrics.widthClass { + width = layout.size.width / 2.0 + } else { + width = layout.size.width + } + + let params = ListViewItemLayoutParams(width: width, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, availableHeight: layout.size.height) + if let chatNodes = self.chatNodes { + for i in 0 ..< items.count { + let itemNode = chatNodes[i] + items[i].updateNode(async: { $0() }, node: { + return itemNode + }, params: params, previousItem: i == 0 ? nil : items[i - 1], nextItem: i == (items.count - 1) ? nil : items[i + 1], animation: .None, completion: { (layout, apply) in + let nodeFrame = CGRect(origin: itemNode.frame.origin, size: CGSize(width: width, height: layout.size.height)) + + itemNode.contentSize = layout.contentSize + itemNode.insets = layout.insets + itemNode.frame = nodeFrame + itemNode.isUserInteractionEnabled = false + + apply(ListViewItemApply(isOnScreen: true)) + }) + } + } else { + var chatNodes: [ListViewItemNode] = [] + for i in 0 ..< items.count { + var itemNode: ListViewItemNode? + items[i].nodeConfiguredForParams(async: { $0() }, params: params, synchronousLoads: false, previousItem: i == 0 ? nil : items[i - 1], nextItem: i == (items.count - 1) ? nil : items[i + 1], completion: { node, apply in + itemNode = node + apply().1(ListViewItemApply(isOnScreen: true)) + }) + itemNode!.isUserInteractionEnabled = false + chatNodes.append(itemNode!) + if self.maskNode.supernode != nil { + self.chatListBackgroundNode.insertSubnode(itemNode!, belowSubnode: self.maskNode) + } else { + self.chatListBackgroundNode.addSubnode(itemNode!) + } + } + self.chatNodes = chatNodes + } + + if let chatNodes = self.chatNodes { + var topOffset: CGFloat = topInset + for itemNode in chatNodes { + transition.updateFrame(node: itemNode, frame: CGRect(origin: CGPoint(x: 0.0, y: topOffset), size: itemNode.frame.size)) + topOffset += itemNode.frame.height + } + } + } + + private func updateMessagesLayout(layout: ContainerViewLayout, bottomInset: CGFloat, transition: ContainedViewLayoutTransition) { + let headerItem = self.context.sharedContext.makeChatMessageDateHeaderItem(context: self.context, timestamp: self.referenceTimestamp, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.chatWallpaper, fontSize: self.presentationData.fontSize, dateTimeFormat: self.presentationData.dateTimeFormat, nameOrder: self.presentationData.nameDisplayOrder) + + var items: [ListViewItem] = [] + let peerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: 1) + let otherPeerId = self.context.account.peerId + var peers = SimpleDictionary() + var messages = SimpleDictionary() + peers[peerId] = TelegramUser(id: peerId, accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_Chat_2_ReplyName, lastName: "", username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + peers[otherPeerId] = TelegramUser(id: otherPeerId, accessHash: nil, firstName: self.presentationData.strings.Appearance_ThemePreview_Chat_2_ReplyName, lastName: "", username: nil, phone: nil, photo: [], botInfo: nil, restrictionInfo: nil, flags: []) + + let replyMessageId = MessageId(peerId: peerId, namespace: 0, id: 3) + messages[replyMessageId] = Message(stableId: 3, stableVersion: 0, id: replyMessageId, globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: 66000, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peers[otherPeerId], text: self.presentationData.strings.Appearance_ThemePreview_Chat_1_Text, attributes: [], media: [], peers: peers, associatedMessages: SimpleDictionary(), associatedMessageIds: []) + + let message1 = Message(stableId: 4, stableVersion: 0, id: MessageId(peerId: otherPeerId, namespace: 0, id: 4), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: 66003, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peers[otherPeerId], text: self.presentationData.strings.Appearance_ThemePreview_Chat_3_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []) + items.append(self.context.sharedContext.makeChatMessagePreviewItem(context: self.context, message: message1, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.theme.chat.defaultWallpaper, fontSize: self.presentationData.fontSize, dateTimeFormat: self.presentationData.dateTimeFormat, nameOrder: self.presentationData.nameDisplayOrder, forcedResourceStatus: nil)) + + let message2 = Message(stableId: 3, stableVersion: 0, id: MessageId(peerId: peerId, namespace: 0, id: 3), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: 66002, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peers[peerId], text: self.presentationData.strings.Appearance_ThemePreview_Chat_2_Text, attributes: [ReplyMessageAttribute(messageId: replyMessageId)], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []) + items.append(self.context.sharedContext.makeChatMessagePreviewItem(context: self.context, message: message2, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.theme.chat.defaultWallpaper, fontSize: self.presentationData.fontSize, dateTimeFormat: self.presentationData.dateTimeFormat, nameOrder: self.presentationData.nameDisplayOrder, forcedResourceStatus: nil)) + + let waveformBase64 = "DAAOAAkACQAGAAwADwAMABAADQAPABsAGAALAA0AGAAfABoAHgATABgAGQAYABQADAAVABEAHwANAA0ACQAWABkACQAOAAwACQAfAAAAGQAVAAAAEwATAAAACAAfAAAAHAAAABwAHwAAABcAGQAAABQADgAAABQAHwAAAB8AHwAAAAwADwAAAB8AEwAAABoAFwAAAB8AFAAAAAAAHwAAAAAAHgAAAAAAHwAAAAAAHwAAAAAAHwAAAAAAHwAAAAAAHwAAAAAAAAA=" + let voiceAttributes: [TelegramMediaFileAttribute] = [.Audio(isVoice: true, duration: 23, title: nil, performer: nil, waveform: MemoryBuffer(data: Data(base64Encoded: waveformBase64)!))] + let voiceMedia = TelegramMediaFile(fileId: MediaId(namespace: 0, id: 0), partialReference: nil, resource: LocalFileMediaResource(fileId: 0), previewRepresentations: [], immediateThumbnailData: nil, mimeType: "audio/ogg", size: 0, attributes: voiceAttributes) + + let message3 = Message(stableId: 1, stableVersion: 0, id: MessageId(peerId: peerId, namespace: 0, id: 1), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: 66001, flags: [.Incoming], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peers[peerId], text: "", attributes: [], media: [voiceMedia], peers: peers, associatedMessages: messages, associatedMessageIds: []) + items.append(self.context.sharedContext.makeChatMessagePreviewItem(context: self.context, message: message3, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.theme.chat.defaultWallpaper, fontSize: self.presentationData.fontSize, dateTimeFormat: self.presentationData.dateTimeFormat, nameOrder: self.presentationData.nameDisplayOrder, forcedResourceStatus: FileMediaResourceStatus(mediaStatus: .playbackStatus(.paused), fetchStatus: .Local))) + + let message4 = Message(stableId: 2, stableVersion: 0, id: MessageId(peerId: otherPeerId, namespace: 0, id: 2), globallyUniqueId: nil, groupingKey: nil, groupInfo: nil, timestamp: 66001, flags: [], tags: [], globalTags: [], localTags: [], forwardInfo: nil, author: peers[otherPeerId], text: self.presentationData.strings.Appearance_ThemePreview_Chat_1_Text, attributes: [], media: [], peers: peers, associatedMessages: messages, associatedMessageIds: []) + items.append(self.context.sharedContext.makeChatMessagePreviewItem(context: self.context, message: message4, theme: self.presentationData.theme, strings: self.presentationData.strings, wallpaper: self.presentationData.theme.chat.defaultWallpaper, fontSize: self.presentationData.fontSize, dateTimeFormat: self.presentationData.dateTimeFormat, nameOrder: self.presentationData.nameDisplayOrder, forcedResourceStatus: nil)) + + let width: CGFloat + if case .regular = layout.metrics.widthClass { + width = layout.size.width / 2.0 + } else { + width = layout.size.width + } + + let params = ListViewItemLayoutParams(width: width, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right, availableHeight: layout.size.height) + if let messageNodes = self.messageNodes { + for i in 0 ..< items.count { + let itemNode = messageNodes[i] + items[i].updateNode(async: { $0() }, node: { + return itemNode + }, params: params, previousItem: i == 0 ? nil : items[i - 1], nextItem: i == (items.count - 1) ? nil : items[i + 1], animation: .None, completion: { (layout, apply) in + let nodeFrame = CGRect(origin: itemNode.frame.origin, size: CGSize(width: width, height: layout.size.height)) + + itemNode.contentSize = layout.contentSize + itemNode.insets = layout.insets + itemNode.frame = nodeFrame + itemNode.isUserInteractionEnabled = false + + apply(ListViewItemApply(isOnScreen: true)) + }) + } + } else { + var messageNodes: [ListViewItemNode] = [] + for i in 0 ..< items.count { + var itemNode: ListViewItemNode? + items[i].nodeConfiguredForParams(async: { $0() }, params: params, synchronousLoads: false, previousItem: i == 0 ? nil : items[i - 1], nextItem: i == (items.count - 1) ? nil : items[i + 1], completion: { node, apply in + itemNode = node + apply().1(ListViewItemApply(isOnScreen: true)) + }) + itemNode!.subnodeTransform = CATransform3DMakeScale(-1.0, 1.0, 1.0) + itemNode!.isUserInteractionEnabled = false + messageNodes.append(itemNode!) + self.messagesContainerNode.addSubnode(itemNode!) + } + self.messageNodes = messageNodes + } + + var bottomOffset: CGFloat = 9.0 + bottomInset + if let messageNodes = self.messageNodes { + for itemNode in messageNodes { + transition.updateFrame(node: itemNode, frame: CGRect(origin: CGPoint(x: 0.0, y: bottomOffset), size: itemNode.frame.size)) + bottomOffset += itemNode.frame.height + itemNode.updateFrame(itemNode.frame, within: layout.size) + } + } + + let dateHeaderNode: ListViewItemHeaderNode + if let currentDateHeaderNode = self.dateHeaderNode { + dateHeaderNode = currentDateHeaderNode + headerItem.updateNode(dateHeaderNode, previous: nil, next: headerItem) + } else { + dateHeaderNode = headerItem.node() + dateHeaderNode.subnodeTransform = CATransform3DMakeScale(-1.0, 1.0, 1.0) + //self.messagesContainerNode.addSubnode(dateHeaderNode) + self.dateHeaderNode = dateHeaderNode + } + + transition.updateFrame(node: dateHeaderNode, frame: CGRect(origin: CGPoint(x: 0.0, y: bottomOffset), size: CGSize(width: layout.size.width, height: headerItem.height))) + dateHeaderNode.updateLayout(size: self.messagesContainerNode.frame.size, leftInset: layout.safeInsets.left, rightInset: layout.safeInsets.right) + } + + func updatePresentationThemeSettings(_ presentationThemeSettings: PresentationThemeSettings) { + let fontSize: PresentationFontSize + if presentationThemeSettings.useSystemFont { + let pointSize = UIFont.preferredFont(forTextStyle: .body).pointSize + fontSize = PresentationFontSize(systemFontSize: pointSize) + } else { + fontSize = presentationThemeSettings.fontSize + } + self.presentationData = self.presentationData.withFontSize(fontSize) + self.toolbarNode.updatePresentationData(presentationData: self.presentationData) + self.toolbarNode.updatePresentationThemeSettings(presentationThemeSettings: self.presentationThemeSettings) + if let (layout, navigationBarHeight) = self.validLayout { + self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate) + } + } + + func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { + self.validLayout = (layout, navigationBarHeight) + + let bounds = CGRect(origin: CGPoint(), size: layout.size) + self.scrollNode.frame = bounds + + let toolbarHeight = self.toolbarNode.updateLayout(width: layout.size.width, bottomInset: layout.intrinsicInsets.bottom, layout: layout, transition: transition) + + self.chatListBackgroundNode.frame = CGRect(x: bounds.width, y: 0.0, width: bounds.width, height: bounds.height) + self.chatContainerNode.frame = CGRect(x: 0.0, y: 0.0, width: bounds.width, height: bounds.height) + + let bottomInset: CGFloat + if case .regular = layout.metrics.widthClass { + self.chatListBackgroundNode.frame = CGRect(x: 0.0, y: 0.0, width: bounds.width / 2.0, height: bounds.height) + self.chatContainerNode.frame = CGRect(x: bounds.width / 2.0, y: 0.0, width: bounds.width / 2.0, height: bounds.height) + self.scrollNode.view.contentSize = CGSize(width: bounds.width, height: bounds.height) + + self.pageControlNode.isHidden = true + self.pageControlBackgroundNode.isHidden = true + self.separatorNode.isHidden = false + + self.separatorNode.frame = CGRect(x: bounds.width / 2.0, y: 0.0, width: UIScreenPixel, height: bounds.height - toolbarHeight) + + bottomInset = 0.0 + } else { + self.chatListBackgroundNode.frame = CGRect(x: bounds.width, y: 0.0, width: bounds.width, height: bounds.height) + self.chatContainerNode.frame = CGRect(x: 0.0, y: 0.0, width: bounds.width, height: bounds.height) + self.scrollNode.view.contentSize = CGSize(width: bounds.width * 2.0, height: bounds.height) + + self.pageControlNode.isHidden = false + self.pageControlBackgroundNode.isHidden = false + self.separatorNode.isHidden = true + + bottomInset = 66.0 + } + + self.messagesContainerNode.frame = self.chatContainerNode.bounds + self.instantChatBackgroundNode.frame = self.chatContainerNode.bounds + self.remoteChatBackgroundNode.frame = self.chatContainerNode.bounds + self.blurredNode.frame = self.chatContainerNode.bounds + + transition.updateFrame(node: self.toolbarNode, frame: CGRect(origin: CGPoint(x: 0.0, y: layout.size.height - toolbarHeight), size: CGSize(width: layout.size.width, height: toolbarHeight + layout.intrinsicInsets.bottom))) + + self.updateChatsLayout(layout: layout, topInset: navigationBarHeight, transition: transition) + self.updateMessagesLayout(layout: layout, bottomInset: toolbarHeight + bottomInset, transition: transition) + + let pageControlSize = self.pageControlNode.measure(CGSize(width: bounds.width, height: 100.0)) + let pageControlFrame = CGRect(origin: CGPoint(x: floor((bounds.width - pageControlSize.width) / 2.0), y: layout.size.height - toolbarHeight - 42.0), size: pageControlSize) + self.pageControlNode.frame = pageControlFrame + self.pageControlBackgroundNode.frame = CGRect(x: pageControlFrame.minX - 7.0, y: pageControlFrame.minY - 7.0, width: pageControlFrame.width + 14.0, height: 21.0) + transition.updateFrame(node: self.maskNode, frame: CGRect(x: 0.0, y: layout.size.height - toolbarHeight - 80.0, width: bounds.width, height: 80.0)) + } +} + +final class TextSizeSelectionController: ViewController { + private let context: AccountContext + + private var controllerNode: TextSizeSelectionControllerNode { + return self.displayNode as! TextSizeSelectionControllerNode + } + + private var didPlayPresentationAnimation = false + + private var presentationData: PresentationData + private var presentationDataDisposable: Disposable? + + private var presentationThemeSettings: PresentationThemeSettings + private var presentationThemeSettingsDisposable: Disposable? + + private var disposable: Disposable? + private var applyDisposable = MetaDisposable() + + public init(context: AccountContext, presentationThemeSettings: PresentationThemeSettings) { + self.context = context + + self.presentationData = context.sharedContext.currentPresentationData.with { $0 } + self.presentationThemeSettings = presentationThemeSettings + + super.init(navigationBarPresentationData: NavigationBarPresentationData(presentationTheme: self.presentationData.theme, presentationStrings: self.presentationData.strings)) + + self.blocksBackgroundWhenInOverlay = true + self.navigationPresentation = .modal + + self.navigationItem.title = self.presentationData.strings.Appearance_TextSize_Title + self.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: UIView()) + + self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style + self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait) + + self.presentationDataDisposable = (context.sharedContext.presentationData + |> deliverOnMainQueue).start(next: { [weak self] presentationData in + if let strongSelf = self { + strongSelf.presentationData = presentationData + } + }) + } + + required public init(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + deinit { + self.presentationDataDisposable?.dispose() + self.presentationThemeSettingsDisposable?.dispose() + self.disposable?.dispose() + self.applyDisposable.dispose() + } + + override public func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + if let presentationArguments = self.presentationArguments as? ViewControllerPresentationArguments, !self.didPlayPresentationAnimation { + self.didPlayPresentationAnimation = true + if case .modalSheet = presentationArguments.presentationAnimation { + self.controllerNode.animateIn() + } + } + } + + override public func loadDisplayNode() { + super.loadDisplayNode() + + self.displayNode = TextSizeSelectionControllerNode(context: self.context, presentationThemeSettings: self.presentationThemeSettings, dismiss: { [weak self] in + if let strongSelf = self { + strongSelf.dismiss() + } + }, apply: { [weak self] useSystemFont, fontSize in + if let strongSelf = self { + strongSelf.apply(useSystemFont: useSystemFont, fontSize: fontSize) + } + }) + self.displayNodeDidLoad() + } + + private func apply(useSystemFont: Bool, fontSize: PresentationFontSize) { + let _ = (updatePresentationThemeSettingsInteractively(accountManager: self.context.sharedContext.accountManager, { current in + var current = current + current.useSystemFont = useSystemFont + current.fontSize = fontSize + return current + }) + |> deliverOnMainQueue).start(completed: { [weak self] in + self?.dismiss() + }) + } + + override public func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) { + super.containerLayoutUpdated(layout, transition: transition) + + self.controllerNode.containerLayoutUpdated(layout, navigationBarHeight: self.navigationHeight, transition: transition) + } +} + +private final class TextSelectionToolbarNode: ASDisplayNode { + private var presentationThemeSettings: PresentationThemeSettings + private var presentationData: PresentationData + + private let cancelButton = HighlightableButtonNode() + private let doneButton = HighlightableButtonNode() + private let separatorNode = ASDisplayNode() + private let topSeparatorNode = ASDisplayNode() + + private var switchItemNode: ItemListSwitchItemNode + private var fontSizeItemNode: ThemeSettingsFontSizeItemNode + + var cancel: (() -> Void)? + var done: (() -> Void)? + + var updateUseSystemFont: ((Bool) -> Void)? + var updateCustomFontSize: ((PresentationFontSize) -> Void)? + + init(presentationThemeSettings: PresentationThemeSettings, presentationData: PresentationData) { + self.presentationThemeSettings = presentationThemeSettings + self.presentationData = presentationData + + self.switchItemNode = ItemListSwitchItemNode(type: .regular) + self.fontSizeItemNode = ThemeSettingsFontSizeItemNode() + + super.init() + + self.addSubnode(self.switchItemNode) + self.addSubnode(self.fontSizeItemNode) + self.addSubnode(self.cancelButton) + self.addSubnode(self.doneButton) + self.addSubnode(self.separatorNode) + self.addSubnode(self.topSeparatorNode) + + self.updatePresentationData(presentationData: self.presentationData) + + self.cancelButton.highligthedChanged = { [weak self] highlighted in + if let strongSelf = self { + if highlighted { + strongSelf.cancelButton.backgroundColor = strongSelf.presentationData.theme.list.itemHighlightedBackgroundColor + } else { + UIView.animate(withDuration: 0.3, animations: { + strongSelf.cancelButton.backgroundColor = .clear + }) + } + } + } + + self.doneButton.highligthedChanged = { [weak self] highlighted in + if let strongSelf = self { + if highlighted { + strongSelf.doneButton.backgroundColor = strongSelf.presentationData.theme.list.itemHighlightedBackgroundColor + } else { + UIView.animate(withDuration: 0.3, animations: { + strongSelf.doneButton.backgroundColor = .clear + }) + } + } + } + + self.cancelButton.addTarget(self, action: #selector(self.cancelPressed), forControlEvents: .touchUpInside) + self.doneButton.addTarget(self, action: #selector(self.donePressed), forControlEvents: .touchUpInside) + } + + func setDoneEnabled(_ enabled: Bool) { + self.doneButton.alpha = enabled ? 1.0 : 0.4 + self.doneButton.isUserInteractionEnabled = enabled + } + + func updatePresentationData(presentationData: PresentationData) { + self.backgroundColor = presentationData.theme.rootController.tabBar.backgroundColor + self.separatorNode.backgroundColor = presentationData.theme.rootController.tabBar.separatorColor + self.topSeparatorNode.backgroundColor = presentationData.theme.rootController.tabBar.separatorColor + + self.cancelButton.setTitle(presentationData.strings.Common_Cancel, with: Font.regular(17.0), with: presentationData.theme.list.itemPrimaryTextColor, for: []) + self.doneButton.setTitle(presentationData.strings.Wallpaper_Set, with: Font.regular(17.0), with: presentationData.theme.list.itemPrimaryTextColor, for: []) + } + + func updatePresentationThemeSettings(presentationThemeSettings: PresentationThemeSettings) { + self.presentationThemeSettings = presentationThemeSettings + } + + func updateLayout(width: CGFloat, bottomInset: CGFloat, layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) -> CGFloat { + var contentHeight: CGFloat = 0.0 + + let switchItem = ItemListSwitchItem(presentationData: ItemListPresentationData(self.presentationData), title: self.presentationData.strings.Appearance_TextSize_UseSystem, value: self.presentationThemeSettings.useSystemFont, disableLeadingInset: true, sectionId: 0, style: .blocks, updated: { [weak self] value in + self?.updateUseSystemFont?(value) + }) + let fontSizeItem = ThemeSettingsFontSizeItem(theme: self.presentationData.theme, fontSize: self.presentationThemeSettings.fontSize, enabled: !self.presentationThemeSettings.useSystemFont, disableLeadingInset: true, sectionId: 0, updated: { [weak self] value in + self?.updateCustomFontSize?(value) + }) + + switchItem.updateNode(async: { f in + f() + }, node: { + return self.switchItemNode + }, params: ListViewItemLayoutParams(width: width, leftInset: layout.intrinsicInsets.left, rightInset: layout.intrinsicInsets.right, availableHeight: 1000.0), previousItem: nil, nextItem: fontSizeItem, animation: .None, completion: { layout, apply in + self.switchItemNode.contentSize = layout.contentSize + self.switchItemNode.insets = layout.insets + transition.updateFrame(node: self.switchItemNode, frame: CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: layout.contentSize)) + contentHeight += layout.contentSize.height + apply(ListViewItemApply(isOnScreen: true)) + }) + + fontSizeItem.updateNode(async: { f in + f() + }, node: { + return self.fontSizeItemNode + }, params: ListViewItemLayoutParams(width: width, leftInset: layout.intrinsicInsets.left, rightInset: layout.intrinsicInsets.right, availableHeight: 1000.0), previousItem: switchItem, nextItem: nil, animation: .None, completion: { layout, apply in + self.fontSizeItemNode.contentSize = layout.contentSize + self.fontSizeItemNode.insets = layout.insets + transition.updateFrame(node: self.fontSizeItemNode, frame: CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: layout.contentSize)) + contentHeight += layout.contentSize.height + apply(ListViewItemApply(isOnScreen: true)) + }) + + self.cancelButton.frame = CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: CGSize(width: floor(width / 2.0), height: 49.0)) + self.doneButton.frame = CGRect(origin: CGPoint(x: floor(width / 2.0), y: contentHeight), size: CGSize(width: width - floor(width / 2.0), height: 49.0)) + + contentHeight += 49.0 + + self.topSeparatorNode.frame = CGRect(origin: CGPoint(), size: CGSize(width: width, height: UIScreenPixel)) + + let resultHeight = contentHeight + bottomInset + + self.separatorNode.frame = CGRect(origin: CGPoint(x: floor(width / 2.0), y: self.cancelButton.frame.minY), size: CGSize(width: UIScreenPixel, height: resultHeight - self.cancelButton.frame.minY)) + + return resultHeight + } + + @objc func cancelPressed() { + self.cancel?() + } + + @objc func donePressed() { + self.doneButton.isUserInteractionEnabled = false + self.done?() + } +} diff --git a/submodules/SettingsUI/Sources/Themes/CustomWallpaperPicker.swift b/submodules/SettingsUI/Sources/Themes/CustomWallpaperPicker.swift index 99e4b70c23..a09ac63161 100644 --- a/submodules/SettingsUI/Sources/Themes/CustomWallpaperPicker.swift +++ b/submodules/SettingsUI/Sources/Themes/CustomWallpaperPicker.swift @@ -161,7 +161,7 @@ func uploadCustomWallpaper(context: AccountContext, wallpaper: WallpaperGalleryE } else { themeSpecificChatWallpapers[current.theme.index] = wallpaper } - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) })).start() } diff --git a/submodules/SettingsUI/Sources/Themes/EditThemeController.swift b/submodules/SettingsUI/Sources/Themes/EditThemeController.swift index 45bdcd0ae4..f2be76d04b 100644 --- a/submodules/SettingsUI/Sources/Themes/EditThemeController.swift +++ b/submodules/SettingsUI/Sources/Themes/EditThemeController.swift @@ -133,11 +133,11 @@ private enum EditThemeControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! EditThemeControllerArguments switch self { case let .title(theme, strings, title, text, _): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(), text: text, placeholder: title, type: .regular(capitalization: true, autocorrection: false), returnKeyType: .default, clearType: .onFocus, tag: EditThemeEntryTag.title, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(), text: text, placeholder: title, type: .regular(capitalization: true, autocorrection: false), returnKeyType: .default, clearType: .onFocus, tag: EditThemeEntryTag.title, sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.title = value @@ -147,7 +147,7 @@ private enum EditThemeControllerEntry: ItemListNodeEntry { }) case let .slug(theme, strings, title, text, enabled): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: "t.me/addtheme/", textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: title, type: .username, clearType: .onFocus, enabled: enabled, tag: EditThemeEntryTag.slug, sectionId: self.section, textUpdated: { value in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: "t.me/addtheme/", textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: title, type: .username, clearType: .onFocus, enabled: enabled, tag: EditThemeEntryTag.slug, sectionId: self.section, textUpdated: { value in arguments.updateState { current in var state = current state.slug = value @@ -157,17 +157,17 @@ private enum EditThemeControllerEntry: ItemListNodeEntry { }) case let .slugInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) case let .chatPreviewHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .chatPreview(theme, componentTheme, wallpaper, fontSize, strings, dateTimeFormat, nameDisplayOrder, items): return ThemeSettingsChatPreviewItem(context: arguments.context, theme: theme, componentTheme: componentTheme, strings: strings, sectionId: self.section, fontSize: fontSize, wallpaper: wallpaper, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, messageItems: items) case let .uploadTheme(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: self.section, style: .blocks, action: { arguments.openFile() }) case let .uploadInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section) } } } @@ -468,7 +468,7 @@ public func editThemeController(context: AccountContext, mode: EditThemeControll var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers themeSpecificChatWallpapers[themeReference.index] = nil - return PresentationThemeSettings(theme: themeReference, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: themeReference, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) } |> deliverOnMainQueue).start(completed: { if !hasCustomFile { @@ -509,7 +509,7 @@ public func editThemeController(context: AccountContext, mode: EditThemeControll var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers themeSpecificChatWallpapers[themeReference.index] = nil - return PresentationThemeSettings(theme: themeReference, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: themeReference, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) } |> deliverOnMainQueue).start(completed: { if let themeResource = themeResource, !hasCustomFile { @@ -558,8 +558,8 @@ public func editThemeController(context: AccountContext, mode: EditThemeControll title = presentationData.strings.EditTheme_EditTitle } } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: editThemeControllerEntries(presentationData: presentationData, state: state, previewTheme: previewTheme), style: .blocks, focusItemTag: focusItemTag, emptyStateItem: nil, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: editThemeControllerEntries(presentationData: presentationData, state: state, previewTheme: previewTheme), style: .blocks, focusItemTag: focusItemTag, emptyStateItem: nil, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorController.swift b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorController.swift index adee6fb334..302d7adcae 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorController.swift @@ -131,7 +131,7 @@ final class ThemeAccentColorController: ViewController { } themeSpecificBubbleColors[currentTheme.index] = bubbleColors - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) |> deliverOnMainQueue).start(completed: { [weak self] in if let strongSelf = self { strongSelf.completion?() diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift index 80f45f0006..0253e3fb73 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAccentColorControllerNode.swift @@ -418,7 +418,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, UIScrollViewDelegate let interaction = ChatListNodeInteraction(activateSearch: {}, peerSelected: { _ in }, togglePeerSelected: { _ in }, messageSelected: { _, _, _ in}, groupSelected: { _ in }, addContact: { _ in }, setPeerIdWithRevealedOptions: { _, _ in }, setItemPinned: { _, _ in }, setPeerMuted: { _, _ in }, deletePeer: { _ in }, updatePeerGrouping: { _, _ in }, togglePeerMarkedUnread: { _, _ in}, toggleArchivedFolderHiddenByDefault: {}, activateChatPreview: { _, _, gesture in gesture?.cancel() }) - let chatListPresentationData = ChatListPresentationData(theme: self.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true) + let chatListPresentationData = ChatListPresentationData(theme: self.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true) let peers = SimpleDictionary() let messages = SimpleDictionary() diff --git a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightSettingsController.swift b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightSettingsController.swift index a13fb426e2..0927cc29ca 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeAutoNightSettingsController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeAutoNightSettingsController.swift @@ -199,41 +199,41 @@ private enum ThemeAutoNightSettingsControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ThemeAutoNightSettingsControllerArguments switch self { case let .modeSystem(theme, title, value): - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateMode(.system) }) case let .modeDisabled(theme, title, value): - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateMode(.none) }) case let .modeTimeBased(theme, title, value): - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateMode(.timeBased) }) case let .modeBrightness(theme, title, value): - return ItemListCheckboxItem(theme: theme, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: title, style: .left, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.updateMode(.brightness) }) case let .settingsHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .timeBasedAutomaticLocation(theme, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.updateTimeBasedAutomatic(value) }) case let .timeBasedAutomaticLocationValue(theme, title, value): - return ItemListDisclosureItem(theme: theme, icon: nil, title: title, titleColor: .accent, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: nil, title: title, titleColor: .accent, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: { arguments.updateTimeBasedAutomaticLocation() }) case let .timeBasedManualFrom(theme, title, value): - return ItemListDisclosureItem(theme: theme, icon: nil, title: title, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: nil, title: title, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openTimeBasedManual(.from) }) case let .timeBasedManualTo(theme, title, value): - return ItemListDisclosureItem(theme: theme, icon: nil, title: title, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: nil, title: title, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openTimeBasedManual(.to) }) case let .brightnessValue(theme, value): @@ -241,9 +241,9 @@ private enum ThemeAutoNightSettingsControllerEntry: ItemListNodeEntry { arguments.updateAutomaticBrightness(Double(value) / 100.0) }) case let .settingInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .themeHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .themeItem(theme, strings, themes, currentTheme, themeSpecificAccentColors, themeSpecificBubbleColors): return ThemeSettingsThemeItem(context: arguments.context, theme: theme, strings: strings, sectionId: self.section, themes: themes, displayUnsupported: false, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: themeSpecificBubbleColors, currentTheme: currentTheme, updatedTheme: { theme in arguments.updateTheme(theme) @@ -568,8 +568,8 @@ public func themeAutoNightSettingsController(context: AccountContext) -> ViewCon var availableThemes = defaultThemes availableThemes.append(contentsOf: cloudThemes) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.AutoNightTheme_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: themeAutoNightSettingsControllerEntries(theme: presentationData.theme, strings: presentationData.strings, settings: settings, switchSetting: stagingSettings ?? settings.automaticThemeSwitchSetting, availableThemes: availableThemes, dateTimeFormat: presentationData.dateTimeFormat), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.AutoNightTheme_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: themeAutoNightSettingsControllerEntries(theme: presentationData.theme, strings: presentationData.strings, settings: settings, switchSetting: stagingSettings ?? settings.automaticThemeSwitchSetting, availableThemes: availableThemes, dateTimeFormat: presentationData.dateTimeFormat), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/SettingsUI/Sources/Themes/ThemeColorsGridControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemeColorsGridControllerNode.swift index a4274e606c..1fa545df18 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeColorsGridControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeColorsGridControllerNode.swift @@ -108,7 +108,7 @@ final class ThemeColorsGridControllerNode: ASDisplayNode { self.separatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor self.customColorItemNode = ItemListActionItemNode() - self.customColorItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.WallpaperColors_SetCustomColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { + self.customColorItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.WallpaperColors_SetCustomColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { presentColorPicker() }) @@ -221,7 +221,7 @@ final class ThemeColorsGridControllerNode: ASDisplayNode { self.leftOverlayNode.backgroundColor = presentationData.theme.list.blocksBackgroundColor self.rightOverlayNode.backgroundColor = presentationData.theme.list.blocksBackgroundColor - self.customColorItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.WallpaperColors_SetCustomColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in + self.customColorItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.WallpaperColors_SetCustomColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in self?.presentColorPicker() }) diff --git a/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift b/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift index 55e466dc6b..e122d3961f 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift @@ -183,7 +183,7 @@ final class ThemeGridController: ViewController { let _ = (updatePresentationThemeSettingsInteractively(accountManager: strongSelf.context.sharedContext.accountManager, { current in var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers themeSpecificChatWallpapers[current.theme.index] = nil - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) })).start() break } @@ -243,7 +243,7 @@ final class ThemeGridController: ViewController { } var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers themeSpecificChatWallpapers[current.theme.index] = nil - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: [:], fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: [:], useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) }).start() diff --git a/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift index 387770511e..2e878518cc 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeGridControllerNode.swift @@ -276,21 +276,21 @@ final class ThemeGridControllerNode: ASDisplayNode { self.bottomSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor self.colorItemNode = ItemListActionItemNode() - self.colorItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_SetColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { + self.colorItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_SetColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { presentColors() }) self.galleryItemNode = ItemListActionItemNode() - self.galleryItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_SetCustomBackground, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { + self.galleryItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_SetCustomBackground, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { presentGallery() }) self.descriptionItemNode = ItemListTextItemNode() - self.descriptionItem = ItemListTextItem(theme: presentationData.theme, text: .plain(presentationData.strings.Wallpaper_SetCustomBackgroundInfo), sectionId: 0) + self.descriptionItem = ItemListTextItem(presentationData: ItemListPresentationData(presentationData), text: .plain(presentationData.strings.Wallpaper_SetCustomBackgroundInfo), sectionId: 0) self.resetItemNode = ItemListActionItemNode() - self.resetItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_ResetWallpapers, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { + self.resetItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_ResetWallpapers, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { resetWallpapers() }) self.resetDescriptionItemNode = ItemListTextItemNode() - self.resetDescriptionItem = ItemListTextItem(theme: presentationData.theme, text: .plain(presentationData.strings.Wallpaper_ResetWallpapersInfo), sectionId: 0) + self.resetDescriptionItem = ItemListTextItem(presentationData: ItemListPresentationData(presentationData), text: .plain(presentationData.strings.Wallpaper_ResetWallpapersInfo), sectionId: 0) self.currentState = ThemeGridControllerNodeState(editing: false, selectedIndices: Set()) self.statePromise = ValuePromise(self.currentState, ignoreRepeated: true) @@ -541,17 +541,17 @@ final class ThemeGridControllerNode: ASDisplayNode { self.bottomBackgroundNode.backgroundColor = presentationData.theme.list.blocksBackgroundColor self.bottomSeparatorNode.backgroundColor = presentationData.theme.list.itemBlocksSeparatorColor - self.colorItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_SetColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in + self.colorItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_SetColor, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in self?.presentColors() }) - self.galleryItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_SetCustomBackground, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in + self.galleryItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_SetCustomBackground, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in self?.presentGallery() }) - self.descriptionItem = ItemListTextItem(theme: presentationData.theme, text: .plain(presentationData.strings.Wallpaper_SetCustomBackgroundInfo), sectionId: 0) - self.resetItem = ItemListActionItem(theme: presentationData.theme, title: presentationData.strings.Wallpaper_ResetWallpapers, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in + self.descriptionItem = ItemListTextItem(presentationData: ItemListPresentationData(presentationData), text: .plain(presentationData.strings.Wallpaper_SetCustomBackgroundInfo), sectionId: 0) + self.resetItem = ItemListActionItem(presentationData: ItemListPresentationData(presentationData), title: presentationData.strings.Wallpaper_ResetWallpapers, kind: .generic, alignment: .natural, sectionId: 0, style: .blocks, action: { [weak self] in self?.resetWallpapers() }) - self.resetDescriptionItem = ItemListTextItem(theme: presentationData.theme, text: .plain(presentationData.strings.Wallpaper_ResetWallpapersInfo), sectionId: 0) + self.resetDescriptionItem = ItemListTextItem(presentationData: ItemListPresentationData(presentationData), text: .plain(presentationData.strings.Wallpaper_ResetWallpapersInfo), sectionId: 0) if let (layout, navigationBarHeight) = self.validLayout { self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate) diff --git a/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift b/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift index 905f4f2b54..15a7a620f4 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift @@ -311,7 +311,7 @@ public final class ThemePreviewController: ViewController { theme = updatedTheme } - return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) } } diff --git a/submodules/SettingsUI/Sources/Themes/ThemePreviewControllerNode.swift b/submodules/SettingsUI/Sources/Themes/ThemePreviewControllerNode.swift index e1560294bd..79a38434e7 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemePreviewControllerNode.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemePreviewControllerNode.swift @@ -333,7 +333,7 @@ final class ThemePreviewControllerNode: ASDisplayNode, UIScrollViewDelegate { let interaction = ChatListNodeInteraction(activateSearch: {}, peerSelected: { _ in }, togglePeerSelected: { _ in }, messageSelected: { _, _, _ in}, groupSelected: { _ in }, addContact: { _ in }, setPeerIdWithRevealedOptions: { _, _ in }, setItemPinned: { _, _ in }, setPeerMuted: { _, _ in }, deletePeer: { _ in }, updatePeerGrouping: { _, _ in }, togglePeerMarkedUnread: { _, _ in}, toggleArchivedFolderHiddenByDefault: {}, activateChatPreview: { _, _, gesture in gesture?.cancel() }) - let chatListPresentationData = ChatListPresentationData(theme: self.previewTheme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true) + let chatListPresentationData = ChatListPresentationData(theme: self.previewTheme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: true) let peers = SimpleDictionary() let messages = SimpleDictionary() diff --git a/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift b/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift index b2a0fff4c2..95d7258394 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeSettingsController.swift @@ -74,13 +74,14 @@ private final class ThemeSettingsControllerArguments { let selectAccentColor: (PresentationThemeAccentColor) -> Void let openAccentColorPicker: (PresentationThemeReference) -> Void let openAutoNightTheme: () -> Void + let openTextSize: () -> Void let toggleLargeEmoji: (Bool) -> Void let disableAnimations: (Bool) -> Void let selectAppIcon: (String) -> Void let editTheme: (PresentationCloudTheme) -> Void let contextAction: (Bool, PresentationThemeReference, ASDisplayNode, ContextGesture?) -> Void - init(context: AccountContext, selectTheme: @escaping (PresentationThemeReference) -> Void, selectFontSize: @escaping (PresentationFontSize) -> Void, openWallpaperSettings: @escaping () -> Void, selectAccentColor: @escaping (PresentationThemeAccentColor) -> Void, openAccentColorPicker: @escaping (PresentationThemeReference) -> Void, openAutoNightTheme: @escaping () -> Void, toggleLargeEmoji: @escaping (Bool) -> Void, disableAnimations: @escaping (Bool) -> Void, selectAppIcon: @escaping (String) -> Void, editTheme: @escaping (PresentationCloudTheme) -> Void, contextAction: @escaping (Bool, PresentationThemeReference, ASDisplayNode, ContextGesture?) -> Void) { + init(context: AccountContext, selectTheme: @escaping (PresentationThemeReference) -> Void, selectFontSize: @escaping (PresentationFontSize) -> Void, openWallpaperSettings: @escaping () -> Void, selectAccentColor: @escaping (PresentationThemeAccentColor) -> Void, openAccentColorPicker: @escaping (PresentationThemeReference) -> Void, openAutoNightTheme: @escaping () -> Void, openTextSize: @escaping () -> Void, toggleLargeEmoji: @escaping (Bool) -> Void, disableAnimations: @escaping (Bool) -> Void, selectAppIcon: @escaping (String) -> Void, editTheme: @escaping (PresentationCloudTheme) -> Void, contextAction: @escaping (Bool, PresentationThemeReference, ASDisplayNode, ContextGesture?) -> Void) { self.context = context self.selectTheme = selectTheme self.selectFontSize = selectFontSize @@ -88,6 +89,7 @@ private final class ThemeSettingsControllerArguments { self.selectAccentColor = selectAccentColor self.openAccentColorPicker = openAccentColorPicker self.openAutoNightTheme = openAutoNightTheme + self.openTextSize = openTextSize self.toggleLargeEmoji = toggleLargeEmoji self.disableAnimations = disableAnimations self.selectAppIcon = selectAppIcon @@ -130,6 +132,7 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { case wallpaper(PresentationTheme, String) case accentColor(PresentationTheme, PresentationThemeReference, String, PresentationThemeAccentColor?) case autoNightTheme(PresentationTheme, String, String) + case textSize(PresentationTheme, String, String) case themeItem(PresentationTheme, PresentationStrings, [PresentationThemeReference], PresentationThemeReference, [Int64: PresentationThemeAccentColor], [Int64: PresentationThemeColorPair], PresentationThemeAccentColor?) case iconHeader(PresentationTheme, String) case iconItem(PresentationTheme, PresentationStrings, [PresentationAppIcon], String?) @@ -144,7 +147,7 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { return ThemeSettingsControllerSection.chatPreview.rawValue case .fontSizeHeader, .fontSize: return ThemeSettingsControllerSection.fontSize.rawValue - case .wallpaper, .autoNightTheme: + case .wallpaper, .autoNightTheme, .textSize: return ThemeSettingsControllerSection.background.rawValue case .iconHeader, .iconItem: return ThemeSettingsControllerSection.icon.rawValue @@ -167,22 +170,24 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { return 5 case .autoNightTheme: return 6 - case .fontSizeHeader: + case .textSize: return 7 - case .fontSize: + case .fontSizeHeader: return 8 - case .iconHeader: + case .fontSize: return 9 - case .iconItem: + case .iconHeader: return 10 - case .otherHeader: + case .iconItem: return 11 - case .largeEmoji: + case .otherHeader: return 12 - case .animations: + case .largeEmoji: return 13 - case .animationsInfo: + case .animations: return 14 + case .animationsInfo: + return 15 } } @@ -212,6 +217,12 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { } else { return false } + case let .textSize(lhsTheme, lhsText, lhsValue): + if case let .textSize(rhsTheme, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsText == rhsText, lhsValue == rhsValue { + return true + } else { + return false + } case let .themeListHeader(lhsTheme, lhsText): if case let .themeListHeader(rhsTheme, rhsText) = rhs, lhsTheme === rhsTheme, lhsText == rhsText { return true @@ -279,11 +290,11 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ThemeSettingsControllerArguments switch self { case let .fontSizeHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .fontSize(theme, fontSize): return ThemeSettingsFontSizeItem(theme: theme, fontSize: fontSize, sectionId: self.section, updated: { value in arguments.selectFontSize(value) @@ -291,7 +302,7 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { case let .chatPreview(theme, componentTheme, wallpaper, fontSize, strings, dateTimeFormat, nameDisplayOrder, items): return ThemeSettingsChatPreviewItem(context: arguments.context, theme: theme, componentTheme: componentTheme, strings: strings, sectionId: self.section, fontSize: fontSize, wallpaper: wallpaper, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, messageItems: items) case let .wallpaper(theme, text): - return ItemListDisclosureItem(theme: theme, title: text, label: "", sectionId: self.section, style: .blocks, action: { + return ItemListDisclosureItem(presentationData: presentationData, title: text, label: "", sectionId: self.section, style: .blocks, action: { arguments.openWallpaperSettings() }) case let .accentColor(theme, currentTheme, _, color): @@ -318,11 +329,15 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { arguments.openAccentColorPicker(currentTheme) }, tag: ThemeSettingsEntryTag.accentColor) case let .autoNightTheme(theme, text, value): - return ItemListDisclosureItem(theme: theme, icon: nil, title: text, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + return ItemListDisclosureItem(presentationData: presentationData, icon: nil, title: text, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { arguments.openAutoNightTheme() }) + case let .textSize(theme, text, value): + return ItemListDisclosureItem(presentationData: presentationData, icon: nil, title: text, label: value, labelStyle: .text, sectionId: self.section, style: .blocks, disclosureStyle: .arrow, action: { + arguments.openTextSize() + }) case let .themeListHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .themeItem(theme, strings, themes, currentTheme, themeSpecificAccentColors, themeSpecificBubbleColors, _): return ThemeSettingsThemeItem(context: arguments.context, theme: theme, strings: strings, sectionId: self.section, themes: themes, displayUnsupported: true, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: themeSpecificBubbleColors, currentTheme: currentTheme, updatedTheme: { theme in if case let .cloud(theme) = theme, theme.theme.file == nil { @@ -336,28 +351,28 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { arguments.contextAction(theme.index == currentTheme.index, theme, node, gesture) }) case let .iconHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .iconItem(theme, strings, icons, value): return ThemeSettingsAppIconItem(theme: theme, strings: strings, sectionId: self.section, icons: icons, currentIconName: value, updated: { iconName in arguments.selectAppIcon(iconName) }) case let .otherHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .largeEmoji(theme, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleLargeEmoji(value) }, tag: ThemeSettingsEntryTag.largeEmoji) case let .animations(theme, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.disableAnimations(value) }, tag: ThemeSettingsEntryTag.animations) case let .animationsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } -private func themeSettingsControllerEntries(presentationData: PresentationData, theme: PresentationTheme, themeReference: PresentationThemeReference, themeSpecificAccentColors: [Int64: PresentationThemeAccentColor], themeSpecificBubbleColors: [Int64: PresentationThemeColorPair], availableThemes: [PresentationThemeReference], autoNightSettings: AutomaticThemeSwitchSetting, strings: PresentationStrings, wallpaper: TelegramWallpaper, fontSize: PresentationFontSize, dateTimeFormat: PresentationDateTimeFormat, largeEmoji: Bool, disableAnimations: Bool, availableAppIcons: [PresentationAppIcon], currentAppIconName: String?) -> [ThemeSettingsControllerEntry] { +private func themeSettingsControllerEntries(presentationData: PresentationData, presentationThemeSettings: PresentationThemeSettings, theme: PresentationTheme, themeReference: PresentationThemeReference, themeSpecificAccentColors: [Int64: PresentationThemeAccentColor], themeSpecificBubbleColors: [Int64: PresentationThemeColorPair], availableThemes: [PresentationThemeReference], autoNightSettings: AutomaticThemeSwitchSetting, strings: PresentationStrings, wallpaper: TelegramWallpaper, fontSize: PresentationFontSize, dateTimeFormat: PresentationDateTimeFormat, largeEmoji: Bool, disableAnimations: Bool, availableAppIcons: [PresentationAppIcon], currentAppIconName: String?) -> [ThemeSettingsControllerEntry] { var entries: [ThemeSettingsControllerEntry] = [] let title = presentationData.autoNightModeTriggered ? strings.Appearance_ColorThemeNight.uppercased() : strings.Appearance_ColorTheme.uppercased() @@ -389,8 +404,16 @@ private func themeSettingsControllerEntries(presentationData: PresentationData, } entries.append(.autoNightTheme(presentationData.theme, strings.Appearance_AutoNightTheme, autoNightMode)) - entries.append(.fontSizeHeader(presentationData.theme, strings.Appearance_TextSize.uppercased())) - entries.append(.fontSize(presentationData.theme, fontSize)) + let textSizeValue: String + if presentationThemeSettings.useSystemFont { + textSizeValue = strings.Appearance_TextSize_Automatic + } else { + textSizeValue = "\(Int(presentationThemeSettings.fontSize.baseDisplaySize))pt" + } + entries.append(.textSize(presentationData.theme, strings.Appearance_TextSizeSetting, textSizeValue)) + + //entries.append(.fontSizeHeader(presentationData.theme, strings.Appearance_TextSize.uppercased())) + //entries.append(.fontSize(presentationData.theme, fontSize)) if !availableAppIcons.isEmpty { entries.append(.iconHeader(presentationData.theme, strings.Appearance_AppIcon.uppercased())) @@ -436,7 +459,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The selectThemeImpl?(theme) }, selectFontSize: { size in let _ = updatePresentationThemeSettingsInteractively(accountManager: context.sharedContext.accountManager, { current in - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: size, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: size, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }).start() }, openWallpaperSettings: { pushControllerImpl?(ThemeGridController(context: context)) @@ -461,20 +484,27 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The themeSpecificChatWallpapers[currentTheme.index] = theme.chat.defaultWallpaper } - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }).start() }, openAccentColorPicker: { themeReference in let controller = ThemeAccentColorController(context: context, themeReference: themeReference, section: .accent) presentControllerImpl?(controller, ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) }, openAutoNightTheme: { pushControllerImpl?(themeAutoNightSettingsController(context: context)) + }, openTextSize: { + let _ = (context.sharedContext.accountManager.sharedData(keys: Set([ApplicationSpecificSharedDataKeys.presentationThemeSettings])) + |> take(1) + |> deliverOnMainQueue).start(next: { view in + let settings = (view.entries[ApplicationSpecificSharedDataKeys.presentationThemeSettings] as? PresentationThemeSettings) ?? PresentationThemeSettings.defaultSettings + pushControllerImpl?(TextSizeSelectionController(context: context, presentationThemeSettings: settings)) + }) }, toggleLargeEmoji: { largeEmoji in let _ = updatePresentationThemeSettingsInteractively(accountManager: context.sharedContext.accountManager, { current in - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: largeEmoji, disableAnimations: current.disableAnimations) }).start() }, disableAnimations: { value in let _ = updatePresentationThemeSettingsInteractively(accountManager: context.sharedContext.accountManager, { current in - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: value) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: value) }).start() }, selectAppIcon: { name in currentAppIconName.set(name) @@ -611,8 +641,8 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The } availableThemes.append(contentsOf: cloudThemes) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Appearance_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: themeSettingsControllerEntries(presentationData: presentationData, theme: theme, themeReference: themeReference, themeSpecificAccentColors: settings.themeSpecificAccentColors, themeSpecificBubbleColors: settings.themeSpecificBubbleColors, availableThemes: availableThemes, autoNightSettings: settings.automaticThemeSwitchSetting, strings: presentationData.strings, wallpaper: wallpaper, fontSize: fontSize, dateTimeFormat: dateTimeFormat, largeEmoji: largeEmoji, disableAnimations: disableAnimations, availableAppIcons: availableAppIcons, currentAppIconName: currentAppIconName), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Appearance_Title), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: themeSettingsControllerEntries(presentationData: presentationData, presentationThemeSettings: settings, theme: theme, themeReference: themeReference, themeSpecificAccentColors: settings.themeSpecificAccentColors, themeSpecificBubbleColors: settings.themeSpecificBubbleColors, availableThemes: availableThemes, autoNightSettings: settings.automaticThemeSwitchSetting, strings: presentationData.strings, wallpaper: wallpaper, fontSize: fontSize, dateTimeFormat: dateTimeFormat, largeEmoji: largeEmoji, disableAnimations: disableAnimations, availableAppIcons: availableAppIcons, currentAppIconName: currentAppIconName), style: .blocks, ensureVisibleItemTag: focusOnItemTag, animateChanges: false) return (controllerState, (listState, arguments)) } @@ -677,7 +707,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The theme = updatedTheme } - return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) }) }).start() diff --git a/submodules/SettingsUI/Sources/Themes/ThemeSettingsFontSizeItem.swift b/submodules/SettingsUI/Sources/Themes/ThemeSettingsFontSizeItem.swift index 3e97f00deb..31a04f5488 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeSettingsFontSizeItem.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeSettingsFontSizeItem.swift @@ -15,13 +15,17 @@ import AppBundle class ThemeSettingsFontSizeItem: ListViewItem, ItemListItem { let theme: PresentationTheme let fontSize: PresentationFontSize + let disableLeadingInset: Bool + let enabled: Bool let sectionId: ItemListSectionId let updated: (PresentationFontSize) -> Void let tag: ItemListItemTag? - init(theme: PresentationTheme, fontSize: PresentationFontSize, sectionId: ItemListSectionId, updated: @escaping (PresentationFontSize) -> Void, tag: ItemListItemTag? = nil) { + init(theme: PresentationTheme, fontSize: PresentationFontSize, enabled: Bool = true, disableLeadingInset: Bool = false, sectionId: ItemListSectionId, updated: @escaping (PresentationFontSize) -> Void, tag: ItemListItemTag? = nil) { self.theme = theme self.fontSize = fontSize + self.enabled = enabled + self.disableLeadingInset = disableLeadingInset self.sectionId = sectionId self.updated = updated self.tag = tag @@ -128,6 +132,8 @@ class ThemeSettingsFontSizeItemNode: ListViewItemNode, ItemListItemNode { sliderView.positionsCount = 7 sliderView.disablesInteractiveTransitionGestureRecognizer = true if let item = self.item, let params = self.layoutParams { + sliderView.isUserInteractionEnabled = item.enabled + let value: CGFloat switch item.fontSize { case .extraSmall: @@ -148,7 +154,7 @@ class ThemeSettingsFontSizeItemNode: ListViewItemNode, ItemListItemNode { sliderView.value = value sliderView.backgroundColor = item.theme.list.itemBlocksBackgroundColor sliderView.backColor = item.theme.list.disclosureArrowColor - sliderView.trackColor = item.theme.list.itemAccentColor + sliderView.trackColor = item.enabled ? item.theme.list.itemAccentColor : item.theme.list.itemDisabledTextColor sliderView.knobImage = generateKnobImage() sliderView.frame = CGRect(origin: CGPoint(x: params.leftInset + 38.0, y: 8.0), size: CGSize(width: params.width - params.leftInset - params.rightInset - 38.0 * 2.0, height: 44.0)) @@ -174,17 +180,23 @@ class ThemeSettingsFontSizeItemNode: ListViewItemNode, ItemListItemNode { } let contentSize: CGSize - let insets: UIEdgeInsets + var insets: UIEdgeInsets let separatorHeight = UIScreenPixel contentSize = CGSize(width: params.width, height: 60.0) insets = itemListNeighborsGroupedInsets(neighbors) + if item.disableLeadingInset { + insets.top = 0.0 + insets.bottom = 0.0 + } + let layout = ListViewItemNodeLayout(contentSize: contentSize, insets: insets) let layoutSize = layout.size return (layout, { [weak self] in if let strongSelf = self { + let firstTime = strongSelf.item == nil strongSelf.item = item strongSelf.layoutParams = params @@ -249,13 +261,36 @@ class ThemeSettingsFontSizeItemNode: ListViewItemNode, ItemListItemNode { } if let sliderView = strongSelf.sliderView { + sliderView.isUserInteractionEnabled = item.enabled + sliderView.trackColor = item.enabled ? item.theme.list.itemAccentColor : item.theme.list.itemDisabledTextColor + if themeUpdated { sliderView.backgroundColor = item.theme.list.itemBlocksBackgroundColor sliderView.backColor = item.theme.list.disclosureArrowColor - sliderView.trackColor = item.theme.list.itemAccentColor sliderView.knobImage = generateKnobImage() } + let value: CGFloat + switch item.fontSize { + case .extraSmall: + value = 0.0 + case .small: + value = 1.0 + case .medium: + value = 2.0 + case .regular: + value = 3.0 + case .large: + value = 4.0 + case .extraLarge: + value = 5.0 + case .extraLargeX2: + value = 6.0 + } + if firstTime { + sliderView.value = value + } + sliderView.frame = CGRect(origin: CGPoint(x: params.leftInset + 38.0, y: 8.0), size: CGSize(width: params.width - params.leftInset - params.rightInset - 38.0 * 2.0, height: 44.0)) } } diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift index 4215c52cec..cb634251e3 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift @@ -392,7 +392,7 @@ public class WallpaperGalleryController: ViewController { } else { themeSpecificChatWallpapers[current.theme.index] = wallpaper } - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) |> deliverOnMainQueue).start(completed: { self?.dismiss(forceAway: true) }) diff --git a/submodules/SettingsUI/Sources/UsernameSetupController.swift b/submodules/SettingsUI/Sources/UsernameSetupController.swift index 3482cd4ff4..a30977b730 100644 --- a/submodules/SettingsUI/Sources/UsernameSetupController.swift +++ b/submodules/SettingsUI/Sources/UsernameSetupController.swift @@ -91,16 +91,16 @@ private enum UsernameSetupEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! UsernameSetupControllerArguments switch self { case let .editablePublicLink(theme, strings, prefix, currentText, text): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: prefix, textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: "", type: .username, spacing: 10.0, clearType: .always, tag: UsernameEntryTag.username, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: prefix, textColor: theme.list.itemPrimaryTextColor), text: text, placeholder: "", type: .username, spacing: 10.0, clearType: .always, tag: UsernameEntryTag.username, sectionId: self.section, textUpdated: { updatedText in arguments.updatePublicLinkText(currentText, updatedText) }, action: { }) case let .publicLinkInfo(theme, text): - return ItemListTextItem(theme: theme, text: .markdown(text), sectionId: self.section, linkAction: { action in + return ItemListTextItem(presentationData: presentationData, text: .markdown(text), sectionId: self.section, linkAction: { action in if case .tap = action { arguments.shareLink() } @@ -122,7 +122,7 @@ private enum UsernameSetupEntry: ItemListNodeEntry { string = NSAttributedString(string: text, textColor: theme.list.freeTextColor) displayActivity = true } - return ItemListActivityTextItem(displayActivity: displayActivity, theme: theme, text: string, sectionId: self.section) + return ItemListActivityTextItem(displayActivity: displayActivity, presentationData: presentationData, text: string, sectionId: self.section) } } } @@ -339,8 +339,8 @@ public func usernameSetupController(context: AccountContext) -> ViewController { dismissImpl?() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Username_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) - let listState = ItemListNodeState(entries: usernameSetupControllerEntries(presentationData: presentationData, view: view, state: state), style: .blocks, focusItemTag: UsernameEntryTag.username, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Username_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: false) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: usernameSetupControllerEntries(presentationData: presentationData, view: view, state: state), style: .blocks, focusItemTag: UsernameEntryTag.username, animateChanges: false) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/SettingsUI/Sources/Watch/WatchSettingsController.swift b/submodules/SettingsUI/Sources/Watch/WatchSettingsController.swift index ce4dbcb7c5..6e6da3a112 100644 --- a/submodules/SettingsUI/Sources/Watch/WatchSettingsController.swift +++ b/submodules/SettingsUI/Sources/Watch/WatchSettingsController.swift @@ -75,17 +75,17 @@ private enum WatchSettingsControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! WatchSettingsControllerArguments switch self { case let .replyPresetsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .replyPreset(theme, strings, identifier, placeholder, value, _): - return ItemListSingleLineInputItem(theme: theme, strings: strings, title: NSAttributedString(string: ""), text: value, placeholder: placeholder, type: .regular(capitalization: true, autocorrection: true), spacing: 0.0, sectionId: self.section, textUpdated: { updatedText in + return ItemListSingleLineInputItem(presentationData: presentationData, title: NSAttributedString(string: ""), text: value, placeholder: placeholder, type: .regular(capitalization: true, autocorrection: true), spacing: 0.0, sectionId: self.section, textUpdated: { updatedText in arguments.updatePreset(identifier, updatedText.trimmingCharacters(in: .whitespacesAndNewlines)) }, action: {}) case let .replyPresetsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -135,8 +135,8 @@ public func watchSettingsController(context: AccountContext) -> ViewController { |> map { presentationData, sharedData -> (ItemListControllerState, (ItemListNodeState, Any)) in let settings = (sharedData.entries[ApplicationSpecificSharedDataKeys.watchPresetSettings] as? WatchPresetSettings) ?? WatchPresetSettings.defaultSettings - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.AppleWatch_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: watchSettingsControllerEntries(presentationData: presentationData, customPresets: settings.customPresets), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.AppleWatch_Title), leftNavigationButton: nil, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: watchSettingsControllerEntries(presentationData: presentationData, customPresets: settings.customPresets), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/ShareController/Sources/ShareController.swift b/submodules/ShareController/Sources/ShareController.swift index d152d6c326..a0ad6eb665 100644 --- a/submodules/ShareController/Sources/ShareController.swift +++ b/submodules/ShareController/Sources/ShareController.swift @@ -425,7 +425,7 @@ public final class ShareController: ViewController { guard let strongSelf = self else { return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: title, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: title, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) }, externalShare: self.externalShare, immediateExternalShare: self.immediateExternalShare) self.controllerNode.dismiss = { [weak self] shared in self?.presentingViewController?.dismiss(animated: false, completion: nil) @@ -555,7 +555,7 @@ public final class ShareController: ViewController { } if !displayedError, case .slowmodeActive = error { displayedError = true - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: peer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder), text: strongSelf.presentationData.strings.Chat_SlowmodeSendError, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: peer.displayTitle(strings: strongSelf.presentationData.strings, displayOrder: strongSelf.presentationData.nameDisplayOrder), text: strongSelf.presentationData.strings.Chat_SlowmodeSendError, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } }) } diff --git a/submodules/TelegramCallsUI/Sources/CallFeedbackController.swift b/submodules/TelegramCallsUI/Sources/CallFeedbackController.swift index 4d8372a4be..92ef6fe615 100644 --- a/submodules/TelegramCallsUI/Sources/CallFeedbackController.swift +++ b/submodules/TelegramCallsUI/Sources/CallFeedbackController.swift @@ -163,17 +163,17 @@ private enum CallFeedbackControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! CallFeedbackControllerArguments switch self { case let .reasonsHeader(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .reason(theme, reason, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, maximumNumberOfLines: 2, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, maximumNumberOfLines: 2, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleReason(reason, value) }) case let .comment(theme, text, placeholder): - return ItemListMultilineInputItem(theme: theme, text: text, placeholder: placeholder, maxLength: nil, sectionId: self.section, style: .blocks, textUpdated: { updatedText in + return ItemListMultilineInputItem(presentationData: presentationData, text: text, placeholder: placeholder, maxLength: nil, sectionId: self.section, style: .blocks, textUpdated: { updatedText in arguments.updateComment(updatedText) }, updatedFocus: { focused in if focused { @@ -181,11 +181,11 @@ private enum CallFeedbackControllerEntry: ItemListNodeEntry { } }, tag: CallFeedbackControllerEntryTag.comment) case let .includeLogs(theme, title, value): - return ItemListSwitchItem(theme: theme, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: title, value: value, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleIncludeLogs(value) }) case let .includeLogsInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -289,8 +289,8 @@ public func callFeedbackController(sharedContext: SharedAccountContext, account: presentControllerImpl?(OverlayStatusController(theme: presentationData.theme, type: .starSuccess(presentationData.strings.CallFeedback_Success))) }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.CallFeedback_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: callFeedbackControllerEntries(theme: presentationData.theme, strings: presentationData.strings, state: state), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.CallFeedback_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: callFeedbackControllerEntries(theme: presentationData.theme, strings: presentationData.strings, state: state), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) } diff --git a/submodules/TelegramCallsUI/Sources/CallRatingController.swift b/submodules/TelegramCallsUI/Sources/CallRatingController.swift index 2bbe0acae1..79ba03527f 100644 --- a/submodules/TelegramCallsUI/Sources/CallRatingController.swift +++ b/submodules/TelegramCallsUI/Sources/CallRatingController.swift @@ -277,7 +277,7 @@ public func callRatingController(sharedContext: SharedAccountContext, account: A dismissImpl?(true) })] - contentNode = CallRatingAlertContentNode(theme: AlertControllerTheme(presentationTheme: theme), ptheme: theme, strings: strings, actions: actions, dismiss: { + contentNode = CallRatingAlertContentNode(theme: AlertControllerTheme(presentationData: presentationData), ptheme: theme, strings: strings, actions: actions, dismiss: { dismissImpl?(true) }, apply: { rating in dismissImpl?(true) @@ -288,7 +288,7 @@ public func callRatingController(sharedContext: SharedAccountContext, account: A } }) - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: theme), contentNode: contentNode!) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode!) dismissImpl = { [weak controller] animated in if animated { controller?.dismissAnimated() diff --git a/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift b/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift index ba5f52d066..cb4c9b859f 100644 --- a/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift +++ b/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift @@ -219,9 +219,9 @@ func callSuggestTabController(sharedContext: SharedAccountContext) -> AlertContr }).start() })] - contentNode = CallSuggestTabAlertContentNode(theme: AlertControllerTheme(presentationTheme: theme), ptheme: theme, strings: strings, actions: actions) + contentNode = CallSuggestTabAlertContentNode(theme: AlertControllerTheme(presentationData: presentationData), ptheme: theme, strings: strings, actions: actions) - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: theme), contentNode: contentNode!) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode!) dismissImpl = { [weak controller] animated in if animated { controller?.dismissAnimated() diff --git a/submodules/TelegramCore/Sources/ChangePeerNotificationSettings.swift b/submodules/TelegramCore/Sources/ChangePeerNotificationSettings.swift index 163ffe3637..da0bd74e53 100644 --- a/submodules/TelegramCore/Sources/ChangePeerNotificationSettings.swift +++ b/submodules/TelegramCore/Sources/ChangePeerNotificationSettings.swift @@ -27,7 +27,7 @@ public func togglePeerMuted(account: Account, peerId: PeerId) -> Signal Signal { return .complete() - /*return postbox.transaction { transaction -> (Peer, String?)? in + return postbox.transaction { transaction -> (Peer, String?)? in guard let peer = transaction.getPeer(messageId.peerId) else { return nil } @@ -90,7 +90,7 @@ private func requestUpdateMessageReaction(postbox: Postbox, network: Network, st |> castError(RequestUpdateMessageReactionError.self) |> ignoreValues } - }*/ + } } private final class ManagedApplyPendingMessageReactionsActionsHelper { diff --git a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift index 41f573a03f..c167866c53 100644 --- a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift +++ b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift @@ -1,6 +1,41 @@ import Foundation import UIKit import Display +import TelegramUIPreferences + +public extension PresentationFontSize { + init(systemFontSize: CGFloat) { + var closestIndex = 0 + let allSizes = PresentationFontSize.allCases + for i in 0 ..< allSizes.count { + if abs(allSizes[i].baseDisplaySize - systemFontSize) < abs(allSizes[closestIndex].baseDisplaySize - systemFontSize) { + closestIndex = i + } + } + self = allSizes[closestIndex] + } +} + +public extension PresentationFontSize { + var baseDisplaySize: CGFloat { + switch self { + case .extraSmall: + return 14.0 + case .small: + return 15.0 + case .medium: + return 16.0 + case .regular: + return 17.0 + case .large: + return 19.0 + case .extraLarge: + return 23.0 + case .extraLargeX2: + return 26.0 + } + } +} public extension TabBarControllerTheme { convenience init(rootControllerTheme: PresentationTheme) { @@ -46,9 +81,15 @@ public extension ActionSheetController { } public extension AlertControllerTheme { - convenience init(presentationTheme: PresentationTheme) { + convenience init(presentationTheme: PresentationTheme, fontSize: PresentationFontSize) { let actionSheet = presentationTheme.actionSheet - self.init(backgroundType: actionSheet.backgroundType == .light ? .light : .dark, backgroundColor: actionSheet.itemBackgroundColor, separatorColor: actionSheet.itemHighlightedBackgroundColor, highlightedItemColor: actionSheet.itemHighlightedBackgroundColor, primaryColor: actionSheet.primaryTextColor, secondaryColor: actionSheet.secondaryTextColor, accentColor: actionSheet.controlAccentColor, destructiveColor: actionSheet.destructiveActionTextColor, disabledColor: actionSheet.disabledActionTextColor) + self.init(backgroundType: actionSheet.backgroundType == .light ? .light : .dark, backgroundColor: actionSheet.itemBackgroundColor, separatorColor: actionSheet.itemHighlightedBackgroundColor, highlightedItemColor: actionSheet.itemHighlightedBackgroundColor, primaryColor: actionSheet.primaryTextColor, secondaryColor: actionSheet.secondaryTextColor, accentColor: actionSheet.controlAccentColor, destructiveColor: actionSheet.destructiveActionTextColor, disabledColor: actionSheet.disabledActionTextColor, baseFontSize: fontSize.baseDisplaySize) + } + + convenience init(presentationData: PresentationData) { + let presentationTheme = presentationData.theme + let actionSheet = presentationTheme.actionSheet + self.init(backgroundType: actionSheet.backgroundType == .light ? .light : .dark, backgroundColor: actionSheet.itemBackgroundColor, separatorColor: actionSheet.itemHighlightedBackgroundColor, highlightedItemColor: actionSheet.itemHighlightedBackgroundColor, primaryColor: actionSheet.primaryTextColor, secondaryColor: actionSheet.secondaryTextColor, accentColor: actionSheet.controlAccentColor, destructiveColor: actionSheet.destructiveActionTextColor, disabledColor: actionSheet.disabledActionTextColor, baseFontSize: presentationData.fontSize.baseDisplaySize) } } diff --git a/submodules/TelegramPresentationData/Sources/PresentationData.swift b/submodules/TelegramPresentationData/Sources/PresentationData.swift index 87d21502b8..d7d793013e 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationData.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationData.swift @@ -254,7 +254,7 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager, s } let nameDisplayOrder = contactSettings.nameDisplayOrder let nameSortOrder = currentPersonNameSortOrder() - return InitialPresentationDataAndSettings(presentationData: PresentationData(strings: stringsValue, theme: theme, autoNightModeTriggered: autoNightModeTriggered, chatWallpaper: effectiveChatWallpaper, fontSize: themeSettings.fontSize, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji), automaticMediaDownloadSettings: automaticMediaDownloadSettings, callListSettings: callListSettings, inAppNotificationSettings: inAppNotificationSettings, mediaInputSettings: mediaInputSettings, experimentalUISettings: experimentalUISettings) + return InitialPresentationDataAndSettings(presentationData: PresentationData(strings: stringsValue, theme: theme, autoNightModeTriggered: autoNightModeTriggered, chatWallpaper: effectiveChatWallpaper, fontSize: resolveFontSize(settings: themeSettings), dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji), automaticMediaDownloadSettings: automaticMediaDownloadSettings, callListSettings: callListSettings, inAppNotificationSettings: inAppNotificationSettings, mediaInputSettings: mediaInputSettings, experimentalUISettings: experimentalUISettings) } } @@ -558,7 +558,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI let nameDisplayOrder = contactSettings.nameDisplayOrder let nameSortOrder = currentPersonNameSortOrder() - return PresentationData(strings: stringsValue, theme: themeValue, autoNightModeTriggered: autoNightModeTriggered, chatWallpaper: effectiveChatWallpaper, fontSize: themeSettings.fontSize, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji) + return PresentationData(strings: stringsValue, theme: themeValue, autoNightModeTriggered: autoNightModeTriggered, chatWallpaper: effectiveChatWallpaper, fontSize: resolveFontSize(settings: themeSettings), dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji) } } else { return .complete() @@ -568,11 +568,32 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI } } +public func resolveFontSize(settings: PresentationThemeSettings) -> PresentationFontSize { + let fontSize: PresentationFontSize + if settings.useSystemFont { + let pointSize = UIFont.preferredFont(forTextStyle: .body).pointSize + fontSize = PresentationFontSize(systemFontSize: pointSize) + } else { + fontSize = settings.fontSize + } + return fontSize +} + public func defaultPresentationData() -> PresentationData { let dateTimeFormat = currentDateTimeFormat() let nameDisplayOrder: PresentationPersonNameOrder = .firstLast let nameSortOrder = currentPersonNameSortOrder() let themeSettings = PresentationThemeSettings.defaultSettings - return PresentationData(strings: defaultPresentationStrings, theme: defaultPresentationTheme, autoNightModeTriggered: false, chatWallpaper: .builtin(WallpaperSettings()), fontSize: themeSettings.fontSize, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji) + return PresentationData(strings: defaultPresentationStrings, theme: defaultPresentationTheme, autoNightModeTriggered: false, chatWallpaper: .builtin(WallpaperSettings()), fontSize: resolveFontSize(settings: themeSettings), dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, nameSortOrder: nameSortOrder, disableAnimations: themeSettings.disableAnimations, largeEmoji: themeSettings.largeEmoji) +} + +public extension PresentationData { + func withFontSize(_ fontSize: PresentationFontSize) -> PresentationData { + return PresentationData(strings: self.strings, theme: self.theme, autoNightModeTriggered: self.autoNightModeTriggered, chatWallpaper: self.chatWallpaper, fontSize: fontSize, dateTimeFormat: self.dateTimeFormat, nameDisplayOrder: self.nameDisplayOrder, nameSortOrder: self.nameSortOrder, disableAnimations: self.disableAnimations, largeEmoji: self.largeEmoji) + } + + func withStrings(_ strings: PresentationStrings) -> PresentationData { + return PresentationData(strings: strings, theme: self.theme, autoNightModeTriggered: self.autoNightModeTriggered, chatWallpaper: self.chatWallpaper, fontSize: self.fontSize, dateTimeFormat: self.dateTimeFormat, nameDisplayOrder: self.nameDisplayOrder, nameSortOrder: self.nameSortOrder, disableAnimations: self.disableAnimations, largeEmoji: self.largeEmoji) + } } diff --git a/submodules/TelegramPresentationData/Sources/PresentationStrings.swift b/submodules/TelegramPresentationData/Sources/PresentationStrings.swift index 4e37a99471..be7372d931 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationStrings.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationStrings.swift @@ -821,3849 +821,3858 @@ public final class PresentationStrings: Equatable { public var Privacy_PaymentsTitle: String { return self._s[574]! } public var EditTheme_Edit_Preview_IncomingReplyName: String { return self._s[575]! } public var ClearCache_StorageCache: String { return self._s[576]! } - public var Channel_DiscussionGroup_Header: String { return self._s[578]! } - public var VoiceOver_Chat_OptionSelected: String { return self._s[579]! } - public var Appearance_ColorTheme: String { return self._s[580]! } - public var UserInfo_ShareContact: String { return self._s[581]! } - public var Passport_Address_TypePassportRegistration: String { return self._s[582]! } - public var Common_More: String { return self._s[583]! } - public var Watch_Message_Call: String { return self._s[584]! } - public var Profile_EncryptionKey: String { return self._s[587]! } - public var Privacy_TopPeers: String { return self._s[588]! } - public var Conversation_StopPollConfirmation: String { return self._s[589]! } - public var Wallet_Words_NotDoneText: String { return self._s[591]! } - public var Privacy_TopPeersWarning: String { return self._s[593]! } - public var SettingsSearch_Synonyms_Data_DownloadInBackground: String { return self._s[594]! } - public var SettingsSearch_Synonyms_Data_Storage_KeepMedia: String { return self._s[595]! } - public var Wallet_RestoreFailed_EnterWords: String { return self._s[598]! } - public var DialogList_SearchSectionMessages: String { return self._s[599]! } - public var Notifications_ChannelNotifications: String { return self._s[600]! } - public var CheckoutInfo_ShippingInfoAddress1Placeholder: String { return self._s[601]! } - public var Passport_Language_sk: String { return self._s[602]! } - public var Notification_MessageLifetime1h: String { return self._s[603]! } - public var Wallpaper_ResetWallpapersInfo: String { return self._s[604]! } - public var Call_ReportSkip: String { return self._s[606]! } - public var Cache_ServiceFiles: String { return self._s[607]! } - public var Group_ErrorAddTooMuchAdmins: String { return self._s[608]! } - public var VoiceOver_Chat_YourFile: String { return self._s[609]! } - public var Map_Hybrid: String { return self._s[610]! } - public var Contacts_SearchUsersAndGroupsLabel: String { return self._s[612]! } - public var ChatSettings_AutoDownloadVideos: String { return self._s[614]! } - public var Channel_BanUser_PermissionEmbedLinks: String { return self._s[615]! } - public var InfoPlist_NSLocationAlwaysAndWhenInUseUsageDescription: String { return self._s[616]! } - public var SocksProxySetup_ProxyTelegram: String { return self._s[619]! } + public var Appearance_TextSizeSetting: String { return self._s[577]! } + public var Channel_DiscussionGroup_Header: String { return self._s[579]! } + public var VoiceOver_Chat_OptionSelected: String { return self._s[580]! } + public var Appearance_ColorTheme: String { return self._s[581]! } + public var UserInfo_ShareContact: String { return self._s[582]! } + public var Passport_Address_TypePassportRegistration: String { return self._s[583]! } + public var Common_More: String { return self._s[584]! } + public var Watch_Message_Call: String { return self._s[585]! } + public var Profile_EncryptionKey: String { return self._s[588]! } + public var Privacy_TopPeers: String { return self._s[589]! } + public var Conversation_StopPollConfirmation: String { return self._s[590]! } + public var Wallet_Words_NotDoneText: String { return self._s[592]! } + public var Privacy_TopPeersWarning: String { return self._s[594]! } + public var SettingsSearch_Synonyms_Data_DownloadInBackground: String { return self._s[595]! } + public var SettingsSearch_Synonyms_Data_Storage_KeepMedia: String { return self._s[596]! } + public var Wallet_RestoreFailed_EnterWords: String { return self._s[599]! } + public var DialogList_SearchSectionMessages: String { return self._s[600]! } + public var Notifications_ChannelNotifications: String { return self._s[601]! } + public var CheckoutInfo_ShippingInfoAddress1Placeholder: String { return self._s[602]! } + public var Passport_Language_sk: String { return self._s[603]! } + public var Notification_MessageLifetime1h: String { return self._s[604]! } + public var Wallpaper_ResetWallpapersInfo: String { return self._s[605]! } + public var Call_ReportSkip: String { return self._s[607]! } + public var Cache_ServiceFiles: String { return self._s[608]! } + public var Group_ErrorAddTooMuchAdmins: String { return self._s[609]! } + public var VoiceOver_Chat_YourFile: String { return self._s[610]! } + public var Map_Hybrid: String { return self._s[611]! } + public var Contacts_SearchUsersAndGroupsLabel: String { return self._s[613]! } + public var ChatSettings_AutoDownloadVideos: String { return self._s[615]! } + public var Channel_BanUser_PermissionEmbedLinks: String { return self._s[616]! } + public var InfoPlist_NSLocationAlwaysAndWhenInUseUsageDescription: String { return self._s[617]! } + public var SocksProxySetup_ProxyTelegram: String { return self._s[620]! } public func PUSH_MESSAGE_AUDIO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[620]!, self._r[620]!, [_1]) + return formatWithArgumentRanges(self._s[621]!, self._r[621]!, [_1]) } - public var Channel_Username_CreatePrivateLinkHelp: String { return self._s[622]! } - public var ScheduledMessages_ScheduledToday: String { return self._s[623]! } + public var Channel_Username_CreatePrivateLinkHelp: String { return self._s[623]! } + public var ScheduledMessages_ScheduledToday: String { return self._s[624]! } public func PUSH_CHAT_TITLE_EDITED(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[624]!, self._r[624]!, [_1, _2]) + return formatWithArgumentRanges(self._s[625]!, self._r[625]!, [_1, _2]) } - public var Conversation_LiveLocationYou: String { return self._s[625]! } - public var SettingsSearch_Synonyms_Privacy_Calls: String { return self._s[626]! } - public var SettingsSearch_Synonyms_Notifications_MessageNotificationsPreview: String { return self._s[627]! } - public var UserInfo_ShareBot: String { return self._s[630]! } + public var Conversation_LiveLocationYou: String { return self._s[626]! } + public var SettingsSearch_Synonyms_Privacy_Calls: String { return self._s[627]! } + public var SettingsSearch_Synonyms_Notifications_MessageNotificationsPreview: String { return self._s[628]! } + public var UserInfo_ShareBot: String { return self._s[631]! } public func PUSH_AUTH_REGION(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[631]!, self._r[631]!, [_1, _2]) + return formatWithArgumentRanges(self._s[632]!, self._r[632]!, [_1, _2]) } - public var Conversation_ClearCache: String { return self._s[632]! } - public var PhotoEditor_ShadowsTint: String { return self._s[633]! } - public var Message_Audio: String { return self._s[634]! } - public var Passport_Language_lt: String { return self._s[635]! } + public var Conversation_ClearCache: String { return self._s[633]! } + public var PhotoEditor_ShadowsTint: String { return self._s[634]! } + public var Message_Audio: String { return self._s[635]! } + public var Passport_Language_lt: String { return self._s[636]! } public func Message_PinnedTextMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[636]!, self._r[636]!, [_0]) + return formatWithArgumentRanges(self._s[637]!, self._r[637]!, [_0]) } - public var Permissions_SiriText_v0: String { return self._s[637]! } - public var Conversation_FileICloudDrive: String { return self._s[638]! } - public var ChatList_DeleteForEveryoneConfirmationTitle: String { return self._s[639]! } - public var Notifications_Badge_IncludeMutedChats: String { return self._s[640]! } + public var Permissions_SiriText_v0: String { return self._s[638]! } + public var Conversation_FileICloudDrive: String { return self._s[639]! } + public var ChatList_DeleteForEveryoneConfirmationTitle: String { return self._s[640]! } + public var Notifications_Badge_IncludeMutedChats: String { return self._s[641]! } public func Notification_NewAuthDetected(_ _1: String, _ _2: String, _ _3: String, _ _4: String, _ _5: String, _ _6: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[641]!, self._r[641]!, [_1, _2, _3, _4, _5, _6]) + return formatWithArgumentRanges(self._s[642]!, self._r[642]!, [_1, _2, _3, _4, _5, _6]) } - public var DialogList_ProxyConnectionIssuesTooltip: String { return self._s[642]! } + public var DialogList_ProxyConnectionIssuesTooltip: String { return self._s[643]! } public func Time_MonthOfYear_m5(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[643]!, self._r[643]!, [_0]) + return formatWithArgumentRanges(self._s[644]!, self._r[644]!, [_0]) } - public var Channel_SignMessages: String { return self._s[644]! } + public var Channel_SignMessages: String { return self._s[645]! } public func PUSH_MESSAGE_NOTEXT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[645]!, self._r[645]!, [_1]) + return formatWithArgumentRanges(self._s[646]!, self._r[646]!, [_1]) } - public var Compose_ChannelTokenListPlaceholder: String { return self._s[646]! } - public var Passport_ScanPassport: String { return self._s[647]! } - public var Watch_Suggestion_Thanks: String { return self._s[648]! } - public var BlockedUsers_AddNew: String { return self._s[649]! } + public var Compose_ChannelTokenListPlaceholder: String { return self._s[647]! } + public var Passport_ScanPassport: String { return self._s[648]! } + public var Watch_Suggestion_Thanks: String { return self._s[649]! } + public var BlockedUsers_AddNew: String { return self._s[650]! } public func PUSH_CHAT_MESSAGE(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[650]!, self._r[650]!, [_1, _2]) + return formatWithArgumentRanges(self._s[651]!, self._r[651]!, [_1, _2]) } - public var Watch_Message_Invoice: String { return self._s[651]! } - public var SettingsSearch_Synonyms_Privacy_LastSeen: String { return self._s[652]! } - public var Month_GenJuly: String { return self._s[653]! } - public var UserInfo_StartSecretChatStart: String { return self._s[654]! } - public var SocksProxySetup_ProxySocks5: String { return self._s[655]! } - public var Notification_Exceptions_DeleteAllConfirmation: String { return self._s[657]! } - public var Notification_ChannelInviterSelf: String { return self._s[658]! } - public var CheckoutInfo_ReceiverInfoEmail: String { return self._s[659]! } + public var Watch_Message_Invoice: String { return self._s[652]! } + public var SettingsSearch_Synonyms_Privacy_LastSeen: String { return self._s[653]! } + public var Month_GenJuly: String { return self._s[654]! } + public var UserInfo_StartSecretChatStart: String { return self._s[655]! } + public var SocksProxySetup_ProxySocks5: String { return self._s[656]! } + public var Notification_Exceptions_DeleteAllConfirmation: String { return self._s[658]! } + public var Notification_ChannelInviterSelf: String { return self._s[659]! } + public var CheckoutInfo_ReceiverInfoEmail: String { return self._s[660]! } public func ApplyLanguage_ChangeLanguageUnofficialText(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[660]!, self._r[660]!, [_1, _2]) + return formatWithArgumentRanges(self._s[661]!, self._r[661]!, [_1, _2]) } - public var CheckoutInfo_Title: String { return self._s[661]! } - public var Watch_Stickers_RecentPlaceholder: String { return self._s[662]! } + public var CheckoutInfo_Title: String { return self._s[662]! } + public var Watch_Stickers_RecentPlaceholder: String { return self._s[663]! } public func Map_DistanceAway(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[663]!, self._r[663]!, [_0]) + return formatWithArgumentRanges(self._s[664]!, self._r[664]!, [_0]) } - public var Passport_Identity_MainPage: String { return self._s[664]! } - public var TwoStepAuth_ConfirmEmailResendCode: String { return self._s[665]! } - public var Passport_Language_de: String { return self._s[666]! } - public var Update_Title: String { return self._s[667]! } - public var ContactInfo_PhoneLabelWorkFax: String { return self._s[668]! } - public var Channel_AdminLog_BanEmbedLinks: String { return self._s[669]! } - public var Passport_Email_UseTelegramEmailHelp: String { return self._s[670]! } - public var Notifications_ChannelNotificationsPreview: String { return self._s[671]! } - public var NotificationsSound_Telegraph: String { return self._s[672]! } - public var Watch_LastSeen_ALongTimeAgo: String { return self._s[673]! } - public var ChannelMembers_WhoCanAddMembers: String { return self._s[674]! } + public var Passport_Identity_MainPage: String { return self._s[665]! } + public var TwoStepAuth_ConfirmEmailResendCode: String { return self._s[666]! } + public var Passport_Language_de: String { return self._s[667]! } + public var Update_Title: String { return self._s[668]! } + public var ContactInfo_PhoneLabelWorkFax: String { return self._s[669]! } + public var Channel_AdminLog_BanEmbedLinks: String { return self._s[670]! } + public var Passport_Email_UseTelegramEmailHelp: String { return self._s[671]! } + public var Notifications_ChannelNotificationsPreview: String { return self._s[672]! } + public var NotificationsSound_Telegraph: String { return self._s[673]! } + public var Watch_LastSeen_ALongTimeAgo: String { return self._s[674]! } + public var ChannelMembers_WhoCanAddMembers: String { return self._s[675]! } public func AutoDownloadSettings_UpTo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[675]!, self._r[675]!, [_0]) + return formatWithArgumentRanges(self._s[676]!, self._r[676]!, [_0]) } - public var ClearCache_Description: String { return self._s[676]! } - public var Stickers_SuggestAll: String { return self._s[677]! } - public var Conversation_ForwardTitle: String { return self._s[678]! } - public var Appearance_ThemePreview_ChatList_7_Name: String { return self._s[679]! } + public var ClearCache_Description: String { return self._s[677]! } + public var Stickers_SuggestAll: String { return self._s[678]! } + public var Conversation_ForwardTitle: String { return self._s[679]! } + public var Appearance_ThemePreview_ChatList_7_Name: String { return self._s[680]! } public func Notification_JoinedChannel(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[680]!, self._r[680]!, [_0]) + return formatWithArgumentRanges(self._s[681]!, self._r[681]!, [_0]) } - public var Calls_NewCall: String { return self._s[681]! } - public var Call_StatusEnded: String { return self._s[682]! } - public var AutoDownloadSettings_DataUsageLow: String { return self._s[683]! } - public var Settings_ProxyConnected: String { return self._s[684]! } - public var Channel_AdminLogFilter_EventsPinned: String { return self._s[685]! } - public var PhotoEditor_QualityVeryLow: String { return self._s[686]! } - public var Channel_AdminLogFilter_EventsDeletedMessages: String { return self._s[687]! } - public var Passport_PasswordPlaceholder: String { return self._s[688]! } - public var Message_PinnedInvoice: String { return self._s[689]! } - public var Passport_Identity_IssueDate: String { return self._s[690]! } - public var Passport_Language_pl: String { return self._s[691]! } + public var Calls_NewCall: String { return self._s[682]! } + public var Call_StatusEnded: String { return self._s[683]! } + public var AutoDownloadSettings_DataUsageLow: String { return self._s[684]! } + public var Settings_ProxyConnected: String { return self._s[685]! } + public var Channel_AdminLogFilter_EventsPinned: String { return self._s[686]! } + public var PhotoEditor_QualityVeryLow: String { return self._s[687]! } + public var Channel_AdminLogFilter_EventsDeletedMessages: String { return self._s[688]! } + public var Passport_PasswordPlaceholder: String { return self._s[689]! } + public var Message_PinnedInvoice: String { return self._s[690]! } + public var Passport_Identity_IssueDate: String { return self._s[691]! } + public var Passport_Language_pl: String { return self._s[692]! } public func ChannelInfo_ChannelForbidden(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[692]!, self._r[692]!, [_0]) + return formatWithArgumentRanges(self._s[693]!, self._r[693]!, [_0]) } - public var SocksProxySetup_PasteFromClipboard: String { return self._s[693]! } - public var Call_StatusConnecting: String { return self._s[694]! } + public var SocksProxySetup_PasteFromClipboard: String { return self._s[694]! } + public var Call_StatusConnecting: String { return self._s[695]! } public func Username_UsernameIsAvailable(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[695]!, self._r[695]!, [_0]) + return formatWithArgumentRanges(self._s[696]!, self._r[696]!, [_0]) } - public var ChatSettings_ConnectionType_UseProxy: String { return self._s[697]! } - public var Common_Edit: String { return self._s[698]! } - public var PrivacySettings_LastSeenNobody: String { return self._s[699]! } + public var ChatSettings_ConnectionType_UseProxy: String { return self._s[698]! } + public var Common_Edit: String { return self._s[699]! } + public var PrivacySettings_LastSeenNobody: String { return self._s[700]! } public func Notification_LeftChat(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[700]!, self._r[700]!, [_0]) + return formatWithArgumentRanges(self._s[701]!, self._r[701]!, [_0]) } - public var GroupInfo_ChatAdmins: String { return self._s[701]! } - public var PrivateDataSettings_Title: String { return self._s[702]! } - public var Login_CancelPhoneVerificationStop: String { return self._s[703]! } - public var ChatList_Read: String { return self._s[704]! } - public var Wallet_WordImport_Text: String { return self._s[705]! } - public var Undo_ChatClearedForBothSides: String { return self._s[706]! } - public var GroupPermission_SectionTitle: String { return self._s[707]! } - public var TwoFactorSetup_Intro_Title: String { return self._s[709]! } + public var GroupInfo_ChatAdmins: String { return self._s[702]! } + public var PrivateDataSettings_Title: String { return self._s[703]! } + public var Login_CancelPhoneVerificationStop: String { return self._s[704]! } + public var ChatList_Read: String { return self._s[705]! } + public var Wallet_WordImport_Text: String { return self._s[706]! } + public var Undo_ChatClearedForBothSides: String { return self._s[707]! } + public var GroupPermission_SectionTitle: String { return self._s[708]! } + public var TwoFactorSetup_Intro_Title: String { return self._s[710]! } public func PUSH_CHAT_LEFT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[710]!, self._r[710]!, [_1, _2]) + return formatWithArgumentRanges(self._s[711]!, self._r[711]!, [_1, _2]) } - public var Checkout_ErrorPaymentFailed: String { return self._s[711]! } - public var Update_UpdateApp: String { return self._s[712]! } - public var Group_Username_RevokeExistingUsernamesInfo: String { return self._s[713]! } - public var Settings_Appearance: String { return self._s[714]! } - public var SettingsSearch_Synonyms_Stickers_SuggestStickers: String { return self._s[718]! } - public var Watch_Location_Access: String { return self._s[719]! } - public var ShareMenu_CopyShareLink: String { return self._s[721]! } - public var TwoStepAuth_SetupHintTitle: String { return self._s[722]! } - public var Conversation_Theme: String { return self._s[724]! } + public var Checkout_ErrorPaymentFailed: String { return self._s[712]! } + public var Update_UpdateApp: String { return self._s[713]! } + public var Group_Username_RevokeExistingUsernamesInfo: String { return self._s[714]! } + public var Settings_Appearance: String { return self._s[715]! } + public var SettingsSearch_Synonyms_Stickers_SuggestStickers: String { return self._s[719]! } + public var Watch_Location_Access: String { return self._s[720]! } + public var ShareMenu_CopyShareLink: String { return self._s[722]! } + public var TwoStepAuth_SetupHintTitle: String { return self._s[723]! } + public var Conversation_Theme: String { return self._s[725]! } public func DialogList_SingleRecordingVideoMessageSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[725]!, self._r[725]!, [_0]) + return formatWithArgumentRanges(self._s[726]!, self._r[726]!, [_0]) } - public var Notifications_ClassicTones: String { return self._s[726]! } - public var Weekday_ShortWednesday: String { return self._s[727]! } - public var WallpaperPreview_SwipeColorsBottomText: String { return self._s[728]! } - public var Undo_LeftGroup: String { return self._s[731]! } - public var Wallet_RestoreFailed_Text: String { return self._s[732]! } - public var Conversation_LinkDialogCopy: String { return self._s[733]! } - public var Wallet_TransactionInfo_NoAddress: String { return self._s[735]! } - public var Wallet_Navigation_Back: String { return self._s[736]! } - public var KeyCommand_FocusOnInputField: String { return self._s[737]! } - public var Contacts_SelectAll: String { return self._s[738]! } - public var Preview_SaveToCameraRoll: String { return self._s[739]! } - public var PrivacySettings_PasscodeOff: String { return self._s[740]! } - public var Appearance_ThemePreview_ChatList_6_Name: String { return self._s[741]! } - public var Wallpaper_Title: String { return self._s[742]! } - public var Conversation_FilePhotoOrVideo: String { return self._s[743]! } - public var AccessDenied_Camera: String { return self._s[744]! } - public var Watch_Compose_CurrentLocation: String { return self._s[745]! } - public var Channel_DiscussionGroup_MakeHistoryPublicProceed: String { return self._s[747]! } + public var Notifications_ClassicTones: String { return self._s[727]! } + public var Weekday_ShortWednesday: String { return self._s[728]! } + public var WallpaperPreview_SwipeColorsBottomText: String { return self._s[729]! } + public var Undo_LeftGroup: String { return self._s[732]! } + public var Wallet_RestoreFailed_Text: String { return self._s[733]! } + public var Conversation_LinkDialogCopy: String { return self._s[734]! } + public var Wallet_TransactionInfo_NoAddress: String { return self._s[736]! } + public var Wallet_Navigation_Back: String { return self._s[737]! } + public var KeyCommand_FocusOnInputField: String { return self._s[738]! } + public var Contacts_SelectAll: String { return self._s[739]! } + public var Preview_SaveToCameraRoll: String { return self._s[740]! } + public var PrivacySettings_PasscodeOff: String { return self._s[741]! } + public var Appearance_ThemePreview_ChatList_6_Name: String { return self._s[742]! } + public var Wallpaper_Title: String { return self._s[743]! } + public var Conversation_FilePhotoOrVideo: String { return self._s[744]! } + public var AccessDenied_Camera: String { return self._s[745]! } + public var Watch_Compose_CurrentLocation: String { return self._s[746]! } + public var Channel_DiscussionGroup_MakeHistoryPublicProceed: String { return self._s[748]! } public func SecretImage_NotViewedYet(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[748]!, self._r[748]!, [_0]) + return formatWithArgumentRanges(self._s[749]!, self._r[749]!, [_0]) } - public var GroupInfo_InvitationLinkDoesNotExist: String { return self._s[749]! } - public var Passport_Language_ro: String { return self._s[750]! } - public var EditTheme_UploadNewTheme: String { return self._s[751]! } - public var CheckoutInfo_SaveInfoHelp: String { return self._s[752]! } - public var Wallet_Intro_Terms: String { return self._s[753]! } + public var GroupInfo_InvitationLinkDoesNotExist: String { return self._s[750]! } + public var Passport_Language_ro: String { return self._s[751]! } + public var EditTheme_UploadNewTheme: String { return self._s[752]! } + public var CheckoutInfo_SaveInfoHelp: String { return self._s[753]! } + public var Wallet_Intro_Terms: String { return self._s[754]! } public func Notification_SecretChatMessageScreenshot(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[754]!, self._r[754]!, [_0]) + return formatWithArgumentRanges(self._s[755]!, self._r[755]!, [_0]) } - public var Login_CancelPhoneVerification: String { return self._s[755]! } - public var State_ConnectingToProxy: String { return self._s[756]! } - public var Calls_RatingTitle: String { return self._s[757]! } - public var Generic_ErrorMoreInfo: String { return self._s[758]! } - public var Appearance_PreviewReplyText: String { return self._s[759]! } - public var CheckoutInfo_ShippingInfoPostcodePlaceholder: String { return self._s[760]! } + public var Login_CancelPhoneVerification: String { return self._s[756]! } + public var State_ConnectingToProxy: String { return self._s[757]! } + public var Calls_RatingTitle: String { return self._s[758]! } + public var Generic_ErrorMoreInfo: String { return self._s[759]! } + public var Appearance_PreviewReplyText: String { return self._s[760]! } + public var CheckoutInfo_ShippingInfoPostcodePlaceholder: String { return self._s[761]! } public func Wallet_Send_Balance(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[761]!, self._r[761]!, [_0]) + return formatWithArgumentRanges(self._s[762]!, self._r[762]!, [_0]) } - public var SharedMedia_CategoryLinks: String { return self._s[762]! } - public var Calls_Missed: String { return self._s[763]! } - public var Cache_Photos: String { return self._s[767]! } - public var GroupPermission_NoAddMembers: String { return self._s[768]! } - public var ScheduledMessages_Title: String { return self._s[769]! } + public var SharedMedia_CategoryLinks: String { return self._s[763]! } + public var Calls_Missed: String { return self._s[764]! } + public var Cache_Photos: String { return self._s[768]! } + public var GroupPermission_NoAddMembers: String { return self._s[769]! } + public var ScheduledMessages_Title: String { return self._s[770]! } public func Channel_AdminLog_MessageUnpinned(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[770]!, self._r[770]!, [_0]) + return formatWithArgumentRanges(self._s[771]!, self._r[771]!, [_0]) } - public var Conversation_ShareBotLocationConfirmationTitle: String { return self._s[771]! } - public var Settings_ProxyDisabled: String { return self._s[772]! } + public var Conversation_ShareBotLocationConfirmationTitle: String { return self._s[772]! } + public var Settings_ProxyDisabled: String { return self._s[773]! } public func Settings_ApplyProxyAlertCredentials(_ _1: String, _ _2: String, _ _3: String, _ _4: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[773]!, self._r[773]!, [_1, _2, _3, _4]) + return formatWithArgumentRanges(self._s[774]!, self._r[774]!, [_1, _2, _3, _4]) } public func Conversation_RestrictedMediaTimed(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[774]!, self._r[774]!, [_0]) + return formatWithArgumentRanges(self._s[775]!, self._r[775]!, [_0]) } - public var ChatList_Context_RemoveFromRecents: String { return self._s[776]! } - public var Appearance_Title: String { return self._s[777]! } + public var ChatList_Context_RemoveFromRecents: String { return self._s[777]! } + public var Appearance_Title: String { return self._s[778]! } public func Time_MonthOfYear_m2(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[779]!, self._r[779]!, [_0]) + return formatWithArgumentRanges(self._s[780]!, self._r[780]!, [_0]) } - public var Conversation_WalletRequiredText: String { return self._s[780]! } - public var StickerPacksSettings_ShowStickersButtonHelp: String { return self._s[781]! } - public var Channel_EditMessageErrorGeneric: String { return self._s[782]! } - public var Privacy_Calls_IntegrationHelp: String { return self._s[783]! } - public var Preview_DeletePhoto: String { return self._s[784]! } - public var Appearance_AppIconFilledX: String { return self._s[785]! } - public var PrivacySettings_PrivacyTitle: String { return self._s[786]! } + public var Conversation_WalletRequiredText: String { return self._s[781]! } + public var StickerPacksSettings_ShowStickersButtonHelp: String { return self._s[782]! } + public var Channel_EditMessageErrorGeneric: String { return self._s[783]! } + public var Privacy_Calls_IntegrationHelp: String { return self._s[784]! } + public var Preview_DeletePhoto: String { return self._s[785]! } + public var Appearance_AppIconFilledX: String { return self._s[786]! } + public var PrivacySettings_PrivacyTitle: String { return self._s[787]! } public func Conversation_BotInteractiveUrlAlert(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[787]!, self._r[787]!, [_0]) + return formatWithArgumentRanges(self._s[788]!, self._r[788]!, [_0]) } - public var Coub_TapForSound: String { return self._s[789]! } - public var Map_LocatingError: String { return self._s[790]! } - public var TwoStepAuth_EmailChangeSuccess: String { return self._s[792]! } - public var Conversation_SendMessage_SendSilently: String { return self._s[793]! } - public var VoiceOver_MessageContextOpenMessageMenu: String { return self._s[794]! } + public var Coub_TapForSound: String { return self._s[790]! } + public var Map_LocatingError: String { return self._s[791]! } + public var TwoStepAuth_EmailChangeSuccess: String { return self._s[793]! } + public var Conversation_SendMessage_SendSilently: String { return self._s[794]! } + public var VoiceOver_MessageContextOpenMessageMenu: String { return self._s[795]! } public func Wallet_Time_PreciseDate_m8(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[795]!, self._r[795]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[796]!, self._r[796]!, [_1, _2, _3]) } - public var Passport_ForgottenPassword: String { return self._s[796]! } - public var GroupInfo_InviteLink_RevokeLink: String { return self._s[797]! } - public var StickerPacksSettings_ArchivedPacks: String { return self._s[798]! } - public var Login_TermsOfServiceSignupDecline: String { return self._s[800]! } - public var Channel_Moderator_AccessLevelRevoke: String { return self._s[801]! } - public var Message_Location: String { return self._s[802]! } - public var Passport_Identity_NamePlaceholder: String { return self._s[803]! } - public var Channel_Management_Title: String { return self._s[804]! } - public var DialogList_SearchSectionDialogs: String { return self._s[806]! } - public var Compose_NewChannel_Members: String { return self._s[807]! } + public var Passport_ForgottenPassword: String { return self._s[797]! } + public var GroupInfo_InviteLink_RevokeLink: String { return self._s[798]! } + public var StickerPacksSettings_ArchivedPacks: String { return self._s[799]! } + public var Login_TermsOfServiceSignupDecline: String { return self._s[801]! } + public var Channel_Moderator_AccessLevelRevoke: String { return self._s[802]! } + public var Message_Location: String { return self._s[803]! } + public var Passport_Identity_NamePlaceholder: String { return self._s[804]! } + public var Channel_Management_Title: String { return self._s[805]! } + public var DialogList_SearchSectionDialogs: String { return self._s[807]! } + public var Compose_NewChannel_Members: String { return self._s[808]! } public func DialogList_SingleUploadingFileSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[808]!, self._r[808]!, [_0]) + return formatWithArgumentRanges(self._s[809]!, self._r[809]!, [_0]) } - public var GroupInfo_Location: String { return self._s[809]! } - public var Appearance_ThemePreview_ChatList_5_Name: String { return self._s[810]! } - public var ClearCache_Clear: String { return self._s[811]! } - public var AutoNightTheme_ScheduledFrom: String { return self._s[812]! } - public var PhotoEditor_WarmthTool: String { return self._s[813]! } - public var Passport_Language_tr: String { return self._s[814]! } + public var GroupInfo_Location: String { return self._s[810]! } + public var Appearance_ThemePreview_ChatList_5_Name: String { return self._s[811]! } + public var ClearCache_Clear: String { return self._s[812]! } + public var AutoNightTheme_ScheduledFrom: String { return self._s[813]! } + public var PhotoEditor_WarmthTool: String { return self._s[814]! } + public var Passport_Language_tr: String { return self._s[815]! } public func PUSH_MESSAGE_GAME_SCORE(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[815]!, self._r[815]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[816]!, self._r[816]!, [_1, _2, _3]) } - public var Login_ResetAccountProtected_Reset: String { return self._s[817]! } - public var Watch_PhotoView_Title: String { return self._s[818]! } - public var Passport_Phone_Delete: String { return self._s[819]! } - public var Undo_ChatDeletedForBothSides: String { return self._s[820]! } - public var Conversation_EditingMessageMediaEditCurrentPhoto: String { return self._s[821]! } - public var GroupInfo_Permissions: String { return self._s[822]! } - public var PasscodeSettings_TurnPasscodeOff: String { return self._s[823]! } - public var Profile_ShareContactButton: String { return self._s[824]! } - public var ChatSettings_Other: String { return self._s[825]! } - public var UserInfo_NotificationsDisabled: String { return self._s[826]! } - public var CheckoutInfo_ShippingInfoCity: String { return self._s[827]! } - public var LastSeen_WithinAMonth: String { return self._s[828]! } - public var VoiceOver_Chat_PlayHint: String { return self._s[829]! } - public var Conversation_ReportGroupLocation: String { return self._s[830]! } - public var Conversation_EncryptionCanceled: String { return self._s[831]! } - public var MediaPicker_GroupDescription: String { return self._s[832]! } - public var WebSearch_Images: String { return self._s[833]! } + public var Login_ResetAccountProtected_Reset: String { return self._s[818]! } + public var Watch_PhotoView_Title: String { return self._s[819]! } + public var Passport_Phone_Delete: String { return self._s[820]! } + public var Undo_ChatDeletedForBothSides: String { return self._s[821]! } + public var Conversation_EditingMessageMediaEditCurrentPhoto: String { return self._s[822]! } + public var GroupInfo_Permissions: String { return self._s[823]! } + public var PasscodeSettings_TurnPasscodeOff: String { return self._s[824]! } + public var Profile_ShareContactButton: String { return self._s[825]! } + public var ChatSettings_Other: String { return self._s[826]! } + public var UserInfo_NotificationsDisabled: String { return self._s[827]! } + public var CheckoutInfo_ShippingInfoCity: String { return self._s[828]! } + public var LastSeen_WithinAMonth: String { return self._s[829]! } + public var VoiceOver_Chat_PlayHint: String { return self._s[830]! } + public var Conversation_ReportGroupLocation: String { return self._s[831]! } + public var Conversation_EncryptionCanceled: String { return self._s[832]! } + public var MediaPicker_GroupDescription: String { return self._s[833]! } + public var WebSearch_Images: String { return self._s[834]! } public func Channel_Management_PromotedBy(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[834]!, self._r[834]!, [_0]) + return formatWithArgumentRanges(self._s[835]!, self._r[835]!, [_0]) } - public var Message_Photo: String { return self._s[835]! } - public var PasscodeSettings_HelpBottom: String { return self._s[836]! } - public var AutoDownloadSettings_VideosTitle: String { return self._s[837]! } - public var VoiceOver_Media_PlaybackRateChange: String { return self._s[838]! } - public var Passport_Identity_AddDriversLicense: String { return self._s[839]! } - public var TwoStepAuth_EnterPasswordPassword: String { return self._s[840]! } - public var NotificationsSound_Calypso: String { return self._s[841]! } - public var Map_Map: String { return self._s[842]! } - public var CheckoutInfo_ReceiverInfoTitle: String { return self._s[844]! } - public var ChatSettings_TextSizeUnits: String { return self._s[845]! } + public var Message_Photo: String { return self._s[836]! } + public var PasscodeSettings_HelpBottom: String { return self._s[837]! } + public var AutoDownloadSettings_VideosTitle: String { return self._s[838]! } + public var VoiceOver_Media_PlaybackRateChange: String { return self._s[839]! } + public var Passport_Identity_AddDriversLicense: String { return self._s[840]! } + public var TwoStepAuth_EnterPasswordPassword: String { return self._s[841]! } + public var NotificationsSound_Calypso: String { return self._s[842]! } + public var Map_Map: String { return self._s[843]! } + public var CheckoutInfo_ReceiverInfoTitle: String { return self._s[845]! } + public var ChatSettings_TextSizeUnits: String { return self._s[846]! } public func VoiceOver_Chat_FileFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[846]!, self._r[846]!, [_0]) + return formatWithArgumentRanges(self._s[847]!, self._r[847]!, [_0]) } - public var Common_of: String { return self._s[847]! } - public var Conversation_ForwardContacts: String { return self._s[850]! } + public var Common_of: String { return self._s[848]! } + public var Conversation_ForwardContacts: String { return self._s[851]! } public func Call_AnsweringWithAccount(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[852]!, self._r[852]!, [_0]) + return formatWithArgumentRanges(self._s[853]!, self._r[853]!, [_0]) } - public var Passport_Language_hy: String { return self._s[853]! } - public var Notifications_MessageNotificationsHelp: String { return self._s[854]! } - public var AutoDownloadSettings_Reset: String { return self._s[855]! } - public var Wallet_TransactionInfo_AddressCopied: String { return self._s[856]! } - public var Paint_ClearConfirm: String { return self._s[857]! } - public var Camera_VideoMode: String { return self._s[858]! } + public var Passport_Language_hy: String { return self._s[854]! } + public var Notifications_MessageNotificationsHelp: String { return self._s[855]! } + public var AutoDownloadSettings_Reset: String { return self._s[856]! } + public var Wallet_TransactionInfo_AddressCopied: String { return self._s[857]! } + public var Paint_ClearConfirm: String { return self._s[858]! } + public var Camera_VideoMode: String { return self._s[859]! } public func Conversation_RestrictedStickersTimed(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[859]!, self._r[859]!, [_0]) + return formatWithArgumentRanges(self._s[860]!, self._r[860]!, [_0]) } - public var Privacy_Calls_AlwaysAllow_Placeholder: String { return self._s[860]! } - public var Conversation_ViewBackground: String { return self._s[861]! } + public var Privacy_Calls_AlwaysAllow_Placeholder: String { return self._s[861]! } + public var Conversation_ViewBackground: String { return self._s[862]! } public func Wallet_Info_TransactionDateHeaderYear(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[862]!, self._r[862]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[863]!, self._r[863]!, [_1, _2, _3]) } - public var Passport_Language_el: String { return self._s[863]! } - public var PhotoEditor_Original: String { return self._s[864]! } - public var Settings_FAQ_Button: String { return self._s[866]! } - public var Channel_Setup_PublicNoLink: String { return self._s[868]! } - public var Conversation_UnsupportedMedia: String { return self._s[869]! } - public var Conversation_SlideToCancel: String { return self._s[870]! } - public var Appearance_ThemePreview_ChatList_4_Name: String { return self._s[871]! } - public var Passport_Identity_OneOfTypeInternalPassport: String { return self._s[872]! } - public var CheckoutInfo_ShippingInfoPostcode: String { return self._s[873]! } - public var Conversation_ReportSpamChannelConfirmation: String { return self._s[874]! } - public var AutoNightTheme_NotAvailable: String { return self._s[875]! } - public var Conversation_Owner: String { return self._s[876]! } - public var Common_Create: String { return self._s[877]! } - public var Settings_ApplyProxyAlertEnable: String { return self._s[878]! } - public var ContactList_Context_Call: String { return self._s[879]! } - public var Localization_ChooseLanguage: String { return self._s[881]! } - public var ChatList_Context_AddToContacts: String { return self._s[883]! } - public var Settings_Proxy: String { return self._s[885]! } - public var Privacy_TopPeersHelp: String { return self._s[886]! } - public var CheckoutInfo_ShippingInfoCountryPlaceholder: String { return self._s[887]! } - public var Chat_UnsendMyMessages: String { return self._s[888]! } + public var Passport_Language_el: String { return self._s[864]! } + public var PhotoEditor_Original: String { return self._s[865]! } + public var Settings_FAQ_Button: String { return self._s[867]! } + public var Channel_Setup_PublicNoLink: String { return self._s[869]! } + public var Conversation_UnsupportedMedia: String { return self._s[870]! } + public var Conversation_SlideToCancel: String { return self._s[871]! } + public var Appearance_ThemePreview_ChatList_4_Name: String { return self._s[872]! } + public var Passport_Identity_OneOfTypeInternalPassport: String { return self._s[873]! } + public var CheckoutInfo_ShippingInfoPostcode: String { return self._s[874]! } + public var Conversation_ReportSpamChannelConfirmation: String { return self._s[875]! } + public var AutoNightTheme_NotAvailable: String { return self._s[876]! } + public var Conversation_Owner: String { return self._s[877]! } + public var Common_Create: String { return self._s[878]! } + public var Settings_ApplyProxyAlertEnable: String { return self._s[879]! } + public var ContactList_Context_Call: String { return self._s[880]! } + public var Localization_ChooseLanguage: String { return self._s[882]! } + public var ChatList_Context_AddToContacts: String { return self._s[884]! } + public var Settings_Proxy: String { return self._s[886]! } + public var Privacy_TopPeersHelp: String { return self._s[887]! } + public var CheckoutInfo_ShippingInfoCountryPlaceholder: String { return self._s[888]! } + public var Chat_UnsendMyMessages: String { return self._s[889]! } public func VoiceOver_Chat_Duration(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[889]!, self._r[889]!, [_0]) + return formatWithArgumentRanges(self._s[890]!, self._r[890]!, [_0]) } - public var TwoStepAuth_ConfirmationAbort: String { return self._s[890]! } + public var TwoStepAuth_ConfirmationAbort: String { return self._s[891]! } public func Contacts_AccessDeniedHelpPortrait(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[892]!, self._r[892]!, [_0]) + return formatWithArgumentRanges(self._s[893]!, self._r[893]!, [_0]) } - public var Contacts_SortedByPresence: String { return self._s[893]! } - public var Passport_Identity_SurnamePlaceholder: String { return self._s[894]! } - public var Cache_Title: String { return self._s[895]! } + public var Contacts_SortedByPresence: String { return self._s[894]! } + public var Passport_Identity_SurnamePlaceholder: String { return self._s[895]! } + public var Cache_Title: String { return self._s[896]! } public func Login_PhoneBannedEmailSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[896]!, self._r[896]!, [_0]) + return formatWithArgumentRanges(self._s[897]!, self._r[897]!, [_0]) } - public var TwoStepAuth_EmailCodeExpired: String { return self._s[897]! } - public var Channel_Moderator_Title: String { return self._s[898]! } - public var InstantPage_AutoNightTheme: String { return self._s[900]! } + public var TwoStepAuth_EmailCodeExpired: String { return self._s[898]! } + public var Channel_Moderator_Title: String { return self._s[899]! } + public var InstantPage_AutoNightTheme: String { return self._s[901]! } public func PUSH_MESSAGE_POLL(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[903]!, self._r[903]!, [_1]) + return formatWithArgumentRanges(self._s[904]!, self._r[904]!, [_1]) } - public var Passport_Scans_Upload: String { return self._s[904]! } - public var Undo_Undo: String { return self._s[906]! } - public var Contacts_AccessDeniedHelpON: String { return self._s[907]! } - public var TwoStepAuth_RemovePassword: String { return self._s[908]! } - public var Common_Delete: String { return self._s[909]! } - public var Contacts_AddPeopleNearby: String { return self._s[911]! } - public var Conversation_ContextMenuDelete: String { return self._s[912]! } - public var SocksProxySetup_Credentials: String { return self._s[913]! } - public var Appearance_EditTheme: String { return self._s[915]! } - public var ClearCache_StorageOtherApps: String { return self._s[916]! } - public var PasscodeSettings_AutoLock_Disabled: String { return self._s[917]! } - public var Wallet_Send_NetworkErrorText: String { return self._s[918]! } - public var Passport_Address_OneOfTypeRentalAgreement: String { return self._s[921]! } - public var Conversation_ShareBotContactConfirmationTitle: String { return self._s[922]! } - public var Passport_Language_id: String { return self._s[924]! } - public var WallpaperSearch_ColorTeal: String { return self._s[925]! } - public var ChannelIntro_Title: String { return self._s[926]! } + public var Passport_Scans_Upload: String { return self._s[905]! } + public var Undo_Undo: String { return self._s[907]! } + public var Contacts_AccessDeniedHelpON: String { return self._s[908]! } + public var TwoStepAuth_RemovePassword: String { return self._s[909]! } + public var Common_Delete: String { return self._s[910]! } + public var Contacts_AddPeopleNearby: String { return self._s[912]! } + public var Conversation_ContextMenuDelete: String { return self._s[913]! } + public var SocksProxySetup_Credentials: String { return self._s[914]! } + public var Appearance_EditTheme: String { return self._s[916]! } + public var ClearCache_StorageOtherApps: String { return self._s[917]! } + public var PasscodeSettings_AutoLock_Disabled: String { return self._s[918]! } + public var Wallet_Send_NetworkErrorText: String { return self._s[919]! } + public var Passport_Address_OneOfTypeRentalAgreement: String { return self._s[922]! } + public var Conversation_ShareBotContactConfirmationTitle: String { return self._s[923]! } + public var Passport_Language_id: String { return self._s[925]! } + public var WallpaperSearch_ColorTeal: String { return self._s[926]! } + public var ChannelIntro_Title: String { return self._s[927]! } public func Channel_AdminLog_MessageToggleSignaturesOff(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[927]!, self._r[927]!, [_0]) + return formatWithArgumentRanges(self._s[928]!, self._r[928]!, [_0]) } - public var VoiceOver_Chat_OpenLinkHint: String { return self._s[929]! } - public var VoiceOver_Chat_Reply: String { return self._s[930]! } - public var ScheduledMessages_BotActionUnavailable: String { return self._s[931]! } - public var Channel_Info_Description: String { return self._s[932]! } - public var Stickers_FavoriteStickers: String { return self._s[933]! } - public var Channel_BanUser_PermissionAddMembers: String { return self._s[934]! } - public var Notifications_DisplayNamesOnLockScreen: String { return self._s[935]! } - public var ChatSearch_ResultsTooltip: String { return self._s[936]! } - public var Wallet_VoiceOver_Editing_ClearText: String { return self._s[937]! } - public var Calls_NoMissedCallsPlacehoder: String { return self._s[938]! } - public var Group_PublicLink_Placeholder: String { return self._s[939]! } - public var Notifications_ExceptionsDefaultSound: String { return self._s[940]! } + public var VoiceOver_Chat_OpenLinkHint: String { return self._s[930]! } + public var VoiceOver_Chat_Reply: String { return self._s[931]! } + public var ScheduledMessages_BotActionUnavailable: String { return self._s[932]! } + public var Channel_Info_Description: String { return self._s[933]! } + public var Stickers_FavoriteStickers: String { return self._s[934]! } + public var Channel_BanUser_PermissionAddMembers: String { return self._s[935]! } + public var Notifications_DisplayNamesOnLockScreen: String { return self._s[936]! } + public var ChatSearch_ResultsTooltip: String { return self._s[937]! } + public var Wallet_VoiceOver_Editing_ClearText: String { return self._s[938]! } + public var Calls_NoMissedCallsPlacehoder: String { return self._s[939]! } + public var Group_PublicLink_Placeholder: String { return self._s[940]! } + public var Notifications_ExceptionsDefaultSound: String { return self._s[941]! } public func PUSH_CHANNEL_MESSAGE_POLL(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[941]!, self._r[941]!, [_1]) + return formatWithArgumentRanges(self._s[942]!, self._r[942]!, [_1]) } - public var TextFormat_Underline: String { return self._s[942]! } + public var TextFormat_Underline: String { return self._s[943]! } public func DialogList_SearchSubtitleFormat(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[943]!, self._r[943]!, [_1, _2]) + return formatWithArgumentRanges(self._s[944]!, self._r[944]!, [_1, _2]) } public func Channel_AdminLog_MessageRemovedGroupStickerPack(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[944]!, self._r[944]!, [_0]) + return formatWithArgumentRanges(self._s[945]!, self._r[945]!, [_0]) } - public var Appearance_ThemePreview_ChatList_3_Name: String { return self._s[945]! } + public var Appearance_ThemePreview_ChatList_3_Name: String { return self._s[946]! } public func Channel_OwnershipTransfer_TransferCompleted(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[946]!, self._r[946]!, [_1, _2]) + return formatWithArgumentRanges(self._s[947]!, self._r[947]!, [_1, _2]) } - public var Wallet_Intro_ImportExisting: String { return self._s[947]! } - public var GroupPermission_Delete: String { return self._s[948]! } - public var Passport_Language_uk: String { return self._s[949]! } - public var StickerPack_HideStickers: String { return self._s[951]! } - public var ChangePhoneNumberNumber_NumberPlaceholder: String { return self._s[952]! } + public var Wallet_Intro_ImportExisting: String { return self._s[948]! } + public var GroupPermission_Delete: String { return self._s[949]! } + public var Passport_Language_uk: String { return self._s[950]! } + public var StickerPack_HideStickers: String { return self._s[952]! } + public var ChangePhoneNumberNumber_NumberPlaceholder: String { return self._s[953]! } public func PUSH_CHAT_MESSAGE_PHOTO(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[953]!, self._r[953]!, [_1, _2]) + return formatWithArgumentRanges(self._s[954]!, self._r[954]!, [_1, _2]) } - public var Activity_UploadingVideoMessage: String { return self._s[954]! } + public var Activity_UploadingVideoMessage: String { return self._s[955]! } public func GroupPermission_ApplyAlertText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[955]!, self._r[955]!, [_0]) + return formatWithArgumentRanges(self._s[956]!, self._r[956]!, [_0]) } - public var Channel_TitleInfo: String { return self._s[956]! } - public var StickerPacksSettings_ArchivedPacks_Info: String { return self._s[957]! } - public var Settings_CallSettings: String { return self._s[958]! } - public var Camera_SquareMode: String { return self._s[959]! } - public var Conversation_SendMessage_ScheduleMessage: String { return self._s[960]! } - public var GroupInfo_SharedMediaNone: String { return self._s[961]! } + public var Channel_TitleInfo: String { return self._s[957]! } + public var StickerPacksSettings_ArchivedPacks_Info: String { return self._s[958]! } + public var Settings_CallSettings: String { return self._s[959]! } + public var Camera_SquareMode: String { return self._s[960]! } + public var Conversation_SendMessage_ScheduleMessage: String { return self._s[961]! } + public var GroupInfo_SharedMediaNone: String { return self._s[962]! } public func PUSH_MESSAGE_VIDEO_SECRET(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[962]!, self._r[962]!, [_1]) + return formatWithArgumentRanges(self._s[963]!, self._r[963]!, [_1]) } - public var Bot_GenericBotStatus: String { return self._s[963]! } - public var Application_Update: String { return self._s[965]! } - public var Month_ShortJanuary: String { return self._s[966]! } - public var Contacts_PermissionsKeepDisabled: String { return self._s[967]! } - public var Channel_AdminLog_BanReadMessages: String { return self._s[968]! } - public var Settings_AppLanguage_Unofficial: String { return self._s[969]! } - public var Passport_Address_Street2Placeholder: String { return self._s[970]! } + public var Bot_GenericBotStatus: String { return self._s[964]! } + public var Application_Update: String { return self._s[966]! } + public var Month_ShortJanuary: String { return self._s[967]! } + public var Contacts_PermissionsKeepDisabled: String { return self._s[968]! } + public var Channel_AdminLog_BanReadMessages: String { return self._s[969]! } + public var Settings_AppLanguage_Unofficial: String { return self._s[970]! } + public var Passport_Address_Street2Placeholder: String { return self._s[971]! } public func Map_LiveLocationShortHour(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[971]!, self._r[971]!, [_0]) + return formatWithArgumentRanges(self._s[972]!, self._r[972]!, [_0]) } - public var NetworkUsageSettings_Cellular: String { return self._s[972]! } - public var Appearance_PreviewOutgoingText: String { return self._s[973]! } - public var Notifications_PermissionsAllowInSettings: String { return self._s[974]! } - public var AutoDownloadSettings_OnForAll: String { return self._s[976]! } - public var Map_Directions: String { return self._s[977]! } - public var Passport_FieldIdentityTranslationHelp: String { return self._s[979]! } - public var Appearance_ThemeDay: String { return self._s[980]! } - public var LogoutOptions_LogOut: String { return self._s[981]! } - public var Group_PublicLink_Title: String { return self._s[983]! } - public var Channel_AddBotErrorNoRights: String { return self._s[984]! } - public var Passport_Identity_AddPassport: String { return self._s[985]! } - public var LocalGroup_ButtonTitle: String { return self._s[986]! } - public var Call_Message: String { return self._s[987]! } - public var PhotoEditor_ExposureTool: String { return self._s[988]! } - public var Wallet_Receive_CommentInfo: String { return self._s[990]! } - public var Passport_FieldOneOf_Delimeter: String { return self._s[991]! } - public var Channel_AdminLog_CanBanUsers: String { return self._s[993]! } - public var Appearance_ThemePreview_ChatList_2_Name: String { return self._s[994]! } - public var Appearance_Preview: String { return self._s[995]! } - public var Compose_ChannelMembers: String { return self._s[996]! } - public var Conversation_DeleteManyMessages: String { return self._s[997]! } - public var ReportPeer_ReasonOther_Title: String { return self._s[998]! } - public var Checkout_ErrorProviderAccountTimeout: String { return self._s[999]! } - public var TwoStepAuth_ResetAccountConfirmation: String { return self._s[1000]! } - public var Channel_Stickers_CreateYourOwn: String { return self._s[1003]! } - public var Conversation_UpdateTelegram: String { return self._s[1004]! } - public var EditTheme_Create_TopInfo: String { return self._s[1005]! } + public var NetworkUsageSettings_Cellular: String { return self._s[973]! } + public var Appearance_PreviewOutgoingText: String { return self._s[974]! } + public var Notifications_PermissionsAllowInSettings: String { return self._s[975]! } + public var AutoDownloadSettings_OnForAll: String { return self._s[977]! } + public var Map_Directions: String { return self._s[978]! } + public var Passport_FieldIdentityTranslationHelp: String { return self._s[980]! } + public var Appearance_ThemeDay: String { return self._s[981]! } + public var LogoutOptions_LogOut: String { return self._s[982]! } + public var Group_PublicLink_Title: String { return self._s[984]! } + public var Channel_AddBotErrorNoRights: String { return self._s[985]! } + public var Passport_Identity_AddPassport: String { return self._s[986]! } + public var LocalGroup_ButtonTitle: String { return self._s[987]! } + public var Call_Message: String { return self._s[988]! } + public var PhotoEditor_ExposureTool: String { return self._s[989]! } + public var Wallet_Receive_CommentInfo: String { return self._s[991]! } + public var Passport_FieldOneOf_Delimeter: String { return self._s[992]! } + public var Channel_AdminLog_CanBanUsers: String { return self._s[994]! } + public var Appearance_ThemePreview_ChatList_2_Name: String { return self._s[995]! } + public var Appearance_Preview: String { return self._s[996]! } + public var Compose_ChannelMembers: String { return self._s[997]! } + public var Conversation_DeleteManyMessages: String { return self._s[998]! } + public var ReportPeer_ReasonOther_Title: String { return self._s[999]! } + public var Checkout_ErrorProviderAccountTimeout: String { return self._s[1000]! } + public var TwoStepAuth_ResetAccountConfirmation: String { return self._s[1001]! } + public var Channel_Stickers_CreateYourOwn: String { return self._s[1004]! } + public var Conversation_UpdateTelegram: String { return self._s[1005]! } + public var EditTheme_Create_TopInfo: String { return self._s[1006]! } public func Notification_PinnedPhotoMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1006]!, self._r[1006]!, [_0]) + return formatWithArgumentRanges(self._s[1007]!, self._r[1007]!, [_0]) } - public var Wallet_WordCheck_Continue: String { return self._s[1007]! } - public var TwoFactorSetup_Hint_Action: String { return self._s[1008]! } + public var Wallet_WordCheck_Continue: String { return self._s[1008]! } + public var TwoFactorSetup_Hint_Action: String { return self._s[1009]! } public func PUSH_PINNED_GIF(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1009]!, self._r[1009]!, [_1]) + return formatWithArgumentRanges(self._s[1010]!, self._r[1010]!, [_1]) } - public var GroupInfo_Administrators_Title: String { return self._s[1010]! } - public var Privacy_Forwards_PreviewMessageText: String { return self._s[1011]! } + public var GroupInfo_Administrators_Title: String { return self._s[1011]! } + public var Privacy_Forwards_PreviewMessageText: String { return self._s[1012]! } public func PrivacySettings_LastSeenNobodyPlus(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1012]!, self._r[1012]!, [_0]) + return formatWithArgumentRanges(self._s[1013]!, self._r[1013]!, [_0]) } - public var Tour_Title3: String { return self._s[1013]! } - public var Channel_EditAdmin_PermissionInviteSubscribers: String { return self._s[1014]! } - public var Clipboard_SendPhoto: String { return self._s[1018]! } - public var MediaPicker_Videos: String { return self._s[1019]! } - public var Passport_Email_Title: String { return self._s[1020]! } + public var Tour_Title3: String { return self._s[1014]! } + public var Channel_EditAdmin_PermissionInviteSubscribers: String { return self._s[1015]! } + public var Clipboard_SendPhoto: String { return self._s[1019]! } + public var MediaPicker_Videos: String { return self._s[1020]! } + public var Passport_Email_Title: String { return self._s[1021]! } public func PrivacySettings_LastSeenEverybodyMinus(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1021]!, self._r[1021]!, [_0]) + return formatWithArgumentRanges(self._s[1022]!, self._r[1022]!, [_0]) } - public var StickerPacksSettings_Title: String { return self._s[1022]! } - public var Conversation_MessageDialogDelete: String { return self._s[1023]! } - public var Privacy_Calls_CustomHelp: String { return self._s[1025]! } - public var Message_Wallpaper: String { return self._s[1026]! } - public var MemberSearch_BotSection: String { return self._s[1027]! } - public var GroupInfo_SetSound: String { return self._s[1028]! } - public var Core_ServiceUserStatus: String { return self._s[1029]! } - public var LiveLocationUpdated_JustNow: String { return self._s[1030]! } - public var Call_StatusFailed: String { return self._s[1031]! } - public var TwoFactorSetup_Email_Placeholder: String { return self._s[1032]! } - public var TwoStepAuth_SetupPasswordDescription: String { return self._s[1033]! } - public var TwoStepAuth_SetPassword: String { return self._s[1034]! } - public var Permissions_PeopleNearbyText_v0: String { return self._s[1035]! } + public var StickerPacksSettings_Title: String { return self._s[1023]! } + public var Conversation_MessageDialogDelete: String { return self._s[1024]! } + public var Privacy_Calls_CustomHelp: String { return self._s[1026]! } + public var Message_Wallpaper: String { return self._s[1027]! } + public var MemberSearch_BotSection: String { return self._s[1028]! } + public var GroupInfo_SetSound: String { return self._s[1029]! } + public var Core_ServiceUserStatus: String { return self._s[1030]! } + public var LiveLocationUpdated_JustNow: String { return self._s[1031]! } + public var Call_StatusFailed: String { return self._s[1032]! } + public var TwoFactorSetup_Email_Placeholder: String { return self._s[1033]! } + public var TwoStepAuth_SetupPasswordDescription: String { return self._s[1034]! } + public var TwoStepAuth_SetPassword: String { return self._s[1035]! } + public var Permissions_PeopleNearbyText_v0: String { return self._s[1036]! } public func SocksProxySetup_ProxyStatusPing(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1037]!, self._r[1037]!, [_0]) + return formatWithArgumentRanges(self._s[1038]!, self._r[1038]!, [_0]) } - public var Calls_SubmitRating: String { return self._s[1038]! } - public var Profile_Username: String { return self._s[1039]! } - public var Bot_DescriptionTitle: String { return self._s[1040]! } - public var MaskStickerSettings_Title: String { return self._s[1041]! } - public var SharedMedia_CategoryOther: String { return self._s[1042]! } - public var GroupInfo_SetGroupPhoto: String { return self._s[1043]! } - public var Common_NotNow: String { return self._s[1044]! } - public var CallFeedback_IncludeLogsInfo: String { return self._s[1045]! } - public var Conversation_ShareMyPhoneNumber: String { return self._s[1046]! } - public var Map_Location: String { return self._s[1047]! } - public var Invitation_JoinGroup: String { return self._s[1048]! } - public var AutoDownloadSettings_Title: String { return self._s[1050]! } - public var Conversation_DiscardVoiceMessageDescription: String { return self._s[1051]! } - public var Channel_ErrorAddBlocked: String { return self._s[1052]! } - public var Conversation_UnblockUser: String { return self._s[1053]! } - public var EditTheme_Edit_TopInfo: String { return self._s[1054]! } - public var Watch_Bot_Restart: String { return self._s[1055]! } - public var TwoStepAuth_Title: String { return self._s[1056]! } - public var Channel_AdminLog_BanSendMessages: String { return self._s[1057]! } - public var Checkout_ShippingMethod: String { return self._s[1058]! } - public var Passport_Identity_OneOfTypeIdentityCard: String { return self._s[1059]! } + public var Calls_SubmitRating: String { return self._s[1039]! } + public var Profile_Username: String { return self._s[1040]! } + public var Bot_DescriptionTitle: String { return self._s[1041]! } + public var MaskStickerSettings_Title: String { return self._s[1042]! } + public var SharedMedia_CategoryOther: String { return self._s[1043]! } + public var GroupInfo_SetGroupPhoto: String { return self._s[1044]! } + public var Common_NotNow: String { return self._s[1045]! } + public var CallFeedback_IncludeLogsInfo: String { return self._s[1046]! } + public var Conversation_ShareMyPhoneNumber: String { return self._s[1047]! } + public var Map_Location: String { return self._s[1048]! } + public var Invitation_JoinGroup: String { return self._s[1049]! } + public var AutoDownloadSettings_Title: String { return self._s[1051]! } + public var Conversation_DiscardVoiceMessageDescription: String { return self._s[1052]! } + public var Channel_ErrorAddBlocked: String { return self._s[1053]! } + public var Conversation_UnblockUser: String { return self._s[1054]! } + public var EditTheme_Edit_TopInfo: String { return self._s[1055]! } + public var Watch_Bot_Restart: String { return self._s[1056]! } + public var TwoStepAuth_Title: String { return self._s[1057]! } + public var Channel_AdminLog_BanSendMessages: String { return self._s[1058]! } + public var Checkout_ShippingMethod: String { return self._s[1059]! } + public var Passport_Identity_OneOfTypeIdentityCard: String { return self._s[1060]! } public func PUSH_CHAT_MESSAGE_STICKER(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1060]!, self._r[1060]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1061]!, self._r[1061]!, [_1, _2, _3]) } public func Chat_UnsendMyMessagesAlertTitle(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1062]!, self._r[1062]!, [_0]) - } - public func Channel_Username_LinkHint(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1063]!, self._r[1063]!, [_0]) } - public var Appearance_ThemePreview_ChatList_1_Name: String { return self._s[1064]! } - public var SettingsSearch_Synonyms_Data_AutoplayGifs: String { return self._s[1065]! } - public var AuthSessions_TerminateOtherSessions: String { return self._s[1066]! } - public var Contacts_FailedToSendInvitesMessage: String { return self._s[1067]! } - public var PrivacySettings_TwoStepAuth: String { return self._s[1068]! } - public var Notification_Exceptions_PreviewAlwaysOn: String { return self._s[1069]! } - public var SettingsSearch_Synonyms_Privacy_Passcode: String { return self._s[1070]! } - public var Conversation_EditingMessagePanelMedia: String { return self._s[1071]! } - public var Checkout_PaymentMethod_Title: String { return self._s[1072]! } - public var SocksProxySetup_Connection: String { return self._s[1073]! } - public var Group_MessagePhotoRemoved: String { return self._s[1074]! } - public var Channel_Stickers_NotFound: String { return self._s[1077]! } - public var Group_About_Help: String { return self._s[1078]! } - public var Notification_PassportValueProofOfIdentity: String { return self._s[1079]! } - public var PeopleNearby_Title: String { return self._s[1081]! } - public func ApplyLanguage_ChangeLanguageOfficialText(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1082]!, self._r[1082]!, [_1]) + public func Channel_Username_LinkHint(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1064]!, self._r[1064]!, [_0]) } - public var CheckoutInfo_ShippingInfoStatePlaceholder: String { return self._s[1084]! } - public var Notifications_GroupNotificationsExceptionsHelp: String { return self._s[1085]! } - public var SocksProxySetup_Password: String { return self._s[1086]! } - public var Notifications_PermissionsEnable: String { return self._s[1087]! } - public var TwoStepAuth_ChangeEmail: String { return self._s[1089]! } + public var Appearance_ThemePreview_ChatList_1_Name: String { return self._s[1065]! } + public var SettingsSearch_Synonyms_Data_AutoplayGifs: String { return self._s[1066]! } + public var AuthSessions_TerminateOtherSessions: String { return self._s[1067]! } + public var Contacts_FailedToSendInvitesMessage: String { return self._s[1068]! } + public var PrivacySettings_TwoStepAuth: String { return self._s[1069]! } + public var Notification_Exceptions_PreviewAlwaysOn: String { return self._s[1070]! } + public var SettingsSearch_Synonyms_Privacy_Passcode: String { return self._s[1071]! } + public var Conversation_EditingMessagePanelMedia: String { return self._s[1072]! } + public var Checkout_PaymentMethod_Title: String { return self._s[1073]! } + public var SocksProxySetup_Connection: String { return self._s[1074]! } + public var Group_MessagePhotoRemoved: String { return self._s[1075]! } + public var Channel_Stickers_NotFound: String { return self._s[1078]! } + public var Group_About_Help: String { return self._s[1079]! } + public var Notification_PassportValueProofOfIdentity: String { return self._s[1080]! } + public var PeopleNearby_Title: String { return self._s[1082]! } + public func ApplyLanguage_ChangeLanguageOfficialText(_ _1: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1083]!, self._r[1083]!, [_1]) + } + public var CheckoutInfo_ShippingInfoStatePlaceholder: String { return self._s[1085]! } + public var Notifications_GroupNotificationsExceptionsHelp: String { return self._s[1086]! } + public var SocksProxySetup_Password: String { return self._s[1087]! } + public var Notifications_PermissionsEnable: String { return self._s[1088]! } + public var TwoStepAuth_ChangeEmail: String { return self._s[1090]! } public func Channel_AdminLog_MessageInvitedName(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1090]!, self._r[1090]!, [_1]) + return formatWithArgumentRanges(self._s[1091]!, self._r[1091]!, [_1]) } public func Time_MonthOfYear_m10(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1092]!, self._r[1092]!, [_0]) + return formatWithArgumentRanges(self._s[1093]!, self._r[1093]!, [_0]) } - public var Passport_Identity_TypeDriversLicense: String { return self._s[1093]! } - public var ArchivedPacksAlert_Title: String { return self._s[1094]! } - public var Wallet_Receive_InvoiceUrlCopied: String { return self._s[1095]! } + public var Passport_Identity_TypeDriversLicense: String { return self._s[1094]! } + public var ArchivedPacksAlert_Title: String { return self._s[1095]! } + public var Wallet_Receive_InvoiceUrlCopied: String { return self._s[1096]! } public func Time_PreciseDate_m7(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1096]!, self._r[1096]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1097]!, self._r[1097]!, [_1, _2, _3]) } - public var PrivacyLastSeenSettings_GroupsAndChannelsHelp: String { return self._s[1097]! } - public var Privacy_Calls_NeverAllow_Placeholder: String { return self._s[1099]! } - public var Conversation_StatusTyping: String { return self._s[1100]! } - public var Broadcast_AdminLog_EmptyText: String { return self._s[1101]! } - public var Notification_PassportValueProofOfAddress: String { return self._s[1102]! } - public var UserInfo_CreateNewContact: String { return self._s[1103]! } - public var Passport_Identity_FrontSide: String { return self._s[1104]! } - public var Login_PhoneNumberAlreadyAuthorizedSwitch: String { return self._s[1105]! } - public var Calls_CallTabTitle: String { return self._s[1106]! } - public var Channel_AdminLog_ChannelEmptyText: String { return self._s[1107]! } + public var PrivacyLastSeenSettings_GroupsAndChannelsHelp: String { return self._s[1098]! } + public var Privacy_Calls_NeverAllow_Placeholder: String { return self._s[1100]! } + public var Conversation_StatusTyping: String { return self._s[1101]! } + public var Broadcast_AdminLog_EmptyText: String { return self._s[1102]! } + public var Notification_PassportValueProofOfAddress: String { return self._s[1103]! } + public var UserInfo_CreateNewContact: String { return self._s[1104]! } + public var Passport_Identity_FrontSide: String { return self._s[1105]! } + public var Login_PhoneNumberAlreadyAuthorizedSwitch: String { return self._s[1106]! } + public var Calls_CallTabTitle: String { return self._s[1107]! } + public var Channel_AdminLog_ChannelEmptyText: String { return self._s[1108]! } public func Login_BannedPhoneBody(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1109]!, self._r[1109]!, [_0]) + return formatWithArgumentRanges(self._s[1110]!, self._r[1110]!, [_0]) } - public var Watch_UserInfo_MuteTitle: String { return self._s[1110]! } - public var Group_EditAdmin_RankAdminPlaceholder: String { return self._s[1111]! } - public var SharedMedia_EmptyMusicText: String { return self._s[1112]! } - public var Wallet_Completed_Text: String { return self._s[1113]! } - public var PasscodeSettings_AutoLock_IfAwayFor_1minute: String { return self._s[1114]! } - public var Paint_Stickers: String { return self._s[1115]! } - public var Privacy_GroupsAndChannels: String { return self._s[1116]! } - public var ChatList_Context_Delete: String { return self._s[1118]! } - public var UserInfo_AddContact: String { return self._s[1119]! } + public var Watch_UserInfo_MuteTitle: String { return self._s[1111]! } + public var Group_EditAdmin_RankAdminPlaceholder: String { return self._s[1112]! } + public var SharedMedia_EmptyMusicText: String { return self._s[1113]! } + public var Wallet_Completed_Text: String { return self._s[1114]! } + public var PasscodeSettings_AutoLock_IfAwayFor_1minute: String { return self._s[1115]! } + public var Paint_Stickers: String { return self._s[1116]! } + public var Privacy_GroupsAndChannels: String { return self._s[1117]! } + public var ChatList_Context_Delete: String { return self._s[1119]! } + public var UserInfo_AddContact: String { return self._s[1120]! } public func Conversation_MessageViaUser(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1120]!, self._r[1120]!, [_0]) + return formatWithArgumentRanges(self._s[1121]!, self._r[1121]!, [_0]) } - public var PhoneNumberHelp_ChangeNumber: String { return self._s[1122]! } + public var PhoneNumberHelp_ChangeNumber: String { return self._s[1123]! } public func ChatList_ClearChatConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1124]!, self._r[1124]!, [_0]) + return formatWithArgumentRanges(self._s[1125]!, self._r[1125]!, [_0]) } - public var DialogList_NoMessagesTitle: String { return self._s[1125]! } - public var EditProfile_NameAndPhotoHelp: String { return self._s[1126]! } - public var BlockedUsers_BlockUser: String { return self._s[1127]! } - public var Notifications_PermissionsOpenSettings: String { return self._s[1128]! } - public var MediaPicker_UngroupDescription: String { return self._s[1129]! } - public var Watch_NoConnection: String { return self._s[1130]! } - public var Month_GenSeptember: String { return self._s[1131]! } - public var Conversation_ViewGroup: String { return self._s[1133]! } - public var Channel_AdminLogFilter_EventsLeavingSubscribers: String { return self._s[1136]! } - public var Privacy_Forwards_AlwaysLink: String { return self._s[1137]! } - public var Channel_OwnershipTransfer_ErrorAdminsTooMuch: String { return self._s[1138]! } - public var Passport_FieldOneOf_FinalDelimeter: String { return self._s[1139]! } - public var Wallet_WordCheck_IncorrectHeader: String { return self._s[1140]! } - public var MediaPicker_CameraRoll: String { return self._s[1142]! } - public var Month_GenAugust: String { return self._s[1143]! } - public var Wallet_Configuration_SourceHeader: String { return self._s[1144]! } - public var AccessDenied_VideoMessageMicrophone: String { return self._s[1145]! } - public var SharedMedia_EmptyText: String { return self._s[1146]! } - public var Map_ShareLiveLocation: String { return self._s[1147]! } - public var Calls_All: String { return self._s[1148]! } - public var Appearance_ThemeNight: String { return self._s[1151]! } - public var Conversation_HoldForAudio: String { return self._s[1152]! } - public var SettingsSearch_Synonyms_Support: String { return self._s[1155]! } - public var GroupInfo_GroupHistoryHidden: String { return self._s[1156]! } - public var SocksProxySetup_Secret: String { return self._s[1157]! } + public var DialogList_NoMessagesTitle: String { return self._s[1126]! } + public var EditProfile_NameAndPhotoHelp: String { return self._s[1127]! } + public var BlockedUsers_BlockUser: String { return self._s[1128]! } + public var Notifications_PermissionsOpenSettings: String { return self._s[1129]! } + public var MediaPicker_UngroupDescription: String { return self._s[1130]! } + public var Watch_NoConnection: String { return self._s[1131]! } + public var Month_GenSeptember: String { return self._s[1132]! } + public var Conversation_ViewGroup: String { return self._s[1134]! } + public var Channel_AdminLogFilter_EventsLeavingSubscribers: String { return self._s[1137]! } + public var Privacy_Forwards_AlwaysLink: String { return self._s[1138]! } + public var Channel_OwnershipTransfer_ErrorAdminsTooMuch: String { return self._s[1139]! } + public var Passport_FieldOneOf_FinalDelimeter: String { return self._s[1140]! } + public var Wallet_WordCheck_IncorrectHeader: String { return self._s[1141]! } + public var MediaPicker_CameraRoll: String { return self._s[1143]! } + public var Month_GenAugust: String { return self._s[1144]! } + public var Wallet_Configuration_SourceHeader: String { return self._s[1145]! } + public var AccessDenied_VideoMessageMicrophone: String { return self._s[1146]! } + public var SharedMedia_EmptyText: String { return self._s[1147]! } + public var Map_ShareLiveLocation: String { return self._s[1148]! } + public var Calls_All: String { return self._s[1149]! } + public var Appearance_ThemeNight: String { return self._s[1152]! } + public var Conversation_HoldForAudio: String { return self._s[1153]! } + public var SettingsSearch_Synonyms_Support: String { return self._s[1156]! } + public var GroupInfo_GroupHistoryHidden: String { return self._s[1157]! } + public var SocksProxySetup_Secret: String { return self._s[1158]! } public func Activity_RemindAboutChannel(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1158]!, self._r[1158]!, [_0]) + return formatWithArgumentRanges(self._s[1159]!, self._r[1159]!, [_0]) } - public var Channel_BanList_RestrictedTitle: String { return self._s[1160]! } - public var Conversation_Location: String { return self._s[1161]! } + public var Channel_BanList_RestrictedTitle: String { return self._s[1161]! } + public var Conversation_Location: String { return self._s[1162]! } public func AutoDownloadSettings_UpToFor(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1162]!, self._r[1162]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1163]!, self._r[1163]!, [_1, _2]) } - public var ChatSettings_AutoDownloadPhotos: String { return self._s[1164]! } - public var SettingsSearch_Synonyms_Privacy_Title: String { return self._s[1165]! } - public var Notifications_PermissionsText: String { return self._s[1166]! } - public var SettingsSearch_Synonyms_Data_SaveIncomingPhotos: String { return self._s[1167]! } - public var Call_Flip: String { return self._s[1168]! } - public var Channel_AdminLog_CanDeleteMessagesOfOthers: String { return self._s[1170]! } - public var SocksProxySetup_ProxyStatusConnecting: String { return self._s[1171]! } - public var Wallet_TransactionInfo_StorageFeeInfoUrl: String { return self._s[1172]! } - public var PrivacyPhoneNumberSettings_DiscoveryHeader: String { return self._s[1173]! } - public var Channel_EditAdmin_PermissionPinMessages: String { return self._s[1175]! } - public var TwoStepAuth_ReEnterPasswordDescription: String { return self._s[1177]! } - public var Channel_TooMuchBots: String { return self._s[1179]! } - public var Passport_DeletePassportConfirmation: String { return self._s[1180]! } - public var Login_InvalidCodeError: String { return self._s[1181]! } - public var StickerPacksSettings_FeaturedPacks: String { return self._s[1182]! } + public var ChatSettings_AutoDownloadPhotos: String { return self._s[1165]! } + public var SettingsSearch_Synonyms_Privacy_Title: String { return self._s[1166]! } + public var Notifications_PermissionsText: String { return self._s[1167]! } + public var SettingsSearch_Synonyms_Data_SaveIncomingPhotos: String { return self._s[1168]! } + public var Call_Flip: String { return self._s[1169]! } + public var Channel_AdminLog_CanDeleteMessagesOfOthers: String { return self._s[1171]! } + public var SocksProxySetup_ProxyStatusConnecting: String { return self._s[1172]! } + public var Wallet_TransactionInfo_StorageFeeInfoUrl: String { return self._s[1173]! } + public var PrivacyPhoneNumberSettings_DiscoveryHeader: String { return self._s[1174]! } + public var Channel_EditAdmin_PermissionPinMessages: String { return self._s[1176]! } + public var TwoStepAuth_ReEnterPasswordDescription: String { return self._s[1178]! } + public var Channel_TooMuchBots: String { return self._s[1180]! } + public var Passport_DeletePassportConfirmation: String { return self._s[1181]! } + public var Login_InvalidCodeError: String { return self._s[1182]! } + public var StickerPacksSettings_FeaturedPacks: String { return self._s[1183]! } public func ChatList_DeleteSecretChatConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1183]!, self._r[1183]!, [_0]) - } - public func GroupInfo_InvitationLinkAcceptChannel(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1184]!, self._r[1184]!, [_0]) } - public var VoiceOver_Navigation_ProxySettings: String { return self._s[1185]! } - public var Call_CallInProgressTitle: String { return self._s[1186]! } - public var Month_ShortSeptember: String { return self._s[1187]! } - public var Watch_ChannelInfo_Title: String { return self._s[1188]! } - public var ChatList_DeleteSavedMessagesConfirmation: String { return self._s[1191]! } - public var DialogList_PasscodeLockHelp: String { return self._s[1192]! } - public var Chat_MultipleTextMessagesDisabled: String { return self._s[1193]! } - public var Wallet_Receive_Title: String { return self._s[1194]! } - public var Notifications_Badge_IncludePublicGroups: String { return self._s[1195]! } - public var Channel_AdminLogFilter_EventsTitle: String { return self._s[1196]! } - public var PhotoEditor_CropReset: String { return self._s[1197]! } - public var Group_Username_CreatePrivateLinkHelp: String { return self._s[1199]! } - public var Channel_Management_LabelEditor: String { return self._s[1200]! } - public var Passport_Identity_LatinNameHelp: String { return self._s[1202]! } - public var PhotoEditor_HighlightsTool: String { return self._s[1203]! } - public var Wallet_Info_WalletCreated: String { return self._s[1204]! } - public var UserInfo_Title: String { return self._s[1205]! } - public var ChatList_HideAction: String { return self._s[1206]! } - public var AccessDenied_Title: String { return self._s[1207]! } - public var DialogList_SearchLabel: String { return self._s[1208]! } - public var Group_Setup_HistoryHidden: String { return self._s[1209]! } - public var TwoStepAuth_PasswordChangeSuccess: String { return self._s[1210]! } - public var State_Updating: String { return self._s[1212]! } - public var Contacts_TabTitle: String { return self._s[1213]! } - public var Notifications_Badge_CountUnreadMessages: String { return self._s[1215]! } - public var GroupInfo_GroupHistory: String { return self._s[1216]! } - public var Conversation_UnsupportedMediaPlaceholder: String { return self._s[1217]! } - public var Wallpaper_SetColor: String { return self._s[1218]! } - public var CheckoutInfo_ShippingInfoCountry: String { return self._s[1219]! } - public var SettingsSearch_Synonyms_SavedMessages: String { return self._s[1220]! } - public var Chat_AttachmentLimitReached: String { return self._s[1221]! } - public var Passport_Identity_OneOfTypeDriversLicense: String { return self._s[1222]! } - public var Contacts_NotRegisteredSection: String { return self._s[1223]! } + public func GroupInfo_InvitationLinkAcceptChannel(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1185]!, self._r[1185]!, [_0]) + } + public var VoiceOver_Navigation_ProxySettings: String { return self._s[1186]! } + public var Call_CallInProgressTitle: String { return self._s[1187]! } + public var Month_ShortSeptember: String { return self._s[1188]! } + public var Watch_ChannelInfo_Title: String { return self._s[1189]! } + public var ChatList_DeleteSavedMessagesConfirmation: String { return self._s[1192]! } + public var DialogList_PasscodeLockHelp: String { return self._s[1193]! } + public var Chat_MultipleTextMessagesDisabled: String { return self._s[1194]! } + public var Wallet_Receive_Title: String { return self._s[1195]! } + public var Notifications_Badge_IncludePublicGroups: String { return self._s[1196]! } + public var Channel_AdminLogFilter_EventsTitle: String { return self._s[1197]! } + public var PhotoEditor_CropReset: String { return self._s[1198]! } + public var Group_Username_CreatePrivateLinkHelp: String { return self._s[1200]! } + public var Channel_Management_LabelEditor: String { return self._s[1201]! } + public var Passport_Identity_LatinNameHelp: String { return self._s[1203]! } + public var PhotoEditor_HighlightsTool: String { return self._s[1204]! } + public var Wallet_Info_WalletCreated: String { return self._s[1205]! } + public var UserInfo_Title: String { return self._s[1206]! } + public var ChatList_HideAction: String { return self._s[1207]! } + public var AccessDenied_Title: String { return self._s[1208]! } + public var DialogList_SearchLabel: String { return self._s[1209]! } + public var Group_Setup_HistoryHidden: String { return self._s[1210]! } + public var TwoStepAuth_PasswordChangeSuccess: String { return self._s[1211]! } + public var State_Updating: String { return self._s[1213]! } + public var Contacts_TabTitle: String { return self._s[1214]! } + public var Notifications_Badge_CountUnreadMessages: String { return self._s[1216]! } + public var GroupInfo_GroupHistory: String { return self._s[1217]! } + public var Conversation_UnsupportedMediaPlaceholder: String { return self._s[1218]! } + public var Wallpaper_SetColor: String { return self._s[1219]! } + public var CheckoutInfo_ShippingInfoCountry: String { return self._s[1220]! } + public var SettingsSearch_Synonyms_SavedMessages: String { return self._s[1221]! } + public var Chat_AttachmentLimitReached: String { return self._s[1222]! } + public var Passport_Identity_OneOfTypeDriversLicense: String { return self._s[1223]! } + public var Contacts_NotRegisteredSection: String { return self._s[1224]! } public func Time_PreciseDate_m4(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1224]!, self._r[1224]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1225]!, self._r[1225]!, [_1, _2, _3]) } - public var Paint_Clear: String { return self._s[1225]! } - public var StickerPacksSettings_ArchivedMasks: String { return self._s[1226]! } - public var SocksProxySetup_Connecting: String { return self._s[1227]! } - public var ExplicitContent_AlertChannel: String { return self._s[1228]! } - public var CreatePoll_AllOptionsAdded: String { return self._s[1229]! } - public var Conversation_Contact: String { return self._s[1230]! } - public var Login_CodeExpired: String { return self._s[1231]! } - public var Passport_DiscardMessageAction: String { return self._s[1232]! } - public var ChatList_Context_Unpin: String { return self._s[1233]! } - public var Channel_AdminLog_MessagePreviousDescription: String { return self._s[1234]! } + public var Paint_Clear: String { return self._s[1226]! } + public var StickerPacksSettings_ArchivedMasks: String { return self._s[1227]! } + public var SocksProxySetup_Connecting: String { return self._s[1228]! } + public var ExplicitContent_AlertChannel: String { return self._s[1229]! } + public var CreatePoll_AllOptionsAdded: String { return self._s[1230]! } + public var Conversation_Contact: String { return self._s[1231]! } + public var Login_CodeExpired: String { return self._s[1232]! } + public var Passport_DiscardMessageAction: String { return self._s[1233]! } + public var ChatList_Context_Unpin: String { return self._s[1234]! } + public var Channel_AdminLog_MessagePreviousDescription: String { return self._s[1235]! } public func VoiceOver_Chat_MusicFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1235]!, self._r[1235]!, [_0]) + return formatWithArgumentRanges(self._s[1236]!, self._r[1236]!, [_0]) } - public var Channel_AdminLog_EmptyMessageText: String { return self._s[1236]! } - public var SettingsSearch_Synonyms_Data_NetworkUsage: String { return self._s[1237]! } + public var Channel_AdminLog_EmptyMessageText: String { return self._s[1237]! } + public var SettingsSearch_Synonyms_Data_NetworkUsage: String { return self._s[1238]! } public func Group_EditAdmin_RankInfo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1238]!, self._r[1238]!, [_0]) + return formatWithArgumentRanges(self._s[1239]!, self._r[1239]!, [_0]) } - public var Month_ShortApril: String { return self._s[1239]! } - public var AuthSessions_CurrentSession: String { return self._s[1240]! } - public var Chat_AttachmentMultipleFilesDisabled: String { return self._s[1243]! } - public var Wallet_Navigation_Cancel: String { return self._s[1245]! } - public var WallpaperPreview_CropTopText: String { return self._s[1246]! } - public var PrivacySettings_DeleteAccountIfAwayFor: String { return self._s[1247]! } - public var CheckoutInfo_ShippingInfoTitle: String { return self._s[1248]! } + public var Month_ShortApril: String { return self._s[1240]! } + public var AuthSessions_CurrentSession: String { return self._s[1241]! } + public var Chat_AttachmentMultipleFilesDisabled: String { return self._s[1244]! } + public var Wallet_Navigation_Cancel: String { return self._s[1246]! } + public var WallpaperPreview_CropTopText: String { return self._s[1247]! } + public var PrivacySettings_DeleteAccountIfAwayFor: String { return self._s[1248]! } + public var CheckoutInfo_ShippingInfoTitle: String { return self._s[1249]! } public func Conversation_ScheduleMessage_SendOn(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1249]!, self._r[1249]!, [_0, _1]) + return formatWithArgumentRanges(self._s[1250]!, self._r[1250]!, [_0, _1]) } - public var Appearance_ThemePreview_Chat_2_Text: String { return self._s[1250]! } - public var Channel_Setup_TypePrivate: String { return self._s[1252]! } - public var Forward_ChannelReadOnly: String { return self._s[1255]! } - public var PhotoEditor_CurvesBlue: String { return self._s[1256]! } - public var AddContact_SharedContactException: String { return self._s[1257]! } - public var UserInfo_BotPrivacy: String { return self._s[1259]! } - public var Wallet_CreateInvoice_Title: String { return self._s[1260]! } - public var Notification_PassportValueEmail: String { return self._s[1261]! } - public var EmptyGroupInfo_Subtitle: String { return self._s[1262]! } - public var GroupPermission_NewTitle: String { return self._s[1263]! } - public var CallFeedback_ReasonDropped: String { return self._s[1264]! } - public var GroupInfo_Permissions_AddException: String { return self._s[1265]! } - public var Channel_SignMessages_Help: String { return self._s[1267]! } - public var Undo_ChatDeleted: String { return self._s[1269]! } - public var Conversation_ChatBackground: String { return self._s[1270]! } + public var Appearance_ThemePreview_Chat_2_Text: String { return self._s[1251]! } + public var Channel_Setup_TypePrivate: String { return self._s[1253]! } + public var Forward_ChannelReadOnly: String { return self._s[1256]! } + public var PhotoEditor_CurvesBlue: String { return self._s[1257]! } + public var AddContact_SharedContactException: String { return self._s[1258]! } + public var UserInfo_BotPrivacy: String { return self._s[1260]! } + public var Wallet_CreateInvoice_Title: String { return self._s[1261]! } + public var Notification_PassportValueEmail: String { return self._s[1262]! } + public var EmptyGroupInfo_Subtitle: String { return self._s[1263]! } + public var GroupPermission_NewTitle: String { return self._s[1264]! } + public var CallFeedback_ReasonDropped: String { return self._s[1265]! } + public var GroupInfo_Permissions_AddException: String { return self._s[1266]! } + public var Channel_SignMessages_Help: String { return self._s[1268]! } + public var Undo_ChatDeleted: String { return self._s[1270]! } + public var Conversation_ChatBackground: String { return self._s[1271]! } public func Wallet_WordCheck_Text(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1271]!, self._r[1271]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1272]!, self._r[1272]!, [_1, _2, _3]) } - public var ChannelMembers_WhoCanAddMembers_Admins: String { return self._s[1272]! } - public var FastTwoStepSetup_EmailPlaceholder: String { return self._s[1273]! } - public var Passport_Language_pt: String { return self._s[1274]! } - public var VoiceOver_Chat_YourVoiceMessage: String { return self._s[1275]! } - public var NotificationsSound_Popcorn: String { return self._s[1278]! } - public var AutoNightTheme_Disabled: String { return self._s[1279]! } - public var BlockedUsers_LeavePrefix: String { return self._s[1280]! } - public var WallpaperPreview_CustomColorTopText: String { return self._s[1281]! } - public var Contacts_PermissionsSuppressWarningText: String { return self._s[1282]! } - public var WallpaperSearch_ColorBlue: String { return self._s[1283]! } + public var ChannelMembers_WhoCanAddMembers_Admins: String { return self._s[1273]! } + public var FastTwoStepSetup_EmailPlaceholder: String { return self._s[1274]! } + public var Passport_Language_pt: String { return self._s[1275]! } + public var VoiceOver_Chat_YourVoiceMessage: String { return self._s[1276]! } + public var NotificationsSound_Popcorn: String { return self._s[1279]! } + public var AutoNightTheme_Disabled: String { return self._s[1280]! } + public var BlockedUsers_LeavePrefix: String { return self._s[1281]! } + public var WallpaperPreview_CustomColorTopText: String { return self._s[1282]! } + public var Contacts_PermissionsSuppressWarningText: String { return self._s[1283]! } + public var WallpaperSearch_ColorBlue: String { return self._s[1284]! } public func CancelResetAccount_TextSMS(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1284]!, self._r[1284]!, [_0]) + return formatWithArgumentRanges(self._s[1285]!, self._r[1285]!, [_0]) } - public var CheckoutInfo_ErrorNameInvalid: String { return self._s[1285]! } - public var SocksProxySetup_UseForCalls: String { return self._s[1286]! } - public var Passport_DeleteDocumentConfirmation: String { return self._s[1288]! } + public var CheckoutInfo_ErrorNameInvalid: String { return self._s[1286]! } + public var SocksProxySetup_UseForCalls: String { return self._s[1287]! } + public var Passport_DeleteDocumentConfirmation: String { return self._s[1289]! } public func Conversation_Megabytes(_ _0: Float) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1289]!, self._r[1289]!, ["\(_0)"]) + return formatWithArgumentRanges(self._s[1290]!, self._r[1290]!, ["\(_0)"]) } - public var SocksProxySetup_Hostname: String { return self._s[1292]! } - public var ChatSettings_AutoDownloadSettings_OffForAll: String { return self._s[1293]! } - public var Compose_NewEncryptedChat: String { return self._s[1294]! } - public var Login_CodeFloodError: String { return self._s[1295]! } - public var Calls_TabTitle: String { return self._s[1296]! } - public var Privacy_ProfilePhoto: String { return self._s[1297]! } - public var Passport_Language_he: String { return self._s[1298]! } + public var SocksProxySetup_Hostname: String { return self._s[1293]! } + public var ChatSettings_AutoDownloadSettings_OffForAll: String { return self._s[1294]! } + public var Compose_NewEncryptedChat: String { return self._s[1295]! } + public var Login_CodeFloodError: String { return self._s[1296]! } + public var Calls_TabTitle: String { return self._s[1297]! } + public var Privacy_ProfilePhoto: String { return self._s[1298]! } + public var Passport_Language_he: String { return self._s[1299]! } public func Conversation_SetReminder_RemindToday(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1299]!, self._r[1299]!, [_0]) + return formatWithArgumentRanges(self._s[1300]!, self._r[1300]!, [_0]) } - public var GroupPermission_Title: String { return self._s[1300]! } + public var GroupPermission_Title: String { return self._s[1301]! } public func Channel_AdminLog_MessageGroupPreHistoryHidden(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1301]!, self._r[1301]!, [_0]) + return formatWithArgumentRanges(self._s[1302]!, self._r[1302]!, [_0]) } - public var Wallet_TransactionInfo_SenderHeader: String { return self._s[1302]! } - public var GroupPermission_NoChangeInfo: String { return self._s[1303]! } - public var ChatList_DeleteForCurrentUser: String { return self._s[1304]! } - public var Tour_Text1: String { return self._s[1305]! } - public var Channel_EditAdmin_TransferOwnership: String { return self._s[1306]! } - public var Month_ShortFebruary: String { return self._s[1307]! } - public var TwoStepAuth_EmailSkip: String { return self._s[1308]! } + public var Wallet_TransactionInfo_SenderHeader: String { return self._s[1303]! } + public var GroupPermission_NoChangeInfo: String { return self._s[1304]! } + public var ChatList_DeleteForCurrentUser: String { return self._s[1305]! } + public var Tour_Text1: String { return self._s[1306]! } + public var Channel_EditAdmin_TransferOwnership: String { return self._s[1307]! } + public var Month_ShortFebruary: String { return self._s[1308]! } + public var TwoStepAuth_EmailSkip: String { return self._s[1309]! } public func Wallet_Time_PreciseDate_m4(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1309]!, self._r[1309]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1310]!, self._r[1310]!, [_1, _2, _3]) } - public var NotificationsSound_Glass: String { return self._s[1310]! } - public var Appearance_ThemeNightBlue: String { return self._s[1311]! } - public var CheckoutInfo_Pay: String { return self._s[1312]! } - public var Invite_LargeRecipientsCountWarning: String { return self._s[1314]! } - public var Call_CallAgain: String { return self._s[1316]! } - public var AttachmentMenu_SendAsFile: String { return self._s[1317]! } - public var AccessDenied_MicrophoneRestricted: String { return self._s[1318]! } - public var Passport_InvalidPasswordError: String { return self._s[1319]! } - public var Watch_Message_Game: String { return self._s[1320]! } - public var Stickers_Install: String { return self._s[1321]! } - public var VoiceOver_Chat_Message: String { return self._s[1322]! } - public var PrivacyLastSeenSettings_NeverShareWith: String { return self._s[1323]! } - public var Passport_Identity_ResidenceCountry: String { return self._s[1325]! } - public var Notifications_GroupNotificationsHelp: String { return self._s[1326]! } - public var AuthSessions_OtherSessions: String { return self._s[1327]! } - public var Channel_Username_Help: String { return self._s[1328]! } - public var Camera_Title: String { return self._s[1329]! } - public var GroupInfo_SetGroupPhotoDelete: String { return self._s[1331]! } - public var Privacy_ProfilePhoto_NeverShareWith_Title: String { return self._s[1332]! } - public var Channel_AdminLog_SendPolls: String { return self._s[1333]! } - public var Channel_AdminLog_TitleAllEvents: String { return self._s[1334]! } - public var Channel_EditAdmin_PermissionInviteMembers: String { return self._s[1335]! } - public var Contacts_MemberSearchSectionTitleGroup: String { return self._s[1336]! } - public var ScheduledMessages_DeleteMany: String { return self._s[1337]! } - public var Conversation_RestrictedStickers: String { return self._s[1338]! } - public var Notifications_ExceptionsResetToDefaults: String { return self._s[1340]! } - public var UserInfo_TelegramCall: String { return self._s[1342]! } - public var TwoStepAuth_SetupResendEmailCode: String { return self._s[1343]! } - public var CreatePoll_OptionsHeader: String { return self._s[1344]! } - public var SettingsSearch_Synonyms_Data_CallsUseLessData: String { return self._s[1345]! } - public var ArchivedChats_IntroTitle1: String { return self._s[1346]! } - public var Privacy_GroupsAndChannels_AlwaysAllow_Title: String { return self._s[1347]! } - public var Passport_Identity_EditPersonalDetails: String { return self._s[1348]! } + public var NotificationsSound_Glass: String { return self._s[1311]! } + public var Appearance_ThemeNightBlue: String { return self._s[1312]! } + public var CheckoutInfo_Pay: String { return self._s[1313]! } + public var Invite_LargeRecipientsCountWarning: String { return self._s[1315]! } + public var Call_CallAgain: String { return self._s[1317]! } + public var AttachmentMenu_SendAsFile: String { return self._s[1318]! } + public var AccessDenied_MicrophoneRestricted: String { return self._s[1319]! } + public var Passport_InvalidPasswordError: String { return self._s[1320]! } + public var Watch_Message_Game: String { return self._s[1321]! } + public var Stickers_Install: String { return self._s[1322]! } + public var VoiceOver_Chat_Message: String { return self._s[1323]! } + public var PrivacyLastSeenSettings_NeverShareWith: String { return self._s[1324]! } + public var Passport_Identity_ResidenceCountry: String { return self._s[1326]! } + public var Notifications_GroupNotificationsHelp: String { return self._s[1327]! } + public var AuthSessions_OtherSessions: String { return self._s[1328]! } + public var Channel_Username_Help: String { return self._s[1329]! } + public var Camera_Title: String { return self._s[1330]! } + public var GroupInfo_SetGroupPhotoDelete: String { return self._s[1332]! } + public var Privacy_ProfilePhoto_NeverShareWith_Title: String { return self._s[1333]! } + public var Channel_AdminLog_SendPolls: String { return self._s[1334]! } + public var Channel_AdminLog_TitleAllEvents: String { return self._s[1335]! } + public var Channel_EditAdmin_PermissionInviteMembers: String { return self._s[1336]! } + public var Contacts_MemberSearchSectionTitleGroup: String { return self._s[1337]! } + public var ScheduledMessages_DeleteMany: String { return self._s[1338]! } + public var Conversation_RestrictedStickers: String { return self._s[1339]! } + public var Notifications_ExceptionsResetToDefaults: String { return self._s[1341]! } + public var UserInfo_TelegramCall: String { return self._s[1343]! } + public var TwoStepAuth_SetupResendEmailCode: String { return self._s[1344]! } + public var CreatePoll_OptionsHeader: String { return self._s[1345]! } + public var SettingsSearch_Synonyms_Data_CallsUseLessData: String { return self._s[1346]! } + public var ArchivedChats_IntroTitle1: String { return self._s[1347]! } + public var Privacy_GroupsAndChannels_AlwaysAllow_Title: String { return self._s[1348]! } + public var Passport_Identity_EditPersonalDetails: String { return self._s[1349]! } public func Time_PreciseDate_m1(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1349]!, self._r[1349]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1350]!, self._r[1350]!, [_1, _2, _3]) } - public var Wallet_Month_GenAugust: String { return self._s[1350]! } - public var Settings_SaveEditedPhotos: String { return self._s[1351]! } - public var TwoStepAuth_ConfirmationTitle: String { return self._s[1352]! } - public var Privacy_GroupsAndChannels_NeverAllow_Title: String { return self._s[1353]! } - public var Conversation_MessageDialogRetry: String { return self._s[1354]! } - public var ChatList_Context_MarkAsUnread: String { return self._s[1355]! } - public var Conversation_DiscardVoiceMessageAction: String { return self._s[1356]! } - public var Permissions_PeopleNearbyTitle_v0: String { return self._s[1357]! } - public var Group_Setup_TypeHeader: String { return self._s[1358]! } - public var Paint_RecentStickers: String { return self._s[1359]! } - public var PhotoEditor_GrainTool: String { return self._s[1360]! } - public var CheckoutInfo_ShippingInfoState: String { return self._s[1361]! } - public var EmptyGroupInfo_Line4: String { return self._s[1362]! } - public var Watch_AuthRequired: String { return self._s[1364]! } + public var Wallet_Month_GenAugust: String { return self._s[1351]! } + public var Settings_SaveEditedPhotos: String { return self._s[1352]! } + public var TwoStepAuth_ConfirmationTitle: String { return self._s[1353]! } + public var Privacy_GroupsAndChannels_NeverAllow_Title: String { return self._s[1354]! } + public var Conversation_MessageDialogRetry: String { return self._s[1355]! } + public var ChatList_Context_MarkAsUnread: String { return self._s[1356]! } + public var Conversation_DiscardVoiceMessageAction: String { return self._s[1357]! } + public var Permissions_PeopleNearbyTitle_v0: String { return self._s[1358]! } + public var Group_Setup_TypeHeader: String { return self._s[1359]! } + public var Paint_RecentStickers: String { return self._s[1360]! } + public var PhotoEditor_GrainTool: String { return self._s[1361]! } + public var CheckoutInfo_ShippingInfoState: String { return self._s[1362]! } + public var EmptyGroupInfo_Line4: String { return self._s[1363]! } + public var Watch_AuthRequired: String { return self._s[1365]! } public func Passport_Email_UseTelegramEmail(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1365]!, self._r[1365]!, [_0]) + return formatWithArgumentRanges(self._s[1366]!, self._r[1366]!, [_0]) } - public var Conversation_EncryptedDescriptionTitle: String { return self._s[1366]! } - public var ChannelIntro_Text: String { return self._s[1367]! } - public var DialogList_DeleteBotConfirmation: String { return self._s[1368]! } - public var GroupPermission_NoSendMedia: String { return self._s[1369]! } - public var Calls_AddTab: String { return self._s[1370]! } - public var Message_ReplyActionButtonShowReceipt: String { return self._s[1371]! } - public var Channel_AdminLog_EmptyFilterText: String { return self._s[1372]! } - public var Conversation_WalletRequiredSetup: String { return self._s[1373]! } - public var Notification_MessageLifetime1d: String { return self._s[1374]! } - public var Notifications_ChannelNotificationsExceptionsHelp: String { return self._s[1375]! } - public var Channel_BanUser_PermissionsHeader: String { return self._s[1376]! } - public var Passport_Identity_GenderFemale: String { return self._s[1377]! } - public var BlockedUsers_BlockTitle: String { return self._s[1378]! } + public var Conversation_EncryptedDescriptionTitle: String { return self._s[1367]! } + public var ChannelIntro_Text: String { return self._s[1368]! } + public var DialogList_DeleteBotConfirmation: String { return self._s[1369]! } + public var GroupPermission_NoSendMedia: String { return self._s[1370]! } + public var Calls_AddTab: String { return self._s[1371]! } + public var Message_ReplyActionButtonShowReceipt: String { return self._s[1372]! } + public var Channel_AdminLog_EmptyFilterText: String { return self._s[1373]! } + public var Conversation_WalletRequiredSetup: String { return self._s[1374]! } + public var Notification_MessageLifetime1d: String { return self._s[1375]! } + public var Notifications_ChannelNotificationsExceptionsHelp: String { return self._s[1376]! } + public var Channel_BanUser_PermissionsHeader: String { return self._s[1377]! } + public var Passport_Identity_GenderFemale: String { return self._s[1378]! } + public var BlockedUsers_BlockTitle: String { return self._s[1379]! } public func PUSH_CHANNEL_MESSAGE_GIF(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1379]!, self._r[1379]!, [_1]) + return formatWithArgumentRanges(self._s[1380]!, self._r[1380]!, [_1]) } - public var Weekday_Yesterday: String { return self._s[1380]! } - public var WallpaperSearch_ColorBlack: String { return self._s[1381]! } - public var Settings_Context_Logout: String { return self._s[1382]! } - public var Wallet_Info_UnknownTransaction: String { return self._s[1383]! } - public var ChatList_ArchiveAction: String { return self._s[1384]! } - public var AutoNightTheme_Scheduled: String { return self._s[1385]! } - public var TwoFactorSetup_Email_SkipAction: String { return self._s[1386]! } - public var ContactInfo_Note: String { return self._s[1387]! } + public var Weekday_Yesterday: String { return self._s[1381]! } + public var WallpaperSearch_ColorBlack: String { return self._s[1382]! } + public var Settings_Context_Logout: String { return self._s[1383]! } + public var Wallet_Info_UnknownTransaction: String { return self._s[1384]! } + public var ChatList_ArchiveAction: String { return self._s[1385]! } + public var AutoNightTheme_Scheduled: String { return self._s[1386]! } + public var TwoFactorSetup_Email_SkipAction: String { return self._s[1387]! } + public var ContactInfo_Note: String { return self._s[1388]! } public func Login_PhoneGenericEmailBody(_ _1: String, _ _2: String, _ _3: String, _ _4: String, _ _5: String, _ _6: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1388]!, self._r[1388]!, [_1, _2, _3, _4, _5, _6]) + return formatWithArgumentRanges(self._s[1389]!, self._r[1389]!, [_1, _2, _3, _4, _5, _6]) } - public var EditTheme_ThemeTemplateAlertTitle: String { return self._s[1389]! } - public var Wallet_Receive_CreateInvoice: String { return self._s[1390]! } - public var PrivacyPolicy_DeclineDeleteNow: String { return self._s[1391]! } - public var Theme_Colors_ColorWallpaperWarningProceed: String { return self._s[1392]! } + public var EditTheme_ThemeTemplateAlertTitle: String { return self._s[1390]! } + public var Wallet_Receive_CreateInvoice: String { return self._s[1391]! } + public var PrivacyPolicy_DeclineDeleteNow: String { return self._s[1392]! } + public var Theme_Colors_ColorWallpaperWarningProceed: String { return self._s[1393]! } public func PUSH_CHAT_JOINED(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1393]!, self._r[1393]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1394]!, self._r[1394]!, [_1, _2]) } - public var CreatePoll_Create: String { return self._s[1394]! } - public var Channel_Members_AddBannedErrorAdmin: String { return self._s[1395]! } + public var CreatePoll_Create: String { return self._s[1395]! } + public var Channel_Members_AddBannedErrorAdmin: String { return self._s[1396]! } public func Notification_CallFormat(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1396]!, self._r[1396]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1397]!, self._r[1397]!, [_1, _2]) } - public var ScheduledMessages_ClearAllConfirmation: String { return self._s[1397]! } - public var Checkout_ErrorProviderAccountInvalid: String { return self._s[1398]! } - public var Notifications_InAppNotificationsSounds: String { return self._s[1400]! } + public var ScheduledMessages_ClearAllConfirmation: String { return self._s[1398]! } + public var Checkout_ErrorProviderAccountInvalid: String { return self._s[1399]! } + public var Notifications_InAppNotificationsSounds: String { return self._s[1401]! } public func PUSH_PINNED_GAME_SCORE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1401]!, self._r[1401]!, [_1]) + return formatWithArgumentRanges(self._s[1402]!, self._r[1402]!, [_1]) } - public var Preview_OpenInInstagram: String { return self._s[1402]! } - public var Notification_MessageLifetimeRemovedOutgoing: String { return self._s[1403]! } + public var Preview_OpenInInstagram: String { return self._s[1403]! } + public var Notification_MessageLifetimeRemovedOutgoing: String { return self._s[1404]! } public func PUSH_CHAT_ADD_MEMBER(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1404]!, self._r[1404]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1405]!, self._r[1405]!, [_1, _2, _3]) } public func Passport_PrivacyPolicy(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1405]!, self._r[1405]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1406]!, self._r[1406]!, [_1, _2]) } - public var Channel_AdminLog_InfoPanelAlertTitle: String { return self._s[1406]! } - public var ArchivedChats_IntroText3: String { return self._s[1407]! } - public var ChatList_UndoArchiveHiddenText: String { return self._s[1408]! } - public var NetworkUsageSettings_TotalSection: String { return self._s[1409]! } - public var Wallet_Month_GenSeptember: String { return self._s[1410]! } - public var Channel_Setup_TypePrivateHelp: String { return self._s[1411]! } + public var Channel_AdminLog_InfoPanelAlertTitle: String { return self._s[1407]! } + public var ArchivedChats_IntroText3: String { return self._s[1408]! } + public var ChatList_UndoArchiveHiddenText: String { return self._s[1409]! } + public var NetworkUsageSettings_TotalSection: String { return self._s[1410]! } + public var Wallet_Month_GenSeptember: String { return self._s[1411]! } + public var Channel_Setup_TypePrivateHelp: String { return self._s[1412]! } public func PUSH_CHAT_MESSAGE_POLL(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1412]!, self._r[1412]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1413]!, self._r[1413]!, [_1, _2, _3]) } - public var Privacy_GroupsAndChannels_NeverAllow_Placeholder: String { return self._s[1414]! } - public var FastTwoStepSetup_HintSection: String { return self._s[1415]! } - public var Wallpaper_PhotoLibrary: String { return self._s[1416]! } - public var TwoStepAuth_SetupResendEmailCodeAlert: String { return self._s[1417]! } - public var Gif_NoGifsFound: String { return self._s[1418]! } - public var Watch_LastSeen_WithinAMonth: String { return self._s[1419]! } - public var VoiceOver_MessageContextDelete: String { return self._s[1420]! } - public var EditTheme_Preview: String { return self._s[1421]! } + public var Privacy_GroupsAndChannels_NeverAllow_Placeholder: String { return self._s[1415]! } + public var FastTwoStepSetup_HintSection: String { return self._s[1416]! } + public var Wallpaper_PhotoLibrary: String { return self._s[1417]! } + public var TwoStepAuth_SetupResendEmailCodeAlert: String { return self._s[1418]! } + public var Gif_NoGifsFound: String { return self._s[1419]! } + public var Watch_LastSeen_WithinAMonth: String { return self._s[1420]! } + public var VoiceOver_MessageContextDelete: String { return self._s[1421]! } + public var EditTheme_Preview: String { return self._s[1422]! } public func ClearCache_StorageTitle(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1422]!, self._r[1422]!, [_0]) + return formatWithArgumentRanges(self._s[1423]!, self._r[1423]!, [_0]) } - public var GroupInfo_ActionPromote: String { return self._s[1423]! } - public var PasscodeSettings_SimplePasscode: String { return self._s[1424]! } - public var GroupInfo_Permissions_Title: String { return self._s[1425]! } - public var Permissions_ContactsText_v0: String { return self._s[1426]! } - public var PrivacyPhoneNumberSettings_CustomDisabledHelp: String { return self._s[1427]! } - public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedPublicGroups: String { return self._s[1428]! } - public var PrivacySettings_DataSettingsHelp: String { return self._s[1431]! } - public var Passport_FieldEmailHelp: String { return self._s[1432]! } + public var GroupInfo_ActionPromote: String { return self._s[1424]! } + public var PasscodeSettings_SimplePasscode: String { return self._s[1425]! } + public var GroupInfo_Permissions_Title: String { return self._s[1426]! } + public var Permissions_ContactsText_v0: String { return self._s[1427]! } + public var PrivacyPhoneNumberSettings_CustomDisabledHelp: String { return self._s[1428]! } + public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedPublicGroups: String { return self._s[1429]! } + public var PrivacySettings_DataSettingsHelp: String { return self._s[1432]! } + public var Passport_FieldEmailHelp: String { return self._s[1433]! } public func Activity_RemindAboutUser(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1433]!, self._r[1433]!, [_0]) + return formatWithArgumentRanges(self._s[1434]!, self._r[1434]!, [_0]) } - public var Passport_Identity_GenderPlaceholder: String { return self._s[1434]! } - public var Weekday_ShortSaturday: String { return self._s[1435]! } - public var ContactInfo_PhoneLabelMain: String { return self._s[1436]! } - public var Watch_Conversation_UserInfo: String { return self._s[1437]! } - public var CheckoutInfo_ShippingInfoCityPlaceholder: String { return self._s[1438]! } - public var GroupPermission_PermissionDisabledByDefault: String { return self._s[1439]! } - public var PrivacyLastSeenSettings_Title: String { return self._s[1440]! } - public var Conversation_ShareBotLocationConfirmation: String { return self._s[1441]! } - public var PhotoEditor_VignetteTool: String { return self._s[1442]! } - public var Passport_Address_Street1Placeholder: String { return self._s[1443]! } - public var Passport_Language_et: String { return self._s[1444]! } - public var AppUpgrade_Running: String { return self._s[1445]! } - public var Channel_DiscussionGroup_Info: String { return self._s[1447]! } - public var EditTheme_Create_Preview_IncomingReplyName: String { return self._s[1448]! } - public var Passport_Language_bg: String { return self._s[1449]! } - public var Stickers_NoStickersFound: String { return self._s[1451]! } + public var Passport_Identity_GenderPlaceholder: String { return self._s[1435]! } + public var Weekday_ShortSaturday: String { return self._s[1436]! } + public var ContactInfo_PhoneLabelMain: String { return self._s[1437]! } + public var Watch_Conversation_UserInfo: String { return self._s[1438]! } + public var CheckoutInfo_ShippingInfoCityPlaceholder: String { return self._s[1439]! } + public var GroupPermission_PermissionDisabledByDefault: String { return self._s[1440]! } + public var PrivacyLastSeenSettings_Title: String { return self._s[1441]! } + public var Conversation_ShareBotLocationConfirmation: String { return self._s[1442]! } + public var PhotoEditor_VignetteTool: String { return self._s[1443]! } + public var Passport_Address_Street1Placeholder: String { return self._s[1444]! } + public var Passport_Language_et: String { return self._s[1445]! } + public var AppUpgrade_Running: String { return self._s[1446]! } + public var Channel_DiscussionGroup_Info: String { return self._s[1448]! } + public var EditTheme_Create_Preview_IncomingReplyName: String { return self._s[1449]! } + public var Passport_Language_bg: String { return self._s[1450]! } + public var Stickers_NoStickersFound: String { return self._s[1452]! } public func PUSH_CHANNEL_MESSAGE_TEXT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1453]!, self._r[1453]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1454]!, self._r[1454]!, [_1, _2]) } public func VoiceOver_Chat_ContactFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1454]!, self._r[1454]!, [_0]) + return formatWithArgumentRanges(self._s[1455]!, self._r[1455]!, [_0]) } - public var Wallet_Month_GenJuly: String { return self._s[1455]! } - public var Wallet_Receive_AddressHeader: String { return self._s[1456]! } - public var Wallet_Send_AmountText: String { return self._s[1457]! } - public var Settings_About: String { return self._s[1458]! } + public var Wallet_Month_GenJuly: String { return self._s[1456]! } + public var Wallet_Receive_AddressHeader: String { return self._s[1457]! } + public var Wallet_Send_AmountText: String { return self._s[1458]! } + public var Settings_About: String { return self._s[1459]! } public func Channel_AdminLog_MessageRestricted(_ _0: String, _ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1459]!, self._r[1459]!, [_0, _1, _2]) + return formatWithArgumentRanges(self._s[1460]!, self._r[1460]!, [_0, _1, _2]) } - public var ChatList_Context_MarkAsRead: String { return self._s[1461]! } - public var KeyCommand_NewMessage: String { return self._s[1462]! } - public var Group_ErrorAddBlocked: String { return self._s[1463]! } + public var ChatList_Context_MarkAsRead: String { return self._s[1462]! } + public var KeyCommand_NewMessage: String { return self._s[1463]! } + public var Group_ErrorAddBlocked: String { return self._s[1464]! } public func Message_PaymentSent(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1464]!, self._r[1464]!, [_0]) + return formatWithArgumentRanges(self._s[1465]!, self._r[1465]!, [_0]) } - public var Map_LocationTitle: String { return self._s[1465]! } - public var ReportGroupLocation_Title: String { return self._s[1466]! } - public var CallSettings_UseLessDataLongDescription: String { return self._s[1467]! } - public var Cache_ClearProgress: String { return self._s[1468]! } + public var Map_LocationTitle: String { return self._s[1466]! } + public var ReportGroupLocation_Title: String { return self._s[1467]! } + public var CallSettings_UseLessDataLongDescription: String { return self._s[1468]! } + public var Cache_ClearProgress: String { return self._s[1469]! } public func Channel_Management_ErrorNotMember(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1469]!, self._r[1469]!, [_0]) + return formatWithArgumentRanges(self._s[1470]!, self._r[1470]!, [_0]) } - public var GroupRemoved_AddToGroup: String { return self._s[1470]! } - public var Passport_UpdateRequiredError: String { return self._s[1471]! } - public var Wallet_SecureStorageNotAvailable_Text: String { return self._s[1472]! } + public var GroupRemoved_AddToGroup: String { return self._s[1471]! } + public var Passport_UpdateRequiredError: String { return self._s[1472]! } + public var Wallet_SecureStorageNotAvailable_Text: String { return self._s[1473]! } public func PUSH_MESSAGE_DOC(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1473]!, self._r[1473]!, [_1]) + return formatWithArgumentRanges(self._s[1474]!, self._r[1474]!, [_1]) } - public var Notifications_PermissionsSuppressWarningText: String { return self._s[1475]! } - public var Passport_Identity_MainPageHelp: String { return self._s[1476]! } - public var Conversation_StatusKickedFromGroup: String { return self._s[1477]! } - public var Passport_Language_ka: String { return self._s[1478]! } + public var Notifications_PermissionsSuppressWarningText: String { return self._s[1476]! } + public var Passport_Identity_MainPageHelp: String { return self._s[1477]! } + public var Conversation_StatusKickedFromGroup: String { return self._s[1478]! } + public var Passport_Language_ka: String { return self._s[1479]! } public func Wallet_Time_PreciseDate_m12(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1479]!, self._r[1479]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1480]!, self._r[1480]!, [_1, _2, _3]) } - public var Call_Decline: String { return self._s[1480]! } - public var SocksProxySetup_ProxyEnabled: String { return self._s[1481]! } - public var TwoFactorSetup_Email_SkipConfirmationText: String { return self._s[1484]! } + public var Call_Decline: String { return self._s[1481]! } + public var SocksProxySetup_ProxyEnabled: String { return self._s[1482]! } + public var TwoFactorSetup_Email_SkipConfirmationText: String { return self._s[1485]! } public func AuthCode_Alert(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1485]!, self._r[1485]!, [_0]) + return formatWithArgumentRanges(self._s[1486]!, self._r[1486]!, [_0]) } - public var CallFeedback_Send: String { return self._s[1486]! } - public var EditTheme_EditTitle: String { return self._s[1487]! } + public var CallFeedback_Send: String { return self._s[1487]! } + public var EditTheme_EditTitle: String { return self._s[1488]! } public func Channel_AdminLog_MessagePromotedNameUsername(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1488]!, self._r[1488]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1489]!, self._r[1489]!, [_1, _2]) } - public var Passport_Phone_UseTelegramNumberHelp: String { return self._s[1489]! } + public var Passport_Phone_UseTelegramNumberHelp: String { return self._s[1490]! } public func Wallet_Updated_TodayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1491]!, self._r[1491]!, [_0]) + return formatWithArgumentRanges(self._s[1492]!, self._r[1492]!, [_0]) } - public var SettingsSearch_Synonyms_Data_Title: String { return self._s[1492]! } - public var Passport_DeletePassport: String { return self._s[1493]! } - public var Appearance_AppIconFilled: String { return self._s[1494]! } - public var Privacy_Calls_P2PAlways: String { return self._s[1495]! } - public var Month_ShortDecember: String { return self._s[1496]! } - public var Channel_AdminLog_CanEditMessages: String { return self._s[1498]! } + public var SettingsSearch_Synonyms_Data_Title: String { return self._s[1493]! } + public var Passport_DeletePassport: String { return self._s[1494]! } + public var Appearance_AppIconFilled: String { return self._s[1495]! } + public var Privacy_Calls_P2PAlways: String { return self._s[1496]! } + public var Month_ShortDecember: String { return self._s[1497]! } + public var Channel_AdminLog_CanEditMessages: String { return self._s[1499]! } public func Contacts_AccessDeniedHelpLandscape(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1499]!, self._r[1499]!, [_0]) + return formatWithArgumentRanges(self._s[1500]!, self._r[1500]!, [_0]) } - public var Channel_Stickers_Searching: String { return self._s[1500]! } - public var Conversation_EncryptedDescription1: String { return self._s[1501]! } - public var Conversation_EncryptedDescription2: String { return self._s[1502]! } - public var PasscodeSettings_PasscodeOptions: String { return self._s[1503]! } - public var Conversation_EncryptedDescription3: String { return self._s[1505]! } - public var PhotoEditor_SharpenTool: String { return self._s[1506]! } - public var Wallet_Configuration_Title: String { return self._s[1507]! } + public var Channel_Stickers_Searching: String { return self._s[1501]! } + public var Conversation_EncryptedDescription1: String { return self._s[1502]! } + public var Conversation_EncryptedDescription2: String { return self._s[1503]! } + public var PasscodeSettings_PasscodeOptions: String { return self._s[1504]! } + public var Conversation_EncryptedDescription3: String { return self._s[1506]! } + public var PhotoEditor_SharpenTool: String { return self._s[1507]! } + public var Wallet_Configuration_Title: String { return self._s[1508]! } public func Conversation_AddNameToContacts(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1508]!, self._r[1508]!, [_0]) + return formatWithArgumentRanges(self._s[1509]!, self._r[1509]!, [_0]) } - public var Conversation_EncryptedDescription4: String { return self._s[1510]! } - public var Channel_Members_AddMembers: String { return self._s[1511]! } - public var Wallpaper_Search: String { return self._s[1512]! } - public var Weekday_Friday: String { return self._s[1513]! } - public var Privacy_ContactsSync: String { return self._s[1514]! } - public var SettingsSearch_Synonyms_Privacy_Data_ContactsReset: String { return self._s[1515]! } - public var ApplyLanguage_ChangeLanguageAction: String { return self._s[1516]! } + public var Conversation_EncryptedDescription4: String { return self._s[1511]! } + public var Channel_Members_AddMembers: String { return self._s[1512]! } + public var Wallpaper_Search: String { return self._s[1513]! } + public var Weekday_Friday: String { return self._s[1514]! } + public var Privacy_ContactsSync: String { return self._s[1515]! } + public var SettingsSearch_Synonyms_Privacy_Data_ContactsReset: String { return self._s[1516]! } + public var ApplyLanguage_ChangeLanguageAction: String { return self._s[1517]! } public func Channel_Management_RestrictedBy(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1517]!, self._r[1517]!, [_0]) + return formatWithArgumentRanges(self._s[1518]!, self._r[1518]!, [_0]) } - public var Wallet_Configuration_BlockchainIdHeader: String { return self._s[1518]! } - public var GroupInfo_Permissions_Removed: String { return self._s[1519]! } - public var ScheduledMessages_ScheduledOnline: String { return self._s[1520]! } - public var Passport_Identity_GenderMale: String { return self._s[1521]! } + public var Wallet_Configuration_BlockchainIdHeader: String { return self._s[1519]! } + public var GroupInfo_Permissions_Removed: String { return self._s[1520]! } + public var ScheduledMessages_ScheduledOnline: String { return self._s[1521]! } + public var Passport_Identity_GenderMale: String { return self._s[1522]! } public func Call_StatusBar(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1522]!, self._r[1522]!, [_0]) + return formatWithArgumentRanges(self._s[1523]!, self._r[1523]!, [_0]) } - public var Notifications_PermissionsKeepDisabled: String { return self._s[1523]! } - public var Conversation_JumpToDate: String { return self._s[1524]! } - public var Contacts_GlobalSearch: String { return self._s[1525]! } - public var AutoDownloadSettings_ResetHelp: String { return self._s[1526]! } - public var SettingsSearch_Synonyms_FAQ: String { return self._s[1527]! } - public var Profile_MessageLifetime1d: String { return self._s[1528]! } + public var Notifications_PermissionsKeepDisabled: String { return self._s[1524]! } + public var Conversation_JumpToDate: String { return self._s[1525]! } + public var Contacts_GlobalSearch: String { return self._s[1526]! } + public var AutoDownloadSettings_ResetHelp: String { return self._s[1527]! } + public var SettingsSearch_Synonyms_FAQ: String { return self._s[1528]! } + public var Profile_MessageLifetime1d: String { return self._s[1529]! } public func MESSAGE_INVOICE(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1529]!, self._r[1529]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1530]!, self._r[1530]!, [_1, _2]) } - public var StickerPack_BuiltinPackName: String { return self._s[1532]! } + public var StickerPack_BuiltinPackName: String { return self._s[1533]! } public func PUSH_CHAT_MESSAGE_AUDIO(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1533]!, self._r[1533]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1534]!, self._r[1534]!, [_1, _2]) } - public var VoiceOver_Chat_RecordModeVoiceMessageInfo: String { return self._s[1534]! } - public var Passport_InfoTitle: String { return self._s[1536]! } - public var Notifications_PermissionsUnreachableText: String { return self._s[1537]! } + public var VoiceOver_Chat_RecordModeVoiceMessageInfo: String { return self._s[1535]! } + public var Passport_InfoTitle: String { return self._s[1537]! } + public var Notifications_PermissionsUnreachableText: String { return self._s[1538]! } public func NetworkUsageSettings_CellularUsageSince(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1541]!, self._r[1541]!, [_0]) + return formatWithArgumentRanges(self._s[1542]!, self._r[1542]!, [_0]) } public func PUSH_CHAT_MESSAGE_GEO(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1542]!, self._r[1542]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1543]!, self._r[1543]!, [_1, _2]) } - public var Passport_Address_TypePassportRegistrationUploadScan: String { return self._s[1543]! } - public var Profile_BotInfo: String { return self._s[1544]! } - public var Watch_Compose_CreateMessage: String { return self._s[1545]! } - public var AutoDownloadSettings_VoiceMessagesInfo: String { return self._s[1546]! } - public var Month_ShortNovember: String { return self._s[1547]! } - public var Conversation_ScamWarning: String { return self._s[1548]! } - public var Wallpaper_SetCustomBackground: String { return self._s[1549]! } - public var Passport_Identity_TranslationsHelp: String { return self._s[1550]! } - public var NotificationsSound_Chime: String { return self._s[1551]! } - public var Passport_Language_ko: String { return self._s[1553]! } - public var InviteText_URL: String { return self._s[1554]! } - public var TextFormat_Monospace: String { return self._s[1555]! } + public var Passport_Address_TypePassportRegistrationUploadScan: String { return self._s[1544]! } + public var Profile_BotInfo: String { return self._s[1545]! } + public var Watch_Compose_CreateMessage: String { return self._s[1546]! } + public var AutoDownloadSettings_VoiceMessagesInfo: String { return self._s[1547]! } + public var Month_ShortNovember: String { return self._s[1548]! } + public var Conversation_ScamWarning: String { return self._s[1549]! } + public var Wallpaper_SetCustomBackground: String { return self._s[1550]! } + public var Appearance_TextSize_Title: String { return self._s[1551]! } + public var Passport_Identity_TranslationsHelp: String { return self._s[1552]! } + public var NotificationsSound_Chime: String { return self._s[1553]! } + public var Passport_Language_ko: String { return self._s[1555]! } + public var InviteText_URL: String { return self._s[1556]! } + public var TextFormat_Monospace: String { return self._s[1557]! } public func Time_PreciseDate_m11(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1556]!, self._r[1556]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1558]!, self._r[1558]!, [_1, _2, _3]) } - public var EditTheme_Edit_BottomInfo: String { return self._s[1557]! } + public var EditTheme_Edit_BottomInfo: String { return self._s[1559]! } public func Login_WillSendSms(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1558]!, self._r[1558]!, [_0]) + return formatWithArgumentRanges(self._s[1560]!, self._r[1560]!, [_0]) } public func Watch_Time_ShortWeekdayAt(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1559]!, self._r[1559]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1561]!, self._r[1561]!, [_1, _2]) } - public var Wallet_Words_Title: String { return self._s[1560]! } - public var Wallet_Month_ShortMay: String { return self._s[1561]! } - public var EditTheme_CreateTitle: String { return self._s[1563]! } - public var Passport_InfoLearnMore: String { return self._s[1564]! } - public var TwoStepAuth_EmailPlaceholder: String { return self._s[1565]! } - public var Passport_Identity_AddIdentityCard: String { return self._s[1566]! } - public var Your_card_has_expired: String { return self._s[1567]! } - public var StickerPacksSettings_StickerPacksSection: String { return self._s[1568]! } - public var GroupInfo_InviteLink_Help: String { return self._s[1569]! } - public var TwoFactorSetup_EmailVerification_ResendAction: String { return self._s[1573]! } - public var Conversation_Report: String { return self._s[1575]! } - public var Notifications_MessageNotificationsSound: String { return self._s[1576]! } - public var Notification_MessageLifetime1m: String { return self._s[1577]! } - public var Privacy_ContactsTitle: String { return self._s[1578]! } - public var Conversation_ShareMyContactInfo: String { return self._s[1579]! } - public var Wallet_WordCheck_Title: String { return self._s[1580]! } - public var ChannelMembers_WhoCanAddMembersAdminsHelp: String { return self._s[1581]! } - public var Channel_Members_Title: String { return self._s[1582]! } - public var Map_OpenInWaze: String { return self._s[1583]! } - public var Login_PhoneBannedError: String { return self._s[1584]! } + public var Wallet_Words_Title: String { return self._s[1562]! } + public var Wallet_Month_ShortMay: String { return self._s[1563]! } + public var EditTheme_CreateTitle: String { return self._s[1565]! } + public var Passport_InfoLearnMore: String { return self._s[1566]! } + public var TwoStepAuth_EmailPlaceholder: String { return self._s[1567]! } + public var Passport_Identity_AddIdentityCard: String { return self._s[1568]! } + public var Your_card_has_expired: String { return self._s[1569]! } + public var StickerPacksSettings_StickerPacksSection: String { return self._s[1570]! } + public var GroupInfo_InviteLink_Help: String { return self._s[1571]! } + public var TwoFactorSetup_EmailVerification_ResendAction: String { return self._s[1575]! } + public var Conversation_Report: String { return self._s[1577]! } + public var Notifications_MessageNotificationsSound: String { return self._s[1578]! } + public var Notification_MessageLifetime1m: String { return self._s[1579]! } + public var Privacy_ContactsTitle: String { return self._s[1580]! } + public var Conversation_ShareMyContactInfo: String { return self._s[1581]! } + public var Wallet_WordCheck_Title: String { return self._s[1582]! } + public var ChannelMembers_WhoCanAddMembersAdminsHelp: String { return self._s[1583]! } + public var Channel_Members_Title: String { return self._s[1584]! } + public var Map_OpenInWaze: String { return self._s[1585]! } + public var Login_PhoneBannedError: String { return self._s[1586]! } public func LiveLocationUpdated_YesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1585]!, self._r[1585]!, [_0]) + return formatWithArgumentRanges(self._s[1587]!, self._r[1587]!, [_0]) } - public var Group_Management_AddModeratorHelp: String { return self._s[1586]! } - public var AutoDownloadSettings_WifiTitle: String { return self._s[1587]! } - public var Common_OK: String { return self._s[1588]! } - public var Passport_Address_TypeBankStatementUploadScan: String { return self._s[1589]! } - public var Wallet_Words_NotDoneResponse: String { return self._s[1590]! } - public var Cache_Music: String { return self._s[1591]! } - public var Wallet_Configuration_SourceURL: String { return self._s[1592]! } - public var SettingsSearch_Synonyms_EditProfile_PhoneNumber: String { return self._s[1593]! } - public var PasscodeSettings_UnlockWithTouchId: String { return self._s[1594]! } - public var TwoStepAuth_HintPlaceholder: String { return self._s[1595]! } + public var Group_Management_AddModeratorHelp: String { return self._s[1588]! } + public var AutoDownloadSettings_WifiTitle: String { return self._s[1589]! } + public var Common_OK: String { return self._s[1590]! } + public var Passport_Address_TypeBankStatementUploadScan: String { return self._s[1591]! } + public var Wallet_Words_NotDoneResponse: String { return self._s[1592]! } + public var Cache_Music: String { return self._s[1593]! } + public var Wallet_Configuration_SourceURL: String { return self._s[1594]! } + public var SettingsSearch_Synonyms_EditProfile_PhoneNumber: String { return self._s[1595]! } + public var PasscodeSettings_UnlockWithTouchId: String { return self._s[1596]! } + public var TwoStepAuth_HintPlaceholder: String { return self._s[1597]! } public func PUSH_PINNED_INVOICE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1596]!, self._r[1596]!, [_1]) + return formatWithArgumentRanges(self._s[1598]!, self._r[1598]!, [_1]) } public func Passport_RequestHeader(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1597]!, self._r[1597]!, [_0]) - } - public var TwoFactorSetup_Done_Action: String { return self._s[1598]! } - public func VoiceOver_Chat_ContactOrganization(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1599]!, self._r[1599]!, [_0]) } - public var Wallet_Send_ErrorNotEnoughFundsText: String { return self._s[1600]! } - public var Watch_MessageView_ViewOnPhone: String { return self._s[1602]! } - public var Privacy_Calls_CustomShareHelp: String { return self._s[1603]! } - public var Wallet_Receive_CreateInvoiceInfo: String { return self._s[1605]! } - public var ChangePhoneNumberNumber_Title: String { return self._s[1606]! } - public var State_ConnectingToProxyInfo: String { return self._s[1607]! } - public var Conversation_SwipeToReplyHintTitle: String { return self._s[1608]! } - public var Message_VideoMessage: String { return self._s[1610]! } - public var ChannelInfo_DeleteChannel: String { return self._s[1611]! } - public var ContactInfo_PhoneLabelOther: String { return self._s[1612]! } - public var Channel_EditAdmin_CannotEdit: String { return self._s[1613]! } - public var Passport_DeleteAddressConfirmation: String { return self._s[1614]! } - public func Wallet_Time_PreciseDate_m9(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1615]!, self._r[1615]!, [_1, _2, _3]) + public var TwoFactorSetup_Done_Action: String { return self._s[1600]! } + public func VoiceOver_Chat_ContactOrganization(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1601]!, self._r[1601]!, [_0]) } - public var WallpaperPreview_SwipeBottomText: String { return self._s[1616]! } - public var Activity_RecordingAudio: String { return self._s[1617]! } - public var SettingsSearch_Synonyms_Watch: String { return self._s[1618]! } - public var PasscodeSettings_TryAgainIn1Minute: String { return self._s[1619]! } - public var Wallet_Info_Address: String { return self._s[1620]! } + public var Wallet_Send_ErrorNotEnoughFundsText: String { return self._s[1602]! } + public var Watch_MessageView_ViewOnPhone: String { return self._s[1604]! } + public var Privacy_Calls_CustomShareHelp: String { return self._s[1605]! } + public var Wallet_Receive_CreateInvoiceInfo: String { return self._s[1607]! } + public var ChangePhoneNumberNumber_Title: String { return self._s[1608]! } + public var State_ConnectingToProxyInfo: String { return self._s[1609]! } + public var Conversation_SwipeToReplyHintTitle: String { return self._s[1610]! } + public var Message_VideoMessage: String { return self._s[1612]! } + public var ChannelInfo_DeleteChannel: String { return self._s[1613]! } + public var ContactInfo_PhoneLabelOther: String { return self._s[1614]! } + public var Channel_EditAdmin_CannotEdit: String { return self._s[1615]! } + public var Passport_DeleteAddressConfirmation: String { return self._s[1616]! } + public func Wallet_Time_PreciseDate_m9(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1617]!, self._r[1617]!, [_1, _2, _3]) + } + public var WallpaperPreview_SwipeBottomText: String { return self._s[1618]! } + public var Activity_RecordingAudio: String { return self._s[1619]! } + public var SettingsSearch_Synonyms_Watch: String { return self._s[1620]! } + public var PasscodeSettings_TryAgainIn1Minute: String { return self._s[1621]! } + public var Wallet_Info_Address: String { return self._s[1622]! } public func Notification_ChangedGroupName(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1622]!, self._r[1622]!, [_0, _1]) + return formatWithArgumentRanges(self._s[1624]!, self._r[1624]!, [_0, _1]) } public func EmptyGroupInfo_Line1(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1626]!, self._r[1626]!, [_0]) + return formatWithArgumentRanges(self._s[1628]!, self._r[1628]!, [_0]) } - public var Conversation_ApplyLocalization: String { return self._s[1627]! } - public var TwoFactorSetup_Intro_Action: String { return self._s[1628]! } - public var UserInfo_AddPhone: String { return self._s[1629]! } - public var Map_ShareLiveLocationHelp: String { return self._s[1630]! } + public var Conversation_ApplyLocalization: String { return self._s[1629]! } + public var TwoFactorSetup_Intro_Action: String { return self._s[1630]! } + public var UserInfo_AddPhone: String { return self._s[1631]! } + public var Map_ShareLiveLocationHelp: String { return self._s[1632]! } public func Passport_Identity_NativeNameGenericHelp(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1631]!, self._r[1631]!, [_0]) + return formatWithArgumentRanges(self._s[1633]!, self._r[1633]!, [_0]) } - public var Passport_Scans: String { return self._s[1633]! } - public var BlockedUsers_Unblock: String { return self._s[1634]! } + public var Passport_Scans: String { return self._s[1635]! } + public var BlockedUsers_Unblock: String { return self._s[1636]! } public func PUSH_ENCRYPTION_REQUEST(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1635]!, self._r[1635]!, [_1]) + return formatWithArgumentRanges(self._s[1637]!, self._r[1637]!, [_1]) } - public var Channel_Management_LabelCreator: String { return self._s[1636]! } - public var Conversation_ReportSpamAndLeave: String { return self._s[1637]! } - public var SettingsSearch_Synonyms_EditProfile_Bio: String { return self._s[1638]! } - public var ChatList_UndoArchiveMultipleTitle: String { return self._s[1639]! } - public var Passport_Identity_NativeNameGenericTitle: String { return self._s[1640]! } + public var Channel_Management_LabelCreator: String { return self._s[1638]! } + public var Conversation_ReportSpamAndLeave: String { return self._s[1639]! } + public var SettingsSearch_Synonyms_EditProfile_Bio: String { return self._s[1640]! } + public var ChatList_UndoArchiveMultipleTitle: String { return self._s[1641]! } + public var Passport_Identity_NativeNameGenericTitle: String { return self._s[1642]! } public func Login_EmailPhoneBody(_ _0: String, _ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1641]!, self._r[1641]!, [_0, _1, _2]) + return formatWithArgumentRanges(self._s[1643]!, self._r[1643]!, [_0, _1, _2]) } - public var Login_PhoneNumberHelp: String { return self._s[1642]! } - public var LastSeen_ALongTimeAgo: String { return self._s[1643]! } - public var Channel_AdminLog_CanPinMessages: String { return self._s[1644]! } - public var ChannelIntro_CreateChannel: String { return self._s[1645]! } - public var Conversation_UnreadMessages: String { return self._s[1646]! } - public var SettingsSearch_Synonyms_Stickers_ArchivedPacks: String { return self._s[1647]! } - public var Channel_AdminLog_EmptyText: String { return self._s[1648]! } - public var Theme_Context_Apply: String { return self._s[1649]! } - public var Notification_GroupActivated: String { return self._s[1650]! } - public var NotificationSettings_ContactJoinedInfo: String { return self._s[1651]! } - public var Wallet_Intro_CreateWallet: String { return self._s[1652]! } + public var Login_PhoneNumberHelp: String { return self._s[1644]! } + public var LastSeen_ALongTimeAgo: String { return self._s[1645]! } + public var Channel_AdminLog_CanPinMessages: String { return self._s[1646]! } + public var ChannelIntro_CreateChannel: String { return self._s[1647]! } + public var Conversation_UnreadMessages: String { return self._s[1648]! } + public var SettingsSearch_Synonyms_Stickers_ArchivedPacks: String { return self._s[1649]! } + public var Channel_AdminLog_EmptyText: String { return self._s[1650]! } + public var Theme_Context_Apply: String { return self._s[1651]! } + public var Notification_GroupActivated: String { return self._s[1652]! } + public var NotificationSettings_ContactJoinedInfo: String { return self._s[1653]! } + public var Wallet_Intro_CreateWallet: String { return self._s[1654]! } public func Notification_PinnedContactMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1653]!, self._r[1653]!, [_0]) + return formatWithArgumentRanges(self._s[1655]!, self._r[1655]!, [_0]) } public func DownloadingStatus(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1654]!, self._r[1654]!, [_0, _1]) + return formatWithArgumentRanges(self._s[1656]!, self._r[1656]!, [_0, _1]) } - public var GroupInfo_ConvertToSupergroup: String { return self._s[1656]! } + public var GroupInfo_ConvertToSupergroup: String { return self._s[1658]! } public func PrivacyPolicy_AgeVerificationMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1657]!, self._r[1657]!, [_0]) + return formatWithArgumentRanges(self._s[1659]!, self._r[1659]!, [_0]) } - public var Undo_DeletedChannel: String { return self._s[1658]! } - public var CallFeedback_AddComment: String { return self._s[1659]! } + public var Undo_DeletedChannel: String { return self._s[1660]! } + public var CallFeedback_AddComment: String { return self._s[1661]! } public func Conversation_OpenBotLinkAllowMessages(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1660]!, self._r[1660]!, [_0]) - } - public var Document_TargetConfirmationFormat: String { return self._s[1661]! } - public func Call_StatusOngoing(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1662]!, self._r[1662]!, [_0]) } - public var LogoutOptions_SetPasscodeTitle: String { return self._s[1663]! } + public var Document_TargetConfirmationFormat: String { return self._s[1663]! } + public func Call_StatusOngoing(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1664]!, self._r[1664]!, [_0]) + } + public var LogoutOptions_SetPasscodeTitle: String { return self._s[1665]! } public func PUSH_CHAT_MESSAGE_GAME_SCORE(_ _1: String, _ _2: String, _ _3: String, _ _4: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1664]!, self._r[1664]!, [_1, _2, _3, _4]) + return formatWithArgumentRanges(self._s[1666]!, self._r[1666]!, [_1, _2, _3, _4]) } - public var Wallet_SecureStorageChanged_PasscodeText: String { return self._s[1665]! } - public var Theme_ErrorNotFound: String { return self._s[1666]! } - public var Contacts_SortByName: String { return self._s[1667]! } - public var SettingsSearch_Synonyms_Privacy_Forwards: String { return self._s[1668]! } + public var Wallet_SecureStorageChanged_PasscodeText: String { return self._s[1667]! } + public var Theme_ErrorNotFound: String { return self._s[1668]! } + public var Contacts_SortByName: String { return self._s[1669]! } + public var SettingsSearch_Synonyms_Privacy_Forwards: String { return self._s[1670]! } public func CHAT_MESSAGE_INVOICE(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1670]!, self._r[1670]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1672]!, self._r[1672]!, [_1, _2, _3]) } - public var Notification_Exceptions_RemoveFromExceptions: String { return self._s[1671]! } - public var ScheduledMessages_EditTime: String { return self._s[1672]! } - public var Conversation_ClearSelfHistory: String { return self._s[1673]! } - public var Checkout_NewCard_PostcodePlaceholder: String { return self._s[1674]! } - public var PasscodeSettings_DoNotMatch: String { return self._s[1675]! } - public var Stickers_SuggestNone: String { return self._s[1676]! } - public var ChatSettings_Cache: String { return self._s[1677]! } - public var Settings_SaveIncomingPhotos: String { return self._s[1678]! } - public var Media_ShareThisPhoto: String { return self._s[1679]! } - public var Chat_SlowmodeTooltipPending: String { return self._s[1680]! } - public var InfoPlist_NSContactsUsageDescription: String { return self._s[1681]! } - public var Conversation_ContextMenuCopyLink: String { return self._s[1682]! } - public var PrivacyPolicy_AgeVerificationTitle: String { return self._s[1683]! } - public var SettingsSearch_Synonyms_Stickers_Masks: String { return self._s[1684]! } - public var TwoStepAuth_SetupPasswordEnterPasswordNew: String { return self._s[1685]! } + public var Notification_Exceptions_RemoveFromExceptions: String { return self._s[1673]! } + public var ScheduledMessages_EditTime: String { return self._s[1674]! } + public var Conversation_ClearSelfHistory: String { return self._s[1675]! } + public var Checkout_NewCard_PostcodePlaceholder: String { return self._s[1676]! } + public var PasscodeSettings_DoNotMatch: String { return self._s[1677]! } + public var Stickers_SuggestNone: String { return self._s[1678]! } + public var ChatSettings_Cache: String { return self._s[1679]! } + public var Settings_SaveIncomingPhotos: String { return self._s[1680]! } + public var Media_ShareThisPhoto: String { return self._s[1681]! } + public var Chat_SlowmodeTooltipPending: String { return self._s[1682]! } + public var InfoPlist_NSContactsUsageDescription: String { return self._s[1683]! } + public var Conversation_ContextMenuCopyLink: String { return self._s[1684]! } + public var PrivacyPolicy_AgeVerificationTitle: String { return self._s[1685]! } + public var SettingsSearch_Synonyms_Stickers_Masks: String { return self._s[1686]! } + public var TwoStepAuth_SetupPasswordEnterPasswordNew: String { return self._s[1687]! } public func Wallet_SecureStorageReset_BiometryText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1686]!, self._r[1686]!, [_0]) + return formatWithArgumentRanges(self._s[1688]!, self._r[1688]!, [_0]) } - public var Permissions_CellularDataTitle_v0: String { return self._s[1687]! } - public var WallpaperSearch_ColorWhite: String { return self._s[1689]! } - public var Channel_AdminLog_DefaultRestrictionsUpdated: String { return self._s[1690]! } - public var Conversation_ErrorInaccessibleMessage: String { return self._s[1691]! } - public var Map_OpenIn: String { return self._s[1692]! } + public var Permissions_CellularDataTitle_v0: String { return self._s[1689]! } + public var WallpaperSearch_ColorWhite: String { return self._s[1691]! } + public var Channel_AdminLog_DefaultRestrictionsUpdated: String { return self._s[1692]! } + public var Conversation_ErrorInaccessibleMessage: String { return self._s[1693]! } + public var Map_OpenIn: String { return self._s[1694]! } public func PUSH_PHONE_CALL_MISSED(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1695]!, self._r[1695]!, [_1]) + return formatWithArgumentRanges(self._s[1697]!, self._r[1697]!, [_1]) } public func ChannelInfo_AddParticipantConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1696]!, self._r[1696]!, [_0]) + return formatWithArgumentRanges(self._s[1698]!, self._r[1698]!, [_0]) } - public var GroupInfo_Permissions_SlowmodeHeader: String { return self._s[1697]! } - public var MessagePoll_LabelClosed: String { return self._s[1698]! } - public var GroupPermission_PermissionGloballyDisabled: String { return self._s[1700]! } - public var Wallet_Send_SendAnyway: String { return self._s[1701]! } - public var Passport_Identity_MiddleNamePlaceholder: String { return self._s[1702]! } - public var UserInfo_FirstNamePlaceholder: String { return self._s[1703]! } - public var PrivacyLastSeenSettings_WhoCanSeeMyTimestamp: String { return self._s[1704]! } - public var Login_SelectCountry_Title: String { return self._s[1705]! } - public var Channel_EditAdmin_PermissionBanUsers: String { return self._s[1706]! } + public var GroupInfo_Permissions_SlowmodeHeader: String { return self._s[1699]! } + public var MessagePoll_LabelClosed: String { return self._s[1700]! } + public var GroupPermission_PermissionGloballyDisabled: String { return self._s[1702]! } + public var Wallet_Send_SendAnyway: String { return self._s[1703]! } + public var Passport_Identity_MiddleNamePlaceholder: String { return self._s[1704]! } + public var UserInfo_FirstNamePlaceholder: String { return self._s[1705]! } + public var PrivacyLastSeenSettings_WhoCanSeeMyTimestamp: String { return self._s[1706]! } + public var Login_SelectCountry_Title: String { return self._s[1707]! } + public var Channel_EditAdmin_PermissionBanUsers: String { return self._s[1708]! } public func Conversation_OpenBotLinkLogin(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1707]!, self._r[1707]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1709]!, self._r[1709]!, [_1, _2]) } - public var Channel_AdminLog_ChangeInfo: String { return self._s[1708]! } - public var Watch_Suggestion_BRB: String { return self._s[1709]! } - public var Passport_Identity_EditIdentityCard: String { return self._s[1710]! } - public var Contacts_PermissionsTitle: String { return self._s[1711]! } - public var Conversation_RestrictedInline: String { return self._s[1712]! } - public var StickerPack_ViewPack: String { return self._s[1714]! } - public var Wallet_UnknownError: String { return self._s[1715]! } + public var Channel_AdminLog_ChangeInfo: String { return self._s[1710]! } + public var Watch_Suggestion_BRB: String { return self._s[1711]! } + public var Passport_Identity_EditIdentityCard: String { return self._s[1712]! } + public var Contacts_PermissionsTitle: String { return self._s[1713]! } + public var Conversation_RestrictedInline: String { return self._s[1714]! } + public var StickerPack_ViewPack: String { return self._s[1716]! } + public var Wallet_UnknownError: String { return self._s[1717]! } public func Update_AppVersion(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1716]!, self._r[1716]!, [_0]) + return formatWithArgumentRanges(self._s[1718]!, self._r[1718]!, [_0]) } - public var Compose_NewChannel: String { return self._s[1718]! } - public var ChatSettings_AutoDownloadSettings_TypePhoto: String { return self._s[1721]! } - public var Conversation_ReportSpamGroupConfirmation: String { return self._s[1723]! } - public var Channel_Info_Stickers: String { return self._s[1724]! } - public var AutoNightTheme_PreferredTheme: String { return self._s[1725]! } - public var PrivacyPolicy_AgeVerificationAgree: String { return self._s[1726]! } - public var Passport_DeletePersonalDetails: String { return self._s[1727]! } - public var LogoutOptions_AddAccountTitle: String { return self._s[1728]! } - public var Channel_DiscussionGroupInfo: String { return self._s[1729]! } - public var Group_EditAdmin_RankOwnerPlaceholder: String { return self._s[1730]! } - public var Conversation_SearchNoResults: String { return self._s[1732]! } - public var Wallet_Configuration_ApplyErrorTextURLInvalid: String { return self._s[1733]! } - public var MessagePoll_LabelAnonymous: String { return self._s[1734]! } - public var Channel_Members_AddAdminErrorNotAMember: String { return self._s[1735]! } - public var Login_Code: String { return self._s[1736]! } - public var EditTheme_Create_BottomInfo: String { return self._s[1737]! } - public var Watch_Suggestion_WhatsUp: String { return self._s[1738]! } - public var Weekday_ShortThursday: String { return self._s[1739]! } - public var Resolve_ErrorNotFound: String { return self._s[1741]! } - public var LastSeen_Offline: String { return self._s[1742]! } - public var PeopleNearby_NoMembers: String { return self._s[1743]! } - public var GroupPermission_AddMembersNotAvailable: String { return self._s[1744]! } - public var Privacy_Calls_AlwaysAllow_Title: String { return self._s[1745]! } - public var GroupInfo_Title: String { return self._s[1747]! } - public var NotificationsSound_Note: String { return self._s[1748]! } - public var Conversation_EditingMessagePanelTitle: String { return self._s[1749]! } - public var Watch_Message_Poll: String { return self._s[1750]! } - public var Privacy_Calls: String { return self._s[1751]! } + public var Compose_NewChannel: String { return self._s[1720]! } + public var ChatSettings_AutoDownloadSettings_TypePhoto: String { return self._s[1723]! } + public var Conversation_ReportSpamGroupConfirmation: String { return self._s[1725]! } + public var Channel_Info_Stickers: String { return self._s[1726]! } + public var AutoNightTheme_PreferredTheme: String { return self._s[1727]! } + public var PrivacyPolicy_AgeVerificationAgree: String { return self._s[1728]! } + public var Passport_DeletePersonalDetails: String { return self._s[1729]! } + public var LogoutOptions_AddAccountTitle: String { return self._s[1730]! } + public var Channel_DiscussionGroupInfo: String { return self._s[1731]! } + public var Group_EditAdmin_RankOwnerPlaceholder: String { return self._s[1732]! } + public var Conversation_SearchNoResults: String { return self._s[1734]! } + public var Wallet_Configuration_ApplyErrorTextURLInvalid: String { return self._s[1735]! } + public var MessagePoll_LabelAnonymous: String { return self._s[1736]! } + public var Channel_Members_AddAdminErrorNotAMember: String { return self._s[1737]! } + public var Login_Code: String { return self._s[1738]! } + public var EditTheme_Create_BottomInfo: String { return self._s[1739]! } + public var Watch_Suggestion_WhatsUp: String { return self._s[1740]! } + public var Weekday_ShortThursday: String { return self._s[1741]! } + public var Resolve_ErrorNotFound: String { return self._s[1743]! } + public var LastSeen_Offline: String { return self._s[1744]! } + public var PeopleNearby_NoMembers: String { return self._s[1745]! } + public var GroupPermission_AddMembersNotAvailable: String { return self._s[1746]! } + public var Privacy_Calls_AlwaysAllow_Title: String { return self._s[1747]! } + public var GroupInfo_Title: String { return self._s[1749]! } + public var NotificationsSound_Note: String { return self._s[1750]! } + public var Conversation_EditingMessagePanelTitle: String { return self._s[1751]! } + public var Watch_Message_Poll: String { return self._s[1752]! } + public var Privacy_Calls: String { return self._s[1753]! } public func Channel_AdminLog_MessageRankUsername(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1752]!, self._r[1752]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1754]!, self._r[1754]!, [_1, _2, _3]) } - public var Month_ShortAugust: String { return self._s[1753]! } - public var TwoStepAuth_SetPasswordHelp: String { return self._s[1754]! } - public var Notifications_Reset: String { return self._s[1755]! } - public var Conversation_Pin: String { return self._s[1756]! } - public var Passport_Language_lv: String { return self._s[1757]! } - public var Permissions_PeopleNearbyAllowInSettings_v0: String { return self._s[1758]! } - public var BlockedUsers_Info: String { return self._s[1759]! } - public var SettingsSearch_Synonyms_Data_AutoplayVideos: String { return self._s[1761]! } - public var Watch_Conversation_Unblock: String { return self._s[1763]! } + public var Month_ShortAugust: String { return self._s[1755]! } + public var TwoStepAuth_SetPasswordHelp: String { return self._s[1756]! } + public var Notifications_Reset: String { return self._s[1757]! } + public var Conversation_Pin: String { return self._s[1758]! } + public var Passport_Language_lv: String { return self._s[1759]! } + public var Permissions_PeopleNearbyAllowInSettings_v0: String { return self._s[1760]! } + public var BlockedUsers_Info: String { return self._s[1761]! } + public var SettingsSearch_Synonyms_Data_AutoplayVideos: String { return self._s[1763]! } + public var Watch_Conversation_Unblock: String { return self._s[1765]! } public func Time_MonthOfYear_m9(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1764]!, self._r[1764]!, [_0]) + return formatWithArgumentRanges(self._s[1766]!, self._r[1766]!, [_0]) } - public var CloudStorage_Title: String { return self._s[1765]! } - public var GroupInfo_DeleteAndExitConfirmation: String { return self._s[1766]! } + public var CloudStorage_Title: String { return self._s[1767]! } + public var GroupInfo_DeleteAndExitConfirmation: String { return self._s[1768]! } public func NetworkUsageSettings_WifiUsageSince(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1767]!, self._r[1767]!, [_0]) + return formatWithArgumentRanges(self._s[1769]!, self._r[1769]!, [_0]) } - public var Channel_AdminLogFilter_AdminsTitle: String { return self._s[1768]! } - public var Watch_Suggestion_OnMyWay: String { return self._s[1769]! } - public var TwoStepAuth_RecoveryEmailTitle: String { return self._s[1770]! } - public var Passport_Address_EditBankStatement: String { return self._s[1771]! } + public var Channel_AdminLogFilter_AdminsTitle: String { return self._s[1770]! } + public var Watch_Suggestion_OnMyWay: String { return self._s[1771]! } + public var TwoStepAuth_RecoveryEmailTitle: String { return self._s[1772]! } + public var Passport_Address_EditBankStatement: String { return self._s[1773]! } public func Channel_AdminLog_MessageChangedUnlinkedGroup(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1772]!, self._r[1772]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1774]!, self._r[1774]!, [_1, _2]) } - public var ChatSettings_DownloadInBackgroundInfo: String { return self._s[1773]! } - public var ShareMenu_Comment: String { return self._s[1774]! } - public var Permissions_ContactsTitle_v0: String { return self._s[1775]! } - public var Notifications_PermissionsTitle: String { return self._s[1776]! } - public var GroupPermission_NoSendLinks: String { return self._s[1777]! } - public var Privacy_Forwards_NeverAllow_Title: String { return self._s[1778]! } - public var Wallet_SecureStorageChanged_ImportWallet: String { return self._s[1779]! } - public var Settings_Support: String { return self._s[1780]! } - public var Notifications_ChannelNotificationsSound: String { return self._s[1781]! } - public var SettingsSearch_Synonyms_Data_AutoDownloadReset: String { return self._s[1782]! } - public var Privacy_Forwards_Preview: String { return self._s[1783]! } - public var GroupPermission_ApplyAlertAction: String { return self._s[1784]! } - public var Watch_Stickers_StickerPacks: String { return self._s[1785]! } - public var Common_Select: String { return self._s[1787]! } - public var CheckoutInfo_ErrorEmailInvalid: String { return self._s[1788]! } - public var WallpaperSearch_ColorGray: String { return self._s[1791]! } - public var TwoFactorSetup_Password_PlaceholderPassword: String { return self._s[1792]! } - public var TwoFactorSetup_Hint_SkipAction: String { return self._s[1793]! } - public var ChatAdmins_AllMembersAreAdminsOffHelp: String { return self._s[1794]! } - public var PasscodeSettings_AutoLock_IfAwayFor_5hours: String { return self._s[1795]! } - public var Appearance_PreviewReplyAuthor: String { return self._s[1796]! } - public var TwoStepAuth_RecoveryTitle: String { return self._s[1797]! } - public var Widget_AuthRequired: String { return self._s[1798]! } - public var Camera_FlashOn: String { return self._s[1799]! } - public var Conversation_ContextMenuLookUp: String { return self._s[1800]! } - public var Channel_Stickers_NotFoundHelp: String { return self._s[1801]! } - public var Watch_Suggestion_OK: String { return self._s[1802]! } + public var ChatSettings_DownloadInBackgroundInfo: String { return self._s[1775]! } + public var ShareMenu_Comment: String { return self._s[1776]! } + public var Permissions_ContactsTitle_v0: String { return self._s[1777]! } + public var Notifications_PermissionsTitle: String { return self._s[1778]! } + public var GroupPermission_NoSendLinks: String { return self._s[1779]! } + public var Privacy_Forwards_NeverAllow_Title: String { return self._s[1780]! } + public var Wallet_SecureStorageChanged_ImportWallet: String { return self._s[1781]! } + public var Settings_Support: String { return self._s[1782]! } + public var Notifications_ChannelNotificationsSound: String { return self._s[1783]! } + public var SettingsSearch_Synonyms_Data_AutoDownloadReset: String { return self._s[1784]! } + public var Privacy_Forwards_Preview: String { return self._s[1785]! } + public var GroupPermission_ApplyAlertAction: String { return self._s[1786]! } + public var Watch_Stickers_StickerPacks: String { return self._s[1787]! } + public var Common_Select: String { return self._s[1789]! } + public var CheckoutInfo_ErrorEmailInvalid: String { return self._s[1790]! } + public var WallpaperSearch_ColorGray: String { return self._s[1793]! } + public var TwoFactorSetup_Password_PlaceholderPassword: String { return self._s[1794]! } + public var TwoFactorSetup_Hint_SkipAction: String { return self._s[1795]! } + public var ChatAdmins_AllMembersAreAdminsOffHelp: String { return self._s[1796]! } + public var PasscodeSettings_AutoLock_IfAwayFor_5hours: String { return self._s[1797]! } + public var Appearance_PreviewReplyAuthor: String { return self._s[1798]! } + public var TwoStepAuth_RecoveryTitle: String { return self._s[1799]! } + public var Widget_AuthRequired: String { return self._s[1800]! } + public var Camera_FlashOn: String { return self._s[1801]! } + public var Conversation_ContextMenuLookUp: String { return self._s[1802]! } + public var Channel_Stickers_NotFoundHelp: String { return self._s[1803]! } + public var Watch_Suggestion_OK: String { return self._s[1804]! } public func Username_LinkHint(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1804]!, self._r[1804]!, [_0]) - } - public func Notification_PinnedLiveLocationMessage(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1806]!, self._r[1806]!, [_0]) } - public var TextFormat_Strikethrough: String { return self._s[1807]! } - public var DialogList_AdLabel: String { return self._s[1808]! } - public var WatchRemote_NotificationText: String { return self._s[1809]! } - public var SettingsSearch_Synonyms_Notifications_MessageNotificationsAlert: String { return self._s[1810]! } - public var Conversation_ReportSpam: String { return self._s[1811]! } - public var SettingsSearch_Synonyms_Privacy_Data_TopPeers: String { return self._s[1812]! } - public var Settings_LogoutConfirmationTitle: String { return self._s[1814]! } - public var PhoneLabel_Title: String { return self._s[1815]! } - public var Passport_Address_EditRentalAgreement: String { return self._s[1816]! } - public var Settings_ChangePhoneNumber: String { return self._s[1817]! } - public var Notifications_ExceptionsTitle: String { return self._s[1818]! } - public var Notifications_AlertTones: String { return self._s[1819]! } - public var Call_ReportIncludeLogDescription: String { return self._s[1820]! } - public var SettingsSearch_Synonyms_Notifications_ResetAllNotifications: String { return self._s[1821]! } - public var AutoDownloadSettings_PrivateChats: String { return self._s[1822]! } - public var VoiceOver_Chat_Photo: String { return self._s[1824]! } - public var TwoStepAuth_AddHintTitle: String { return self._s[1825]! } - public var ReportPeer_ReasonOther: String { return self._s[1826]! } - public var ChatList_Context_JoinChannel: String { return self._s[1827]! } - public var KeyCommand_ScrollDown: String { return self._s[1829]! } - public var Conversation_ScheduleMessage_Title: String { return self._s[1830]! } + public func Notification_PinnedLiveLocationMessage(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1808]!, self._r[1808]!, [_0]) + } + public var TextFormat_Strikethrough: String { return self._s[1809]! } + public var DialogList_AdLabel: String { return self._s[1810]! } + public var WatchRemote_NotificationText: String { return self._s[1811]! } + public var SettingsSearch_Synonyms_Notifications_MessageNotificationsAlert: String { return self._s[1812]! } + public var Conversation_ReportSpam: String { return self._s[1813]! } + public var SettingsSearch_Synonyms_Privacy_Data_TopPeers: String { return self._s[1814]! } + public var Settings_LogoutConfirmationTitle: String { return self._s[1816]! } + public var PhoneLabel_Title: String { return self._s[1817]! } + public var Passport_Address_EditRentalAgreement: String { return self._s[1818]! } + public var Settings_ChangePhoneNumber: String { return self._s[1819]! } + public var Notifications_ExceptionsTitle: String { return self._s[1820]! } + public var Notifications_AlertTones: String { return self._s[1821]! } + public var Call_ReportIncludeLogDescription: String { return self._s[1822]! } + public var SettingsSearch_Synonyms_Notifications_ResetAllNotifications: String { return self._s[1823]! } + public var AutoDownloadSettings_PrivateChats: String { return self._s[1824]! } + public var VoiceOver_Chat_Photo: String { return self._s[1826]! } + public var TwoStepAuth_AddHintTitle: String { return self._s[1827]! } + public var ReportPeer_ReasonOther: String { return self._s[1828]! } + public var ChatList_Context_JoinChannel: String { return self._s[1829]! } + public var KeyCommand_ScrollDown: String { return self._s[1831]! } + public var Conversation_ScheduleMessage_Title: String { return self._s[1832]! } public func Login_BannedPhoneSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1831]!, self._r[1831]!, [_0]) + return formatWithArgumentRanges(self._s[1833]!, self._r[1833]!, [_0]) } - public var NetworkUsageSettings_MediaVideoDataSection: String { return self._s[1832]! } - public var ChannelInfo_DeleteGroupConfirmation: String { return self._s[1833]! } - public var AuthSessions_LogOut: String { return self._s[1834]! } - public var Passport_Identity_TypeInternalPassport: String { return self._s[1835]! } - public var ChatSettings_AutoDownloadVoiceMessages: String { return self._s[1836]! } - public var Passport_Phone_Title: String { return self._s[1837]! } - public var ContactList_Context_StartSecretChat: String { return self._s[1838]! } - public var Settings_PhoneNumber: String { return self._s[1839]! } + public var NetworkUsageSettings_MediaVideoDataSection: String { return self._s[1834]! } + public var ChannelInfo_DeleteGroupConfirmation: String { return self._s[1835]! } + public var AuthSessions_LogOut: String { return self._s[1836]! } + public var Passport_Identity_TypeInternalPassport: String { return self._s[1837]! } + public var ChatSettings_AutoDownloadVoiceMessages: String { return self._s[1838]! } + public var Passport_Phone_Title: String { return self._s[1839]! } + public var ContactList_Context_StartSecretChat: String { return self._s[1840]! } + public var Settings_PhoneNumber: String { return self._s[1841]! } public func Conversation_ScheduleMessage_SendToday(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1840]!, self._r[1840]!, [_0]) + return formatWithArgumentRanges(self._s[1842]!, self._r[1842]!, [_0]) } - public var NotificationsSound_Alert: String { return self._s[1841]! } - public var Wallet_SecureStorageChanged_CreateWallet: String { return self._s[1842]! } - public var WebSearch_SearchNoResults: String { return self._s[1843]! } - public var Privacy_ProfilePhoto_AlwaysShareWith_Title: String { return self._s[1845]! } - public var Wallet_Configuration_SourceInfo: String { return self._s[1846]! } - public var LogoutOptions_AlternativeOptionsSection: String { return self._s[1847]! } - public var SettingsSearch_Synonyms_Passport: String { return self._s[1848]! } - public var PhotoEditor_CurvesTool: String { return self._s[1849]! } - public var Checkout_PaymentMethod: String { return self._s[1851]! } + public var NotificationsSound_Alert: String { return self._s[1843]! } + public var Wallet_SecureStorageChanged_CreateWallet: String { return self._s[1844]! } + public var WebSearch_SearchNoResults: String { return self._s[1845]! } + public var Privacy_ProfilePhoto_AlwaysShareWith_Title: String { return self._s[1847]! } + public var Wallet_Configuration_SourceInfo: String { return self._s[1848]! } + public var LogoutOptions_AlternativeOptionsSection: String { return self._s[1849]! } + public var SettingsSearch_Synonyms_Passport: String { return self._s[1850]! } + public var PhotoEditor_CurvesTool: String { return self._s[1851]! } + public var Checkout_PaymentMethod: String { return self._s[1853]! } public func PUSH_CHAT_ADD_YOU(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1852]!, self._r[1852]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1854]!, self._r[1854]!, [_1, _2]) } - public var Contacts_AccessDeniedError: String { return self._s[1853]! } - public var Camera_PhotoMode: String { return self._s[1856]! } - public var EditTheme_Expand_Preview_IncomingText: String { return self._s[1857]! } - public var Passport_Address_AddUtilityBill: String { return self._s[1859]! } - public var CallSettings_OnMobile: String { return self._s[1860]! } - public var Tour_Text2: String { return self._s[1861]! } + public var Contacts_AccessDeniedError: String { return self._s[1855]! } + public var Camera_PhotoMode: String { return self._s[1858]! } + public var EditTheme_Expand_Preview_IncomingText: String { return self._s[1859]! } + public var Appearance_TextSize_Apply: String { return self._s[1860]! } + public var Passport_Address_AddUtilityBill: String { return self._s[1862]! } + public var CallSettings_OnMobile: String { return self._s[1863]! } + public var Tour_Text2: String { return self._s[1864]! } public func PUSH_CHAT_MESSAGE_ROUND(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1862]!, self._r[1862]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1865]!, self._r[1865]!, [_1, _2]) } - public var DialogList_EncryptionProcessing: String { return self._s[1864]! } - public var Permissions_Skip: String { return self._s[1865]! } - public var Wallet_Words_NotDoneOk: String { return self._s[1866]! } - public var SecretImage_Title: String { return self._s[1867]! } - public var Watch_MessageView_Title: String { return self._s[1868]! } - public var Channel_DiscussionGroupAdd: String { return self._s[1869]! } - public var AttachmentMenu_Poll: String { return self._s[1870]! } + public var DialogList_EncryptionProcessing: String { return self._s[1867]! } + public var Permissions_Skip: String { return self._s[1868]! } + public var Wallet_Words_NotDoneOk: String { return self._s[1869]! } + public var SecretImage_Title: String { return self._s[1870]! } + public var Watch_MessageView_Title: String { return self._s[1871]! } + public var Channel_DiscussionGroupAdd: String { return self._s[1872]! } + public var AttachmentMenu_Poll: String { return self._s[1873]! } public func Notification_GroupInviter(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1871]!, self._r[1871]!, [_0]) + return formatWithArgumentRanges(self._s[1874]!, self._r[1874]!, [_0]) } public func Channel_DiscussionGroup_PrivateChannelLink(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1872]!, self._r[1872]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1875]!, self._r[1875]!, [_1, _2]) } - public var Notification_CallCanceled: String { return self._s[1873]! } - public var WallpaperPreview_Title: String { return self._s[1874]! } - public var Privacy_PaymentsClear_PaymentInfo: String { return self._s[1875]! } - public var Settings_ProxyConnecting: String { return self._s[1876]! } - public var Settings_CheckPhoneNumberText: String { return self._s[1878]! } - public var VoiceOver_Chat_YourVideo: String { return self._s[1879]! } - public var Wallet_Intro_Title: String { return self._s[1880]! } - public var TwoFactorSetup_Password_Action: String { return self._s[1881]! } - public var Profile_MessageLifetime5s: String { return self._s[1882]! } - public var Username_InvalidCharacters: String { return self._s[1883]! } - public var VoiceOver_Media_PlaybackRateFast: String { return self._s[1884]! } - public var ScheduledMessages_ClearAll: String { return self._s[1885]! } - public var WallpaperPreview_CropBottomText: String { return self._s[1886]! } - public var AutoDownloadSettings_LimitBySize: String { return self._s[1887]! } - public var Settings_AddAccount: String { return self._s[1888]! } - public var Notification_CreatedChannel: String { return self._s[1891]! } + public var Notification_CallCanceled: String { return self._s[1876]! } + public var WallpaperPreview_Title: String { return self._s[1877]! } + public var Privacy_PaymentsClear_PaymentInfo: String { return self._s[1878]! } + public var Settings_ProxyConnecting: String { return self._s[1879]! } + public var Settings_CheckPhoneNumberText: String { return self._s[1881]! } + public var VoiceOver_Chat_YourVideo: String { return self._s[1882]! } + public var Wallet_Intro_Title: String { return self._s[1883]! } + public var TwoFactorSetup_Password_Action: String { return self._s[1884]! } + public var Profile_MessageLifetime5s: String { return self._s[1885]! } + public var Username_InvalidCharacters: String { return self._s[1886]! } + public var VoiceOver_Media_PlaybackRateFast: String { return self._s[1887]! } + public var ScheduledMessages_ClearAll: String { return self._s[1888]! } + public var WallpaperPreview_CropBottomText: String { return self._s[1889]! } + public var AutoDownloadSettings_LimitBySize: String { return self._s[1890]! } + public var Settings_AddAccount: String { return self._s[1891]! } + public var Notification_CreatedChannel: String { return self._s[1894]! } public func PUSH_CHAT_DELETE_MEMBER(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1892]!, self._r[1892]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[1895]!, self._r[1895]!, [_1, _2, _3]) } - public var Passcode_AppLockedAlert: String { return self._s[1894]! } - public var StickerPacksSettings_AnimatedStickersInfo: String { return self._s[1895]! } - public var VoiceOver_Media_PlaybackStop: String { return self._s[1896]! } - public var Contacts_TopSection: String { return self._s[1897]! } - public var ChatList_DeleteForEveryoneConfirmationAction: String { return self._s[1898]! } + public var Passcode_AppLockedAlert: String { return self._s[1897]! } + public var StickerPacksSettings_AnimatedStickersInfo: String { return self._s[1898]! } + public var VoiceOver_Media_PlaybackStop: String { return self._s[1899]! } + public var Contacts_TopSection: String { return self._s[1900]! } + public var ChatList_DeleteForEveryoneConfirmationAction: String { return self._s[1901]! } public func Conversation_SetReminder_RemindOn(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1899]!, self._r[1899]!, [_0, _1]) + return formatWithArgumentRanges(self._s[1902]!, self._r[1902]!, [_0, _1]) } - public var Wallet_Info_Receive: String { return self._s[1900]! } - public var Wallet_Completed_ViewWallet: String { return self._s[1901]! } + public var Wallet_Info_Receive: String { return self._s[1903]! } + public var Wallet_Completed_ViewWallet: String { return self._s[1904]! } public func Time_MonthOfYear_m6(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1902]!, self._r[1902]!, [_0]) + return formatWithArgumentRanges(self._s[1905]!, self._r[1905]!, [_0]) } - public var ReportPeer_ReasonSpam: String { return self._s[1903]! } - public var UserInfo_TapToCall: String { return self._s[1904]! } - public var Conversation_ForwardAuthorHiddenTooltip: String { return self._s[1906]! } - public var AutoDownloadSettings_DataUsageCustom: String { return self._s[1907]! } - public var Common_Search: String { return self._s[1908]! } - public var ScheduledMessages_EmptyPlaceholder: String { return self._s[1909]! } + public var ReportPeer_ReasonSpam: String { return self._s[1906]! } + public var UserInfo_TapToCall: String { return self._s[1907]! } + public var Conversation_ForwardAuthorHiddenTooltip: String { return self._s[1909]! } + public var AutoDownloadSettings_DataUsageCustom: String { return self._s[1910]! } + public var Common_Search: String { return self._s[1911]! } + public var ScheduledMessages_EmptyPlaceholder: String { return self._s[1912]! } public func Channel_AdminLog_MessageChangedGroupGeoLocation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1910]!, self._r[1910]!, [_0]) + return formatWithArgumentRanges(self._s[1913]!, self._r[1913]!, [_0]) } - public var Wallet_Month_ShortJuly: String { return self._s[1911]! } - public var AuthSessions_IncompleteAttemptsInfo: String { return self._s[1913]! } - public var Message_InvoiceLabel: String { return self._s[1914]! } - public var Conversation_InputTextPlaceholder: String { return self._s[1915]! } - public var NetworkUsageSettings_MediaImageDataSection: String { return self._s[1916]! } + public var Wallet_Month_ShortJuly: String { return self._s[1914]! } + public var AuthSessions_IncompleteAttemptsInfo: String { return self._s[1916]! } + public var Message_InvoiceLabel: String { return self._s[1917]! } + public var Conversation_InputTextPlaceholder: String { return self._s[1918]! } + public var NetworkUsageSettings_MediaImageDataSection: String { return self._s[1919]! } public func Passport_Address_UploadOneOfScan(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1917]!, self._r[1917]!, [_0]) + return formatWithArgumentRanges(self._s[1920]!, self._r[1920]!, [_0]) } - public var Conversation_Info: String { return self._s[1918]! } - public var Login_InfoDeletePhoto: String { return self._s[1919]! } - public var Passport_Language_vi: String { return self._s[1921]! } - public var UserInfo_ScamUserWarning: String { return self._s[1922]! } - public var Conversation_Search: String { return self._s[1923]! } - public var DialogList_DeleteBotConversationConfirmation: String { return self._s[1925]! } - public var ReportPeer_ReasonPornography: String { return self._s[1926]! } - public var AutoDownloadSettings_PhotosTitle: String { return self._s[1927]! } - public var Conversation_SendMessageErrorGroupRestricted: String { return self._s[1928]! } - public var Map_LiveLocationGroupDescription: String { return self._s[1929]! } - public var Channel_Setup_TypeHeader: String { return self._s[1930]! } - public var AuthSessions_LoggedIn: String { return self._s[1931]! } - public var Privacy_Forwards_AlwaysAllow_Title: String { return self._s[1932]! } - public var Login_SmsRequestState3: String { return self._s[1933]! } - public var Passport_Address_EditUtilityBill: String { return self._s[1934]! } - public var Appearance_ReduceMotionInfo: String { return self._s[1935]! } - public var Join_ChannelsTooMuch: String { return self._s[1936]! } - public var Channel_Edit_LinkItem: String { return self._s[1937]! } - public var Privacy_Calls_P2PNever: String { return self._s[1938]! } - public var Conversation_AddToReadingList: String { return self._s[1940]! } - public var Share_MultipleMessagesDisabled: String { return self._s[1941]! } - public var Message_Animation: String { return self._s[1942]! } - public var Conversation_DefaultRestrictedMedia: String { return self._s[1943]! } - public var Map_Unknown: String { return self._s[1944]! } - public var AutoDownloadSettings_LastDelimeter: String { return self._s[1945]! } + public var Conversation_Info: String { return self._s[1921]! } + public var Login_InfoDeletePhoto: String { return self._s[1922]! } + public var Passport_Language_vi: String { return self._s[1924]! } + public var UserInfo_ScamUserWarning: String { return self._s[1925]! } + public var Conversation_Search: String { return self._s[1926]! } + public var DialogList_DeleteBotConversationConfirmation: String { return self._s[1928]! } + public var ReportPeer_ReasonPornography: String { return self._s[1929]! } + public var AutoDownloadSettings_PhotosTitle: String { return self._s[1930]! } + public var Conversation_SendMessageErrorGroupRestricted: String { return self._s[1931]! } + public var Map_LiveLocationGroupDescription: String { return self._s[1932]! } + public var Channel_Setup_TypeHeader: String { return self._s[1933]! } + public var AuthSessions_LoggedIn: String { return self._s[1934]! } + public var Privacy_Forwards_AlwaysAllow_Title: String { return self._s[1935]! } + public var Login_SmsRequestState3: String { return self._s[1936]! } + public var Passport_Address_EditUtilityBill: String { return self._s[1937]! } + public var Appearance_ReduceMotionInfo: String { return self._s[1938]! } + public var Join_ChannelsTooMuch: String { return self._s[1939]! } + public var Channel_Edit_LinkItem: String { return self._s[1940]! } + public var Privacy_Calls_P2PNever: String { return self._s[1941]! } + public var Conversation_AddToReadingList: String { return self._s[1943]! } + public var Share_MultipleMessagesDisabled: String { return self._s[1944]! } + public var Message_Animation: String { return self._s[1945]! } + public var Conversation_DefaultRestrictedMedia: String { return self._s[1946]! } + public var Map_Unknown: String { return self._s[1947]! } + public var AutoDownloadSettings_LastDelimeter: String { return self._s[1948]! } public func PUSH_PINNED_TEXT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1946]!, self._r[1946]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1949]!, self._r[1949]!, [_1, _2]) } public func Passport_FieldOneOf_Or(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1947]!, self._r[1947]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1950]!, self._r[1950]!, [_1, _2]) } - public var Call_StatusRequesting: String { return self._s[1948]! } - public var Conversation_SecretChatContextBotAlert: String { return self._s[1949]! } - public var SocksProxySetup_ProxyStatusChecking: String { return self._s[1950]! } + public var Call_StatusRequesting: String { return self._s[1951]! } + public var Conversation_SecretChatContextBotAlert: String { return self._s[1952]! } + public var SocksProxySetup_ProxyStatusChecking: String { return self._s[1953]! } public func PUSH_CHAT_MESSAGE_DOC(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1951]!, self._r[1951]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1954]!, self._r[1954]!, [_1, _2]) } public func Notification_PinnedLocationMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1952]!, self._r[1952]!, [_0]) + return formatWithArgumentRanges(self._s[1955]!, self._r[1955]!, [_0]) } - public var Update_Skip: String { return self._s[1953]! } - public var Group_Username_RemoveExistingUsernamesInfo: String { return self._s[1954]! } - public var Message_PinnedPollMessage: String { return self._s[1955]! } - public var BlockedUsers_Title: String { return self._s[1956]! } + public var Update_Skip: String { return self._s[1956]! } + public var Group_Username_RemoveExistingUsernamesInfo: String { return self._s[1957]! } + public var Message_PinnedPollMessage: String { return self._s[1958]! } + public var BlockedUsers_Title: String { return self._s[1959]! } public func PUSH_CHANNEL_MESSAGE_AUDIO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1957]!, self._r[1957]!, [_1]) + return formatWithArgumentRanges(self._s[1960]!, self._r[1960]!, [_1]) } - public var Username_CheckingUsername: String { return self._s[1958]! } - public var NotificationsSound_Bell: String { return self._s[1959]! } - public var Conversation_SendMessageErrorFlood: String { return self._s[1960]! } - public var Weekday_Monday: String { return self._s[1961]! } - public var SettingsSearch_Synonyms_Notifications_DisplayNamesOnLockScreen: String { return self._s[1962]! } - public var ChannelMembers_ChannelAdminsTitle: String { return self._s[1963]! } - public var ChatSettings_Groups: String { return self._s[1964]! } + public var Username_CheckingUsername: String { return self._s[1961]! } + public var NotificationsSound_Bell: String { return self._s[1962]! } + public var Conversation_SendMessageErrorFlood: String { return self._s[1963]! } + public var Weekday_Monday: String { return self._s[1964]! } + public var SettingsSearch_Synonyms_Notifications_DisplayNamesOnLockScreen: String { return self._s[1965]! } + public var ChannelMembers_ChannelAdminsTitle: String { return self._s[1966]! } + public var ChatSettings_Groups: String { return self._s[1967]! } public func Conversation_SetReminder_RemindTomorrow(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1965]!, self._r[1965]!, [_0]) + return formatWithArgumentRanges(self._s[1968]!, self._r[1968]!, [_0]) } - public var Your_card_was_declined: String { return self._s[1966]! } - public var TwoStepAuth_EnterPasswordHelp: String { return self._s[1968]! } - public var Wallet_Month_ShortApril: String { return self._s[1969]! } - public var ChatList_Unmute: String { return self._s[1970]! } - public var PhotoEditor_CurvesAll: String { return self._s[1971]! } - public var Weekday_ShortTuesday: String { return self._s[1972]! } - public var DialogList_Read: String { return self._s[1973]! } - public var Appearance_AppIconClassic: String { return self._s[1974]! } - public var ChannelMembers_WhoCanAddMembers_AllMembers: String { return self._s[1975]! } - public var Passport_Identity_Gender: String { return self._s[1976]! } + public var Your_card_was_declined: String { return self._s[1969]! } + public var TwoStepAuth_EnterPasswordHelp: String { return self._s[1971]! } + public var Wallet_Month_ShortApril: String { return self._s[1972]! } + public var ChatList_Unmute: String { return self._s[1973]! } + public var PhotoEditor_CurvesAll: String { return self._s[1974]! } + public var Weekday_ShortTuesday: String { return self._s[1975]! } + public var DialogList_Read: String { return self._s[1976]! } + public var Appearance_AppIconClassic: String { return self._s[1977]! } + public var ChannelMembers_WhoCanAddMembers_AllMembers: String { return self._s[1978]! } + public var Passport_Identity_Gender: String { return self._s[1979]! } public func Target_ShareGameConfirmationPrivate(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1977]!, self._r[1977]!, [_0]) - } - public var Target_SelectGroup: String { return self._s[1978]! } - public func DialogList_EncryptedChatStartedIncoming(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[1980]!, self._r[1980]!, [_0]) } - public var Passport_Language_en: String { return self._s[1981]! } - public var AutoDownloadSettings_AutodownloadPhotos: String { return self._s[1982]! } - public var Channel_Username_CreatePublicLinkHelp: String { return self._s[1983]! } - public var Login_CancelPhoneVerificationContinue: String { return self._s[1984]! } - public var ScheduledMessages_SendNow: String { return self._s[1985]! } - public var Checkout_NewCard_PaymentCard: String { return self._s[1987]! } - public var Login_InfoHelp: String { return self._s[1988]! } - public var Contacts_PermissionsSuppressWarningTitle: String { return self._s[1989]! } - public var SettingsSearch_Synonyms_Stickers_FeaturedPacks: String { return self._s[1990]! } + public var Target_SelectGroup: String { return self._s[1981]! } + public func DialogList_EncryptedChatStartedIncoming(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[1983]!, self._r[1983]!, [_0]) + } + public var Passport_Language_en: String { return self._s[1984]! } + public var AutoDownloadSettings_AutodownloadPhotos: String { return self._s[1985]! } + public var Channel_Username_CreatePublicLinkHelp: String { return self._s[1986]! } + public var Login_CancelPhoneVerificationContinue: String { return self._s[1987]! } + public var ScheduledMessages_SendNow: String { return self._s[1988]! } + public var Checkout_NewCard_PaymentCard: String { return self._s[1990]! } + public var Login_InfoHelp: String { return self._s[1991]! } + public var Contacts_PermissionsSuppressWarningTitle: String { return self._s[1992]! } + public var SettingsSearch_Synonyms_Stickers_FeaturedPacks: String { return self._s[1993]! } public func Channel_AdminLog_MessageChangedLinkedChannel(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[1991]!, self._r[1991]!, [_1, _2]) + return formatWithArgumentRanges(self._s[1994]!, self._r[1994]!, [_1, _2]) } - public var SocksProxySetup_AddProxy: String { return self._s[1994]! } - public var CreatePoll_Title: String { return self._s[1995]! } - public var Conversation_ViewTheme: String { return self._s[1996]! } - public var SettingsSearch_Synonyms_Privacy_Data_SecretChatLinkPreview: String { return self._s[1997]! } - public var PasscodeSettings_SimplePasscodeHelp: String { return self._s[1998]! } - public var TwoFactorSetup_Intro_Text: String { return self._s[1999]! } - public var UserInfo_GroupsInCommon: String { return self._s[2000]! } - public var TelegramWallet_Intro_TermsUrl: String { return self._s[2001]! } - public var Call_AudioRouteHide: String { return self._s[2002]! } + public var SocksProxySetup_AddProxy: String { return self._s[1997]! } + public var CreatePoll_Title: String { return self._s[1998]! } + public var Conversation_ViewTheme: String { return self._s[1999]! } + public var SettingsSearch_Synonyms_Privacy_Data_SecretChatLinkPreview: String { return self._s[2000]! } + public var PasscodeSettings_SimplePasscodeHelp: String { return self._s[2001]! } + public var TwoFactorSetup_Intro_Text: String { return self._s[2002]! } + public var UserInfo_GroupsInCommon: String { return self._s[2003]! } + public var TelegramWallet_Intro_TermsUrl: String { return self._s[2004]! } + public var Call_AudioRouteHide: String { return self._s[2005]! } public func Wallet_Info_TransactionDateHeader(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2004]!, self._r[2004]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2007]!, self._r[2007]!, [_1, _2]) } - public var ContactInfo_PhoneLabelMobile: String { return self._s[2005]! } + public var ContactInfo_PhoneLabelMobile: String { return self._s[2008]! } public func ChatList_LeaveGroupConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2006]!, self._r[2006]!, [_0]) + return formatWithArgumentRanges(self._s[2009]!, self._r[2009]!, [_0]) } - public var TextFormat_Bold: String { return self._s[2007]! } - public var FastTwoStepSetup_EmailSection: String { return self._s[2008]! } - public var Notifications_Title: String { return self._s[2009]! } - public var Group_Username_InvalidTooShort: String { return self._s[2010]! } - public var Channel_ErrorAddTooMuch: String { return self._s[2011]! } + public var TextFormat_Bold: String { return self._s[2010]! } + public var FastTwoStepSetup_EmailSection: String { return self._s[2011]! } + public var Notifications_Title: String { return self._s[2012]! } + public var Group_Username_InvalidTooShort: String { return self._s[2013]! } + public var Channel_ErrorAddTooMuch: String { return self._s[2014]! } public func DialogList_MultipleTypingSuffix(_ _0: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2012]!, self._r[2012]!, ["\(_0)"]) + return formatWithArgumentRanges(self._s[2015]!, self._r[2015]!, ["\(_0)"]) } - public var VoiceOver_DiscardPreparedContent: String { return self._s[2014]! } - public var Stickers_SuggestAdded: String { return self._s[2015]! } - public var Login_CountryCode: String { return self._s[2016]! } - public var ChatSettings_AutoPlayVideos: String { return self._s[2017]! } - public var Map_GetDirections: String { return self._s[2018]! } - public var Wallet_Receive_ShareInvoiceUrl: String { return self._s[2019]! } - public var Login_PhoneFloodError: String { return self._s[2020]! } + public var VoiceOver_DiscardPreparedContent: String { return self._s[2017]! } + public var Stickers_SuggestAdded: String { return self._s[2018]! } + public var Login_CountryCode: String { return self._s[2019]! } + public var ChatSettings_AutoPlayVideos: String { return self._s[2020]! } + public var Map_GetDirections: String { return self._s[2021]! } + public var Wallet_Receive_ShareInvoiceUrl: String { return self._s[2022]! } + public var Login_PhoneFloodError: String { return self._s[2023]! } public func Time_MonthOfYear_m3(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2021]!, self._r[2021]!, [_0]) + return formatWithArgumentRanges(self._s[2024]!, self._r[2024]!, [_0]) } public func Wallet_Time_PreciseDate_m10(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2022]!, self._r[2022]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2025]!, self._r[2025]!, [_1, _2, _3]) } - public var Settings_SetUsername: String { return self._s[2024]! } - public var Group_Location_ChangeLocation: String { return self._s[2025]! } - public var Notification_GroupInviterSelf: String { return self._s[2026]! } - public var InstantPage_TapToOpenLink: String { return self._s[2027]! } + public var Settings_SetUsername: String { return self._s[2027]! } + public var Group_Location_ChangeLocation: String { return self._s[2028]! } + public var Notification_GroupInviterSelf: String { return self._s[2029]! } + public var InstantPage_TapToOpenLink: String { return self._s[2030]! } public func Notification_ChannelInviter(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2028]!, self._r[2028]!, [_0]) + return formatWithArgumentRanges(self._s[2031]!, self._r[2031]!, [_0]) } - public var Watch_Suggestion_TalkLater: String { return self._s[2029]! } - public var SecretChat_Title: String { return self._s[2030]! } - public var Group_UpgradeNoticeText1: String { return self._s[2031]! } - public var AuthSessions_Title: String { return self._s[2032]! } + public var Watch_Suggestion_TalkLater: String { return self._s[2032]! } + public var SecretChat_Title: String { return self._s[2033]! } + public var Group_UpgradeNoticeText1: String { return self._s[2034]! } + public var AuthSessions_Title: String { return self._s[2035]! } public func TextFormat_AddLinkText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2033]!, self._r[2033]!, [_0]) + return formatWithArgumentRanges(self._s[2036]!, self._r[2036]!, [_0]) } - public var PhotoEditor_CropAuto: String { return self._s[2034]! } - public var Channel_About_Title: String { return self._s[2035]! } - public var FastTwoStepSetup_EmailHelp: String { return self._s[2036]! } + public var PhotoEditor_CropAuto: String { return self._s[2037]! } + public var Channel_About_Title: String { return self._s[2038]! } + public var FastTwoStepSetup_EmailHelp: String { return self._s[2039]! } public func Conversation_Bytes(_ _0: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2038]!, self._r[2038]!, ["\(_0)"]) + return formatWithArgumentRanges(self._s[2041]!, self._r[2041]!, ["\(_0)"]) } - public var VoiceOver_MessageContextReport: String { return self._s[2039]! } - public var Conversation_PinMessageAlert_OnlyPin: String { return self._s[2041]! } - public var Group_Setup_HistoryVisibleHelp: String { return self._s[2042]! } + public var VoiceOver_MessageContextReport: String { return self._s[2042]! } + public var Conversation_PinMessageAlert_OnlyPin: String { return self._s[2044]! } + public var Group_Setup_HistoryVisibleHelp: String { return self._s[2045]! } public func PUSH_MESSAGE_GIF(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2043]!, self._r[2043]!, [_1]) + return formatWithArgumentRanges(self._s[2046]!, self._r[2046]!, [_1]) } public func SharedMedia_SearchNoResultsDescription(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2045]!, self._r[2045]!, [_0]) + return formatWithArgumentRanges(self._s[2048]!, self._r[2048]!, [_0]) } public func TwoStepAuth_RecoveryEmailUnavailable(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2046]!, self._r[2046]!, [_0]) + return formatWithArgumentRanges(self._s[2049]!, self._r[2049]!, [_0]) } - public var Privacy_PaymentsClearInfoHelp: String { return self._s[2047]! } - public var Presence_online: String { return self._s[2050]! } - public var PasscodeSettings_Title: String { return self._s[2051]! } - public var Passport_Identity_ExpiryDatePlaceholder: String { return self._s[2052]! } - public var Web_OpenExternal: String { return self._s[2053]! } - public var AutoDownloadSettings_AutoDownload: String { return self._s[2055]! } - public var Channel_OwnershipTransfer_EnterPasswordText: String { return self._s[2056]! } - public var LocalGroup_Title: String { return self._s[2057]! } + public var Privacy_PaymentsClearInfoHelp: String { return self._s[2050]! } + public var Presence_online: String { return self._s[2053]! } + public var PasscodeSettings_Title: String { return self._s[2054]! } + public var Passport_Identity_ExpiryDatePlaceholder: String { return self._s[2055]! } + public var Web_OpenExternal: String { return self._s[2056]! } + public var AutoDownloadSettings_AutoDownload: String { return self._s[2058]! } + public var Channel_OwnershipTransfer_EnterPasswordText: String { return self._s[2059]! } + public var LocalGroup_Title: String { return self._s[2060]! } public func AutoNightTheme_AutomaticHelp(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2058]!, self._r[2058]!, [_0]) - } - public var FastTwoStepSetup_PasswordConfirmationPlaceholder: String { return self._s[2059]! } - public var Map_YouAreHere: String { return self._s[2060]! } - public func AuthSessions_Message(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[2061]!, self._r[2061]!, [_0]) } - public func ChatList_DeleteChatConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2062]!, self._r[2062]!, [_0]) + public var FastTwoStepSetup_PasswordConfirmationPlaceholder: String { return self._s[2062]! } + public var Map_YouAreHere: String { return self._s[2063]! } + public func AuthSessions_Message(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2064]!, self._r[2064]!, [_0]) } - public var PrivacyLastSeenSettings_AlwaysShareWith: String { return self._s[2063]! } - public var Target_InviteToGroupErrorAlreadyInvited: String { return self._s[2064]! } - public func AuthSessions_AppUnofficial(_ _0: String) -> (String, [(Int, NSRange)]) { + public func ChatList_DeleteChatConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[2065]!, self._r[2065]!, [_0]) } - public func DialogList_LiveLocationSharingTo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2066]!, self._r[2066]!, [_0]) + public var PrivacyLastSeenSettings_AlwaysShareWith: String { return self._s[2066]! } + public var Target_InviteToGroupErrorAlreadyInvited: String { return self._s[2067]! } + public func AuthSessions_AppUnofficial(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2068]!, self._r[2068]!, [_0]) } - public var SocksProxySetup_Username: String { return self._s[2067]! } - public var Bot_Start: String { return self._s[2068]! } - public func Channel_AdminLog_EmptyFilterQueryText(_ _0: String) -> (String, [(Int, NSRange)]) { + public func DialogList_LiveLocationSharingTo(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[2069]!, self._r[2069]!, [_0]) } - public func Channel_AdminLog_MessagePinned(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2070]!, self._r[2070]!, [_0]) + public var SocksProxySetup_Username: String { return self._s[2070]! } + public var Bot_Start: String { return self._s[2071]! } + public func Channel_AdminLog_EmptyFilterQueryText(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2072]!, self._r[2072]!, [_0]) } - public var Contacts_SortByPresence: String { return self._s[2071]! } - public var AccentColor_Title: String { return self._s[2073]! } - public var Conversation_DiscardVoiceMessageTitle: String { return self._s[2074]! } + public func Channel_AdminLog_MessagePinned(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2073]!, self._r[2073]!, [_0]) + } + public var Contacts_SortByPresence: String { return self._s[2074]! } + public var AccentColor_Title: String { return self._s[2076]! } + public var Conversation_DiscardVoiceMessageTitle: String { return self._s[2077]! } public func PUSH_CHAT_CREATED(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2075]!, self._r[2075]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2078]!, self._r[2078]!, [_1, _2]) } public func PrivacySettings_LastSeenContactsMinus(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2076]!, self._r[2076]!, [_0]) + return formatWithArgumentRanges(self._s[2079]!, self._r[2079]!, [_0]) } public func Channel_AdminLog_MessageChangedLinkedGroup(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2077]!, self._r[2077]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2080]!, self._r[2080]!, [_1, _2]) } - public var Passport_Email_EnterOtherEmail: String { return self._s[2078]! } - public var Login_InfoAvatarPhoto: String { return self._s[2079]! } - public var Privacy_PaymentsClear_ShippingInfo: String { return self._s[2080]! } - public var Tour_Title4: String { return self._s[2081]! } - public var Passport_Identity_Translation: String { return self._s[2082]! } - public var SettingsSearch_Synonyms_Notifications_ContactJoined: String { return self._s[2083]! } - public var Login_TermsOfServiceLabel: String { return self._s[2085]! } - public var Passport_Language_it: String { return self._s[2086]! } - public var KeyCommand_JumpToNextUnreadChat: String { return self._s[2087]! } - public var Passport_Identity_SelfieHelp: String { return self._s[2088]! } - public var Conversation_ClearAll: String { return self._s[2090]! } - public var Wallet_Send_UninitializedText: String { return self._s[2092]! } - public var Channel_OwnershipTransfer_Title: String { return self._s[2093]! } - public var TwoStepAuth_FloodError: String { return self._s[2094]! } + public var Passport_Email_EnterOtherEmail: String { return self._s[2081]! } + public var Login_InfoAvatarPhoto: String { return self._s[2082]! } + public var Privacy_PaymentsClear_ShippingInfo: String { return self._s[2083]! } + public var Tour_Title4: String { return self._s[2084]! } + public var Passport_Identity_Translation: String { return self._s[2085]! } + public var SettingsSearch_Synonyms_Notifications_ContactJoined: String { return self._s[2086]! } + public var Login_TermsOfServiceLabel: String { return self._s[2088]! } + public var Passport_Language_it: String { return self._s[2089]! } + public var KeyCommand_JumpToNextUnreadChat: String { return self._s[2090]! } + public var Passport_Identity_SelfieHelp: String { return self._s[2091]! } + public var Conversation_ClearAll: String { return self._s[2093]! } + public var Wallet_Send_UninitializedText: String { return self._s[2095]! } + public var Channel_OwnershipTransfer_Title: String { return self._s[2096]! } + public var TwoStepAuth_FloodError: String { return self._s[2097]! } public func PUSH_CHANNEL_MESSAGE_GEO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2095]!, self._r[2095]!, [_1]) + return formatWithArgumentRanges(self._s[2098]!, self._r[2098]!, [_1]) } - public var Paint_Delete: String { return self._s[2096]! } + public var Paint_Delete: String { return self._s[2099]! } public func Wallet_Sent_Text(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2097]!, self._r[2097]!, [_0]) + return formatWithArgumentRanges(self._s[2100]!, self._r[2100]!, [_0]) } - public var Privacy_AddNewPeer: String { return self._s[2098]! } + public var Privacy_AddNewPeer: String { return self._s[2101]! } public func Channel_AdminLog_MessageRank(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2099]!, self._r[2099]!, [_1]) + return formatWithArgumentRanges(self._s[2102]!, self._r[2102]!, [_1]) } - public var LogoutOptions_SetPasscodeText: String { return self._s[2100]! } + public var LogoutOptions_SetPasscodeText: String { return self._s[2103]! } public func Passport_AcceptHelp(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2101]!, self._r[2101]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2104]!, self._r[2104]!, [_1, _2]) } - public var Message_PinnedAudioMessage: String { return self._s[2102]! } + public var Message_PinnedAudioMessage: String { return self._s[2105]! } public func Watch_Time_ShortTodayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2103]!, self._r[2103]!, [_0]) + return formatWithArgumentRanges(self._s[2106]!, self._r[2106]!, [_0]) } - public var Notification_Mute1hMin: String { return self._s[2104]! } - public var Notifications_GroupNotificationsSound: String { return self._s[2105]! } - public var Wallet_Month_GenNovember: String { return self._s[2106]! } - public var SocksProxySetup_ShareProxyList: String { return self._s[2107]! } - public var Conversation_MessageEditedLabel: String { return self._s[2108]! } + public var Notification_Mute1hMin: String { return self._s[2107]! } + public var Notifications_GroupNotificationsSound: String { return self._s[2108]! } + public var Wallet_Month_GenNovember: String { return self._s[2109]! } + public var SocksProxySetup_ShareProxyList: String { return self._s[2110]! } + public var Conversation_MessageEditedLabel: String { return self._s[2111]! } public func ClearCache_Success(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2109]!, self._r[2109]!, [_0, _1]) + return formatWithArgumentRanges(self._s[2112]!, self._r[2112]!, [_0, _1]) } - public var Notification_Exceptions_AlwaysOff: String { return self._s[2110]! } - public var Notification_Exceptions_NewException_MessagePreviewHeader: String { return self._s[2111]! } + public var Notification_Exceptions_AlwaysOff: String { return self._s[2113]! } + public var Notification_Exceptions_NewException_MessagePreviewHeader: String { return self._s[2114]! } public func Channel_AdminLog_MessageAdmin(_ _0: String, _ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2112]!, self._r[2112]!, [_0, _1, _2]) + return formatWithArgumentRanges(self._s[2115]!, self._r[2115]!, [_0, _1, _2]) } - public var NetworkUsageSettings_ResetStats: String { return self._s[2113]! } + public var NetworkUsageSettings_ResetStats: String { return self._s[2116]! } public func PUSH_MESSAGE_GEOLIVE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2114]!, self._r[2114]!, [_1]) + return formatWithArgumentRanges(self._s[2117]!, self._r[2117]!, [_1]) } - public var AccessDenied_LocationTracking: String { return self._s[2115]! } - public var Month_GenOctober: String { return self._s[2116]! } - public var GroupInfo_InviteLink_RevokeAlert_Revoke: String { return self._s[2117]! } - public var EnterPasscode_EnterPasscode: String { return self._s[2118]! } - public var MediaPicker_TimerTooltip: String { return self._s[2120]! } - public var SharedMedia_TitleAll: String { return self._s[2121]! } - public var SettingsSearch_Synonyms_Notifications_ChannelNotificationsExceptions: String { return self._s[2124]! } - public var Conversation_RestrictedMedia: String { return self._s[2125]! } - public var AccessDenied_PhotosRestricted: String { return self._s[2126]! } - public var Privacy_Forwards_WhoCanForward: String { return self._s[2128]! } - public var ChangePhoneNumberCode_Called: String { return self._s[2129]! } + public var AccessDenied_LocationTracking: String { return self._s[2118]! } + public var Month_GenOctober: String { return self._s[2119]! } + public var GroupInfo_InviteLink_RevokeAlert_Revoke: String { return self._s[2120]! } + public var EnterPasscode_EnterPasscode: String { return self._s[2121]! } + public var MediaPicker_TimerTooltip: String { return self._s[2123]! } + public var SharedMedia_TitleAll: String { return self._s[2124]! } + public var SettingsSearch_Synonyms_Notifications_ChannelNotificationsExceptions: String { return self._s[2127]! } + public var Conversation_RestrictedMedia: String { return self._s[2128]! } + public var AccessDenied_PhotosRestricted: String { return self._s[2129]! } + public var Privacy_Forwards_WhoCanForward: String { return self._s[2131]! } + public var ChangePhoneNumberCode_Called: String { return self._s[2132]! } public func Notification_PinnedDocumentMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2130]!, self._r[2130]!, [_0]) + return formatWithArgumentRanges(self._s[2133]!, self._r[2133]!, [_0]) } - public var Conversation_SavedMessages: String { return self._s[2133]! } - public var Your_cards_expiration_month_is_invalid: String { return self._s[2135]! } - public var FastTwoStepSetup_PasswordPlaceholder: String { return self._s[2136]! } + public var Conversation_SavedMessages: String { return self._s[2136]! } + public var Your_cards_expiration_month_is_invalid: String { return self._s[2138]! } + public var FastTwoStepSetup_PasswordPlaceholder: String { return self._s[2139]! } public func Target_ShareGameConfirmationGroup(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2138]!, self._r[2138]!, [_0]) + return formatWithArgumentRanges(self._s[2141]!, self._r[2141]!, [_0]) } - public var VoiceOver_Chat_YourMessage: String { return self._s[2139]! } + public var VoiceOver_Chat_YourMessage: String { return self._s[2142]! } public func VoiceOver_Chat_Title(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2140]!, self._r[2140]!, [_0]) + return formatWithArgumentRanges(self._s[2143]!, self._r[2143]!, [_0]) } - public var ReportPeer_AlertSuccess: String { return self._s[2141]! } - public var PhotoEditor_CropAspectRatioOriginal: String { return self._s[2142]! } + public var ReportPeer_AlertSuccess: String { return self._s[2144]! } + public var PhotoEditor_CropAspectRatioOriginal: String { return self._s[2145]! } public func InstantPage_RelatedArticleAuthorAndDateTitle(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2143]!, self._r[2143]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2146]!, self._r[2146]!, [_1, _2]) } - public var Checkout_PasswordEntry_Title: String { return self._s[2144]! } - public var PhotoEditor_FadeTool: String { return self._s[2145]! } - public var Privacy_ContactsReset: String { return self._s[2146]! } + public var Checkout_PasswordEntry_Title: String { return self._s[2147]! } + public var PhotoEditor_FadeTool: String { return self._s[2148]! } + public var Privacy_ContactsReset: String { return self._s[2149]! } public func Channel_AdminLog_MessageRestrictedUntil(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2148]!, self._r[2148]!, [_0]) + return formatWithArgumentRanges(self._s[2151]!, self._r[2151]!, [_0]) } - public var Message_PinnedVideoMessage: String { return self._s[2149]! } - public var ChatList_Mute: String { return self._s[2150]! } + public var Message_PinnedVideoMessage: String { return self._s[2152]! } + public var ChatList_Mute: String { return self._s[2153]! } public func Wallet_Time_PreciseDate_m5(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2151]!, self._r[2151]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2154]!, self._r[2154]!, [_1, _2, _3]) } - public var Permissions_CellularDataText_v0: String { return self._s[2152]! } - public var ShareMenu_SelectChats: String { return self._s[2155]! } - public var ChatList_Context_Unarchive: String { return self._s[2156]! } - public var MusicPlayer_VoiceNote: String { return self._s[2157]! } - public var Conversation_RestrictedText: String { return self._s[2158]! } - public var SettingsSearch_Synonyms_Privacy_Data_DeleteDrafts: String { return self._s[2159]! } - public var Wallet_Month_GenApril: String { return self._s[2160]! } - public var Wallet_Month_ShortMarch: String { return self._s[2161]! } - public var TwoStepAuth_DisableSuccess: String { return self._s[2162]! } - public var Cache_Videos: String { return self._s[2163]! } - public var PrivacySettings_PhoneNumber: String { return self._s[2164]! } - public var Wallet_Month_GenFebruary: String { return self._s[2165]! } - public var FeatureDisabled_Oops: String { return self._s[2167]! } - public var Passport_Address_PostcodePlaceholder: String { return self._s[2168]! } + public var Permissions_CellularDataText_v0: String { return self._s[2155]! } + public var ShareMenu_SelectChats: String { return self._s[2158]! } + public var ChatList_Context_Unarchive: String { return self._s[2159]! } + public var MusicPlayer_VoiceNote: String { return self._s[2160]! } + public var Conversation_RestrictedText: String { return self._s[2161]! } + public var SettingsSearch_Synonyms_Privacy_Data_DeleteDrafts: String { return self._s[2162]! } + public var Wallet_Month_GenApril: String { return self._s[2163]! } + public var Wallet_Month_ShortMarch: String { return self._s[2164]! } + public var TwoStepAuth_DisableSuccess: String { return self._s[2165]! } + public var Cache_Videos: String { return self._s[2166]! } + public var PrivacySettings_PhoneNumber: String { return self._s[2167]! } + public var Wallet_Month_GenFebruary: String { return self._s[2168]! } + public var FeatureDisabled_Oops: String { return self._s[2170]! } + public var Passport_Address_PostcodePlaceholder: String { return self._s[2171]! } public func AddContact_StatusSuccess(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2169]!, self._r[2169]!, [_0]) + return formatWithArgumentRanges(self._s[2172]!, self._r[2172]!, [_0]) } - public var Stickers_GroupStickersHelp: String { return self._s[2170]! } - public var GroupPermission_NoSendPolls: String { return self._s[2171]! } - public var Wallet_Qr_ScanCode: String { return self._s[2172]! } - public var Message_VideoExpired: String { return self._s[2174]! } - public var Notifications_Badge: String { return self._s[2175]! } - public var GroupInfo_GroupHistoryVisible: String { return self._s[2176]! } - public var Wallet_Receive_AddressCopied: String { return self._s[2177]! } - public var CreatePoll_OptionPlaceholder: String { return self._s[2178]! } - public var Username_InvalidTooShort: String { return self._s[2179]! } - public var EnterPasscode_EnterNewPasscodeChange: String { return self._s[2180]! } - public var Channel_AdminLog_PinMessages: String { return self._s[2181]! } - public var ArchivedChats_IntroTitle3: String { return self._s[2182]! } + public var Stickers_GroupStickersHelp: String { return self._s[2173]! } + public var GroupPermission_NoSendPolls: String { return self._s[2174]! } + public var Wallet_Qr_ScanCode: String { return self._s[2175]! } + public var Message_VideoExpired: String { return self._s[2177]! } + public var Notifications_Badge: String { return self._s[2178]! } + public var GroupInfo_GroupHistoryVisible: String { return self._s[2179]! } + public var Wallet_Receive_AddressCopied: String { return self._s[2180]! } + public var CreatePoll_OptionPlaceholder: String { return self._s[2181]! } + public var Username_InvalidTooShort: String { return self._s[2182]! } + public var EnterPasscode_EnterNewPasscodeChange: String { return self._s[2183]! } + public var Channel_AdminLog_PinMessages: String { return self._s[2184]! } + public var ArchivedChats_IntroTitle3: String { return self._s[2185]! } public func Notification_MessageLifetimeRemoved(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2183]!, self._r[2183]!, [_1]) + return formatWithArgumentRanges(self._s[2186]!, self._r[2186]!, [_1]) } - public var Permissions_SiriAllowInSettings_v0: String { return self._s[2184]! } - public var Conversation_DefaultRestrictedText: String { return self._s[2185]! } - public var SharedMedia_CategoryDocs: String { return self._s[2188]! } + public var Permissions_SiriAllowInSettings_v0: String { return self._s[2187]! } + public var Conversation_DefaultRestrictedText: String { return self._s[2188]! } + public var SharedMedia_CategoryDocs: String { return self._s[2191]! } public func PUSH_MESSAGE_CONTACT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2189]!, self._r[2189]!, [_1]) + return formatWithArgumentRanges(self._s[2192]!, self._r[2192]!, [_1]) } - public var Wallet_Send_UninitializedTitle: String { return self._s[2190]! } - public var Privacy_Forwards_NeverLink: String { return self._s[2192]! } + public var Wallet_Send_UninitializedTitle: String { return self._s[2193]! } + public var Privacy_Forwards_NeverLink: String { return self._s[2195]! } public func Notification_MessageLifetimeChangedOutgoing(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2193]!, self._r[2193]!, [_1]) + return formatWithArgumentRanges(self._s[2196]!, self._r[2196]!, [_1]) } - public var CheckoutInfo_ErrorShippingNotAvailable: String { return self._s[2194]! } + public var CheckoutInfo_ErrorShippingNotAvailable: String { return self._s[2197]! } public func Time_MonthOfYear_m12(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2195]!, self._r[2195]!, [_0]) + return formatWithArgumentRanges(self._s[2198]!, self._r[2198]!, [_0]) } - public var ChatSettings_PrivateChats: String { return self._s[2196]! } - public var SettingsSearch_Synonyms_EditProfile_Logout: String { return self._s[2197]! } - public var Conversation_PrivateMessageLinkCopied: String { return self._s[2198]! } - public var Channel_UpdatePhotoItem: String { return self._s[2199]! } - public var GroupInfo_LeftStatus: String { return self._s[2200]! } - public var Watch_MessageView_Forward: String { return self._s[2202]! } - public var ReportPeer_ReasonChildAbuse: String { return self._s[2203]! } - public var Cache_ClearEmpty: String { return self._s[2205]! } - public var Localization_LanguageName: String { return self._s[2206]! } - public var Wallet_AccessDenied_Title: String { return self._s[2207]! } - public var WebSearch_GIFs: String { return self._s[2208]! } - public var Notifications_DisplayNamesOnLockScreenInfoWithLink: String { return self._s[2209]! } - public var Wallet_AccessDenied_Settings: String { return self._s[2210]! } - public var Username_InvalidStartsWithNumber: String { return self._s[2211]! } - public var Common_Back: String { return self._s[2212]! } - public var GroupInfo_Permissions_EditingDisabled: String { return self._s[2213]! } - public var Passport_Identity_DateOfBirthPlaceholder: String { return self._s[2214]! } - public var Wallet_Send_Send: String { return self._s[2215]! } + public var ChatSettings_PrivateChats: String { return self._s[2199]! } + public var SettingsSearch_Synonyms_EditProfile_Logout: String { return self._s[2200]! } + public var Conversation_PrivateMessageLinkCopied: String { return self._s[2201]! } + public var Channel_UpdatePhotoItem: String { return self._s[2202]! } + public var GroupInfo_LeftStatus: String { return self._s[2203]! } + public var Watch_MessageView_Forward: String { return self._s[2205]! } + public var ReportPeer_ReasonChildAbuse: String { return self._s[2206]! } + public var Cache_ClearEmpty: String { return self._s[2208]! } + public var Localization_LanguageName: String { return self._s[2209]! } + public var Wallet_AccessDenied_Title: String { return self._s[2210]! } + public var WebSearch_GIFs: String { return self._s[2211]! } + public var Notifications_DisplayNamesOnLockScreenInfoWithLink: String { return self._s[2212]! } + public var Wallet_AccessDenied_Settings: String { return self._s[2213]! } + public var Username_InvalidStartsWithNumber: String { return self._s[2214]! } + public var Common_Back: String { return self._s[2215]! } + public var GroupInfo_Permissions_EditingDisabled: String { return self._s[2216]! } + public var Passport_Identity_DateOfBirthPlaceholder: String { return self._s[2217]! } + public var Wallet_Send_Send: String { return self._s[2218]! } public func PUSH_CHANNEL_MESSAGE_STICKER(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2216]!, self._r[2216]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2219]!, self._r[2219]!, [_1, _2]) } - public var Wallet_Info_RefreshErrorTitle: String { return self._s[2217]! } - public var Wallet_Month_GenJune: String { return self._s[2218]! } - public var Passport_Email_Help: String { return self._s[2219]! } - public var Watch_Conversation_Reply: String { return self._s[2221]! } - public var Conversation_EditingMessageMediaChange: String { return self._s[2224]! } - public var Passport_Identity_IssueDatePlaceholder: String { return self._s[2225]! } - public var Channel_BanUser_Unban: String { return self._s[2227]! } - public var Channel_EditAdmin_PermissionPostMessages: String { return self._s[2228]! } - public var Group_Username_CreatePublicLinkHelp: String { return self._s[2229]! } - public var TwoStepAuth_ConfirmEmailCodePlaceholder: String { return self._s[2231]! } - public var Wallet_Send_AddressHeader: String { return self._s[2232]! } - public var Passport_Identity_Name: String { return self._s[2233]! } + public var Wallet_Info_RefreshErrorTitle: String { return self._s[2220]! } + public var Wallet_Month_GenJune: String { return self._s[2221]! } + public var Passport_Email_Help: String { return self._s[2222]! } + public var Watch_Conversation_Reply: String { return self._s[2224]! } + public var Conversation_EditingMessageMediaChange: String { return self._s[2227]! } + public var Passport_Identity_IssueDatePlaceholder: String { return self._s[2228]! } + public var Channel_BanUser_Unban: String { return self._s[2230]! } + public var Channel_EditAdmin_PermissionPostMessages: String { return self._s[2231]! } + public var Group_Username_CreatePublicLinkHelp: String { return self._s[2232]! } + public var TwoStepAuth_ConfirmEmailCodePlaceholder: String { return self._s[2234]! } + public var Wallet_Send_AddressHeader: String { return self._s[2235]! } + public var Passport_Identity_Name: String { return self._s[2236]! } public func Channel_DiscussionGroup_HeaderGroupSet(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2234]!, self._r[2234]!, [_0]) + return formatWithArgumentRanges(self._s[2237]!, self._r[2237]!, [_0]) } - public var GroupRemoved_ViewUserInfo: String { return self._s[2235]! } - public var Conversation_BlockUser: String { return self._s[2236]! } - public var Month_GenJanuary: String { return self._s[2237]! } - public var ChatSettings_TextSize: String { return self._s[2238]! } - public var Notification_PassportValuePhone: String { return self._s[2239]! } - public var Passport_Language_ne: String { return self._s[2240]! } - public var Notification_CallBack: String { return self._s[2241]! } - public var Wallet_SecureStorageReset_BiometryTouchId: String { return self._s[2242]! } - public var TwoStepAuth_EmailHelp: String { return self._s[2243]! } + public var GroupRemoved_ViewUserInfo: String { return self._s[2238]! } + public var Conversation_BlockUser: String { return self._s[2239]! } + public var Month_GenJanuary: String { return self._s[2240]! } + public var ChatSettings_TextSize: String { return self._s[2241]! } + public var Notification_PassportValuePhone: String { return self._s[2242]! } + public var Passport_Language_ne: String { return self._s[2243]! } + public var Notification_CallBack: String { return self._s[2244]! } + public var Wallet_SecureStorageReset_BiometryTouchId: String { return self._s[2245]! } + public var TwoStepAuth_EmailHelp: String { return self._s[2246]! } public func Time_YesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2244]!, self._r[2244]!, [_0]) + return formatWithArgumentRanges(self._s[2247]!, self._r[2247]!, [_0]) } - public var Channel_Info_Management: String { return self._s[2245]! } - public var Passport_FieldIdentityUploadHelp: String { return self._s[2246]! } - public var Stickers_FrequentlyUsed: String { return self._s[2247]! } - public var Channel_BanUser_PermissionSendMessages: String { return self._s[2248]! } - public var Passport_Address_OneOfTypeUtilityBill: String { return self._s[2250]! } + public var Channel_Info_Management: String { return self._s[2248]! } + public var Passport_FieldIdentityUploadHelp: String { return self._s[2249]! } + public var Stickers_FrequentlyUsed: String { return self._s[2250]! } + public var Channel_BanUser_PermissionSendMessages: String { return self._s[2251]! } + public var Passport_Address_OneOfTypeUtilityBill: String { return self._s[2253]! } public func LOCAL_CHANNEL_MESSAGE_FWDS(_ _1: String, _ _2: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2251]!, self._r[2251]!, [_1, "\(_2)"]) + return formatWithArgumentRanges(self._s[2254]!, self._r[2254]!, [_1, "\(_2)"]) } - public var TwoFactorSetup_Password_Title: String { return self._s[2252]! } - public var Passport_Address_EditResidentialAddress: String { return self._s[2253]! } - public var PrivacyPolicy_DeclineTitle: String { return self._s[2254]! } - public var CreatePoll_TextHeader: String { return self._s[2255]! } + public var TwoFactorSetup_Password_Title: String { return self._s[2255]! } + public var Passport_Address_EditResidentialAddress: String { return self._s[2256]! } + public var PrivacyPolicy_DeclineTitle: String { return self._s[2257]! } + public var CreatePoll_TextHeader: String { return self._s[2258]! } public func Checkout_SavePasswordTimeoutAndTouchId(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2256]!, self._r[2256]!, [_0]) + return formatWithArgumentRanges(self._s[2259]!, self._r[2259]!, [_0]) } - public var PhotoEditor_QualityMedium: String { return self._s[2257]! } - public var InfoPlist_NSMicrophoneUsageDescription: String { return self._s[2258]! } - public var Conversation_StatusKickedFromChannel: String { return self._s[2260]! } - public var CheckoutInfo_ReceiverInfoName: String { return self._s[2261]! } - public var Group_ErrorSendRestrictedStickers: String { return self._s[2262]! } + public var PhotoEditor_QualityMedium: String { return self._s[2260]! } + public var InfoPlist_NSMicrophoneUsageDescription: String { return self._s[2261]! } + public var Conversation_StatusKickedFromChannel: String { return self._s[2263]! } + public var CheckoutInfo_ReceiverInfoName: String { return self._s[2264]! } + public var Group_ErrorSendRestrictedStickers: String { return self._s[2265]! } public func Conversation_RestrictedInlineTimed(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2263]!, self._r[2263]!, [_0]) + return formatWithArgumentRanges(self._s[2266]!, self._r[2266]!, [_0]) } public func Channel_AdminLog_MessageTransferedName(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2264]!, self._r[2264]!, [_1]) + return formatWithArgumentRanges(self._s[2267]!, self._r[2267]!, [_1]) } - public var LogoutOptions_LogOutWalletInfo: String { return self._s[2265]! } - public var TwoFactorSetup_Email_SkipConfirmationTitle: String { return self._s[2266]! } - public var Conversation_LinkDialogOpen: String { return self._s[2268]! } - public var TwoFactorSetup_Hint_Title: String { return self._s[2269]! } - public var VoiceOver_Chat_PollNoVotes: String { return self._s[2270]! } - public var Settings_Username: String { return self._s[2272]! } - public var Conversation_Block: String { return self._s[2274]! } - public var Wallpaper_Wallpaper: String { return self._s[2275]! } - public var SocksProxySetup_UseProxy: String { return self._s[2277]! } - public var Wallet_Send_Confirmation: String { return self._s[2278]! } - public var EditTheme_UploadEditedTheme: String { return self._s[2279]! } - public var UserInfo_ShareMyContactInfo: String { return self._s[2280]! } - public var MessageTimer_Forever: String { return self._s[2281]! } - public var Privacy_Calls_WhoCanCallMe: String { return self._s[2282]! } - public var PhotoEditor_DiscardChanges: String { return self._s[2283]! } - public var AuthSessions_TerminateOtherSessionsHelp: String { return self._s[2284]! } - public var Passport_Language_da: String { return self._s[2285]! } - public var SocksProxySetup_PortPlaceholder: String { return self._s[2286]! } + public var LogoutOptions_LogOutWalletInfo: String { return self._s[2268]! } + public var TwoFactorSetup_Email_SkipConfirmationTitle: String { return self._s[2269]! } + public var Conversation_LinkDialogOpen: String { return self._s[2271]! } + public var TwoFactorSetup_Hint_Title: String { return self._s[2272]! } + public var VoiceOver_Chat_PollNoVotes: String { return self._s[2273]! } + public var Settings_Username: String { return self._s[2275]! } + public var Conversation_Block: String { return self._s[2277]! } + public var Wallpaper_Wallpaper: String { return self._s[2278]! } + public var SocksProxySetup_UseProxy: String { return self._s[2280]! } + public var Wallet_Send_Confirmation: String { return self._s[2281]! } + public var EditTheme_UploadEditedTheme: String { return self._s[2282]! } + public var UserInfo_ShareMyContactInfo: String { return self._s[2283]! } + public var MessageTimer_Forever: String { return self._s[2284]! } + public var Privacy_Calls_WhoCanCallMe: String { return self._s[2285]! } + public var PhotoEditor_DiscardChanges: String { return self._s[2286]! } + public var AuthSessions_TerminateOtherSessionsHelp: String { return self._s[2287]! } + public var Passport_Language_da: String { return self._s[2288]! } + public var SocksProxySetup_PortPlaceholder: String { return self._s[2289]! } public func SecretGIF_NotViewedYet(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2287]!, self._r[2287]!, [_0]) - } - public var Passport_Address_EditPassportRegistration: String { return self._s[2288]! } - public func Channel_AdminLog_MessageChangedGroupAbout(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[2290]!, self._r[2290]!, [_0]) } - public var Passport_Identity_ResidenceCountryPlaceholder: String { return self._s[2292]! } - public var Conversation_SearchByName_Prefix: String { return self._s[2293]! } - public var Conversation_PinnedPoll: String { return self._s[2294]! } - public var Conversation_EmptyGifPanelPlaceholder: String { return self._s[2295]! } + public var Passport_Address_EditPassportRegistration: String { return self._s[2291]! } + public func Channel_AdminLog_MessageChangedGroupAbout(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2293]!, self._r[2293]!, [_0]) + } + public var Passport_Identity_ResidenceCountryPlaceholder: String { return self._s[2295]! } + public var Conversation_SearchByName_Prefix: String { return self._s[2296]! } + public var Conversation_PinnedPoll: String { return self._s[2297]! } + public var Conversation_EmptyGifPanelPlaceholder: String { return self._s[2298]! } public func PUSH_ENCRYPTION_ACCEPT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2296]!, self._r[2296]!, [_1]) + return formatWithArgumentRanges(self._s[2299]!, self._r[2299]!, [_1]) } - public var WallpaperSearch_ColorPurple: String { return self._s[2297]! } - public var Cache_ByPeerHeader: String { return self._s[2298]! } + public var WallpaperSearch_ColorPurple: String { return self._s[2300]! } + public var Cache_ByPeerHeader: String { return self._s[2301]! } public func Conversation_EncryptedPlaceholderTitleIncoming(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2299]!, self._r[2299]!, [_0]) + return formatWithArgumentRanges(self._s[2302]!, self._r[2302]!, [_0]) } - public var ChatSettings_AutoDownloadDocuments: String { return self._s[2300]! } - public var Appearance_ThemePreview_Chat_3_Text: String { return self._s[2303]! } - public var Wallet_Completed_Title: String { return self._s[2304]! } - public var Notification_PinnedMessage: String { return self._s[2305]! } - public var TwoFactorSetup_EmailVerification_Placeholder: String { return self._s[2306]! } - public var VoiceOver_Chat_RecordModeVideoMessage: String { return self._s[2308]! } - public var Contacts_SortBy: String { return self._s[2309]! } + public var ChatSettings_AutoDownloadDocuments: String { return self._s[2303]! } + public var Appearance_ThemePreview_Chat_3_Text: String { return self._s[2306]! } + public var Wallet_Completed_Title: String { return self._s[2307]! } + public var Notification_PinnedMessage: String { return self._s[2308]! } + public var TwoFactorSetup_EmailVerification_Placeholder: String { return self._s[2309]! } + public var VoiceOver_Chat_RecordModeVideoMessage: String { return self._s[2311]! } + public var Contacts_SortBy: String { return self._s[2312]! } public func PUSH_CHANNEL_MESSAGE_NOTEXT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2310]!, self._r[2310]!, [_1]) + return formatWithArgumentRanges(self._s[2313]!, self._r[2313]!, [_1]) } - public var Appearance_ColorThemeNight: String { return self._s[2312]! } + public var Appearance_ColorThemeNight: String { return self._s[2315]! } public func PUSH_MESSAGE_GAME(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2313]!, self._r[2313]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2316]!, self._r[2316]!, [_1, _2]) } - public var Call_EncryptionKey_Title: String { return self._s[2314]! } - public var Watch_UserInfo_Service: String { return self._s[2315]! } - public var SettingsSearch_Synonyms_Data_SaveEditedPhotos: String { return self._s[2317]! } - public var Conversation_Unpin: String { return self._s[2319]! } - public var CancelResetAccount_Title: String { return self._s[2320]! } - public var Map_LiveLocationFor15Minutes: String { return self._s[2321]! } + public var Call_EncryptionKey_Title: String { return self._s[2317]! } + public var Watch_UserInfo_Service: String { return self._s[2318]! } + public var SettingsSearch_Synonyms_Data_SaveEditedPhotos: String { return self._s[2320]! } + public var Conversation_Unpin: String { return self._s[2322]! } + public var CancelResetAccount_Title: String { return self._s[2323]! } + public var Map_LiveLocationFor15Minutes: String { return self._s[2324]! } public func Time_PreciseDate_m8(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2323]!, self._r[2323]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2326]!, self._r[2326]!, [_1, _2, _3]) } - public var Group_Members_AddMemberBotErrorNotAllowed: String { return self._s[2324]! } - public var CallSettings_Title: String { return self._s[2325]! } - public var SettingsSearch_Synonyms_Appearance_ChatBackground: String { return self._s[2326]! } - public var PasscodeSettings_EncryptDataHelp: String { return self._s[2328]! } - public var AutoDownloadSettings_Contacts: String { return self._s[2329]! } + public var Group_Members_AddMemberBotErrorNotAllowed: String { return self._s[2327]! } + public var CallSettings_Title: String { return self._s[2328]! } + public var SettingsSearch_Synonyms_Appearance_ChatBackground: String { return self._s[2329]! } + public var PasscodeSettings_EncryptDataHelp: String { return self._s[2331]! } + public var AutoDownloadSettings_Contacts: String { return self._s[2332]! } public func Channel_AdminLog_MessageRankName(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2330]!, self._r[2330]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2333]!, self._r[2333]!, [_1, _2]) } - public var Passport_Identity_DocumentDetails: String { return self._s[2331]! } - public var LoginPassword_PasswordHelp: String { return self._s[2332]! } - public var SettingsSearch_Synonyms_Data_AutoDownloadUsingWifi: String { return self._s[2333]! } - public var PrivacyLastSeenSettings_CustomShareSettings_Delete: String { return self._s[2334]! } - public var Checkout_TotalPaidAmount: String { return self._s[2335]! } + public var Passport_Identity_DocumentDetails: String { return self._s[2334]! } + public var LoginPassword_PasswordHelp: String { return self._s[2335]! } + public var SettingsSearch_Synonyms_Data_AutoDownloadUsingWifi: String { return self._s[2336]! } + public var PrivacyLastSeenSettings_CustomShareSettings_Delete: String { return self._s[2337]! } + public var Checkout_TotalPaidAmount: String { return self._s[2338]! } public func FileSize_KB(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2336]!, self._r[2336]!, [_0]) + return formatWithArgumentRanges(self._s[2339]!, self._r[2339]!, [_0]) } - public var PasscodeSettings_ChangePasscode: String { return self._s[2337]! } - public var Conversation_SecretLinkPreviewAlert: String { return self._s[2339]! } - public var Privacy_SecretChatsLinkPreviews: String { return self._s[2340]! } + public var PasscodeSettings_ChangePasscode: String { return self._s[2340]! } + public var Conversation_SecretLinkPreviewAlert: String { return self._s[2342]! } + public var Privacy_SecretChatsLinkPreviews: String { return self._s[2343]! } public func PUSH_CHANNEL_MESSAGE_DOC(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2341]!, self._r[2341]!, [_1]) + return formatWithArgumentRanges(self._s[2344]!, self._r[2344]!, [_1]) } - public var VoiceOver_Chat_ReplyToYourMessage: String { return self._s[2342]! } - public var Contacts_InviteFriends: String { return self._s[2344]! } - public var Map_ChooseLocationTitle: String { return self._s[2345]! } - public var Conversation_StopPoll: String { return self._s[2347]! } + public var VoiceOver_Chat_ReplyToYourMessage: String { return self._s[2345]! } + public var Contacts_InviteFriends: String { return self._s[2347]! } + public var Map_ChooseLocationTitle: String { return self._s[2348]! } + public var Conversation_StopPoll: String { return self._s[2350]! } public func WebSearch_SearchNoResultsDescription(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2348]!, self._r[2348]!, [_0]) + return formatWithArgumentRanges(self._s[2351]!, self._r[2351]!, [_0]) } - public var Call_Camera: String { return self._s[2349]! } - public var LogoutOptions_ChangePhoneNumberTitle: String { return self._s[2350]! } - public var AppWallet_Intro_Text: String { return self._s[2351]! } - public var Calls_RatingFeedback: String { return self._s[2352]! } - public var GroupInfo_BroadcastListNamePlaceholder: String { return self._s[2353]! } - public var Wallet_Alert_OK: String { return self._s[2354]! } - public var NotificationsSound_Pulse: String { return self._s[2355]! } - public var Watch_LastSeen_Lately: String { return self._s[2356]! } - public var ReportGroupLocation_Report: String { return self._s[2359]! } - public var Widget_NoUsers: String { return self._s[2360]! } - public var Conversation_UnvotePoll: String { return self._s[2361]! } - public var SettingsSearch_Synonyms_Privacy_ProfilePhoto: String { return self._s[2363]! } - public var Privacy_ProfilePhoto_WhoCanSeeMyPhoto: String { return self._s[2364]! } - public var NotificationsSound_Circles: String { return self._s[2365]! } - public var PrivacyLastSeenSettings_AlwaysShareWith_Title: String { return self._s[2368]! } - public var Wallet_Settings_DeleteWallet: String { return self._s[2369]! } - public var TwoStepAuth_RecoveryCodeExpired: String { return self._s[2370]! } - public var Proxy_TooltipUnavailable: String { return self._s[2371]! } - public var Passport_Identity_CountryPlaceholder: String { return self._s[2373]! } - public var GroupInfo_Permissions_SlowmodeInfo: String { return self._s[2375]! } - public var Conversation_FileDropbox: String { return self._s[2376]! } - public var Notifications_ExceptionsUnmuted: String { return self._s[2377]! } - public var Tour_Text3: String { return self._s[2379]! } - public var Login_ResetAccountProtected_Title: String { return self._s[2381]! } - public var GroupPermission_NoSendMessages: String { return self._s[2382]! } - public var WallpaperSearch_ColorTitle: String { return self._s[2383]! } - public var ChatAdmins_AllMembersAreAdminsOnHelp: String { return self._s[2384]! } + public var Call_Camera: String { return self._s[2352]! } + public var LogoutOptions_ChangePhoneNumberTitle: String { return self._s[2353]! } + public var AppWallet_Intro_Text: String { return self._s[2354]! } + public var Calls_RatingFeedback: String { return self._s[2355]! } + public var GroupInfo_BroadcastListNamePlaceholder: String { return self._s[2356]! } + public var Wallet_Alert_OK: String { return self._s[2357]! } + public var NotificationsSound_Pulse: String { return self._s[2358]! } + public var Watch_LastSeen_Lately: String { return self._s[2359]! } + public var ReportGroupLocation_Report: String { return self._s[2362]! } + public var Widget_NoUsers: String { return self._s[2363]! } + public var Conversation_UnvotePoll: String { return self._s[2364]! } + public var SettingsSearch_Synonyms_Privacy_ProfilePhoto: String { return self._s[2366]! } + public var Privacy_ProfilePhoto_WhoCanSeeMyPhoto: String { return self._s[2367]! } + public var NotificationsSound_Circles: String { return self._s[2368]! } + public var PrivacyLastSeenSettings_AlwaysShareWith_Title: String { return self._s[2371]! } + public var Wallet_Settings_DeleteWallet: String { return self._s[2372]! } + public var TwoStepAuth_RecoveryCodeExpired: String { return self._s[2373]! } + public var Proxy_TooltipUnavailable: String { return self._s[2374]! } + public var Passport_Identity_CountryPlaceholder: String { return self._s[2376]! } + public var GroupInfo_Permissions_SlowmodeInfo: String { return self._s[2378]! } + public var Conversation_FileDropbox: String { return self._s[2379]! } + public var Notifications_ExceptionsUnmuted: String { return self._s[2380]! } + public var Tour_Text3: String { return self._s[2382]! } + public var Login_ResetAccountProtected_Title: String { return self._s[2384]! } + public var GroupPermission_NoSendMessages: String { return self._s[2385]! } + public var WallpaperSearch_ColorTitle: String { return self._s[2386]! } + public var ChatAdmins_AllMembersAreAdminsOnHelp: String { return self._s[2387]! } public func Conversation_LiveLocationYouAnd(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2386]!, self._r[2386]!, [_0]) + return formatWithArgumentRanges(self._s[2389]!, self._r[2389]!, [_0]) } - public var GroupInfo_AddParticipantTitle: String { return self._s[2387]! } - public var Checkout_ShippingOption_Title: String { return self._s[2388]! } - public var ChatSettings_AutoDownloadTitle: String { return self._s[2389]! } + public var GroupInfo_AddParticipantTitle: String { return self._s[2390]! } + public var Checkout_ShippingOption_Title: String { return self._s[2391]! } + public var ChatSettings_AutoDownloadTitle: String { return self._s[2392]! } public func DialogList_SingleTypingSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2390]!, self._r[2390]!, [_0]) + return formatWithArgumentRanges(self._s[2393]!, self._r[2393]!, [_0]) } public func ChatSettings_AutoDownloadSettings_TypeVideo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2391]!, self._r[2391]!, [_0]) + return formatWithArgumentRanges(self._s[2394]!, self._r[2394]!, [_0]) } - public var Channel_Management_LabelAdministrator: String { return self._s[2392]! } - public var EditTheme_FileReadError: String { return self._s[2393]! } - public var OwnershipTransfer_ComeBackLater: String { return self._s[2394]! } - public var PrivacyLastSeenSettings_NeverShareWith_Placeholder: String { return self._s[2395]! } - public var AutoDownloadSettings_Photos: String { return self._s[2397]! } - public var Appearance_PreviewIncomingText: String { return self._s[2398]! } - public var ChatList_Context_MarkAllAsRead: String { return self._s[2399]! } - public var ChannelInfo_ConfirmLeave: String { return self._s[2400]! } - public var MediaPicker_MomentsDateRangeSameMonthYearFormat: String { return self._s[2401]! } - public var Passport_Identity_DocumentNumberPlaceholder: String { return self._s[2402]! } - public var Channel_AdminLogFilter_EventsNewMembers: String { return self._s[2403]! } - public var PasscodeSettings_AutoLock_IfAwayFor_5minutes: String { return self._s[2404]! } - public var GroupInfo_SetGroupPhotoStop: String { return self._s[2405]! } - public var Notification_SecretChatScreenshot: String { return self._s[2406]! } - public var AccessDenied_Wallpapers: String { return self._s[2407]! } - public var ChatList_Context_Mute: String { return self._s[2409]! } - public var Passport_Address_City: String { return self._s[2410]! } - public var InfoPlist_NSPhotoLibraryAddUsageDescription: String { return self._s[2411]! } - public var Appearance_ThemeCarouselClassic: String { return self._s[2412]! } - public var SocksProxySetup_SecretPlaceholder: String { return self._s[2413]! } - public var AccessDenied_LocationDisabled: String { return self._s[2414]! } - public var Group_Location_Title: String { return self._s[2415]! } - public var SocksProxySetup_HostnamePlaceholder: String { return self._s[2417]! } - public var GroupInfo_Sound: String { return self._s[2418]! } - public var SettingsSearch_Synonyms_ChatSettings_OpenLinksIn: String { return self._s[2419]! } - public var ChannelInfo_ScamChannelWarning: String { return self._s[2420]! } - public var Stickers_RemoveFromFavorites: String { return self._s[2421]! } - public var Contacts_Title: String { return self._s[2422]! } - public var EditTheme_ThemeTemplateAlertText: String { return self._s[2423]! } - public var Passport_Language_fr: String { return self._s[2424]! } - public var TwoFactorSetup_EmailVerification_Action: String { return self._s[2425]! } - public var Notifications_ResetAllNotifications: String { return self._s[2426]! } - public var PrivacySettings_SecurityTitle: String { return self._s[2429]! } - public var Checkout_NewCard_Title: String { return self._s[2430]! } - public var Login_HaveNotReceivedCodeInternal: String { return self._s[2431]! } - public var Conversation_ForwardChats: String { return self._s[2432]! } - public var Wallet_SecureStorageReset_PasscodeText: String { return self._s[2434]! } - public var PasscodeSettings_4DigitCode: String { return self._s[2435]! } - public var Settings_FAQ: String { return self._s[2437]! } - public var AutoDownloadSettings_DocumentsTitle: String { return self._s[2438]! } - public var Conversation_ContextMenuForward: String { return self._s[2439]! } - public var VoiceOver_Chat_YourPhoto: String { return self._s[2442]! } - public var PrivacyPolicy_Title: String { return self._s[2445]! } - public var Notifications_TextTone: String { return self._s[2446]! } - public var Profile_CreateNewContact: String { return self._s[2447]! } - public var PrivacyPhoneNumberSettings_WhoCanSeeMyPhoneNumber: String { return self._s[2448]! } - public var TwoFactorSetup_EmailVerification_Title: String { return self._s[2450]! } - public var Call_Speaker: String { return self._s[2451]! } - public var AutoNightTheme_AutomaticSection: String { return self._s[2452]! } - public var Channel_OwnershipTransfer_EnterPassword: String { return self._s[2454]! } - public var Channel_Username_InvalidCharacters: String { return self._s[2455]! } + public var Channel_Management_LabelAdministrator: String { return self._s[2395]! } + public var EditTheme_FileReadError: String { return self._s[2396]! } + public var OwnershipTransfer_ComeBackLater: String { return self._s[2397]! } + public var PrivacyLastSeenSettings_NeverShareWith_Placeholder: String { return self._s[2398]! } + public var AutoDownloadSettings_Photos: String { return self._s[2400]! } + public var Appearance_PreviewIncomingText: String { return self._s[2401]! } + public var ChatList_Context_MarkAllAsRead: String { return self._s[2402]! } + public var ChannelInfo_ConfirmLeave: String { return self._s[2403]! } + public var MediaPicker_MomentsDateRangeSameMonthYearFormat: String { return self._s[2404]! } + public var Passport_Identity_DocumentNumberPlaceholder: String { return self._s[2405]! } + public var Channel_AdminLogFilter_EventsNewMembers: String { return self._s[2406]! } + public var PasscodeSettings_AutoLock_IfAwayFor_5minutes: String { return self._s[2407]! } + public var GroupInfo_SetGroupPhotoStop: String { return self._s[2408]! } + public var Notification_SecretChatScreenshot: String { return self._s[2409]! } + public var AccessDenied_Wallpapers: String { return self._s[2410]! } + public var ChatList_Context_Mute: String { return self._s[2412]! } + public var Passport_Address_City: String { return self._s[2413]! } + public var InfoPlist_NSPhotoLibraryAddUsageDescription: String { return self._s[2414]! } + public var Appearance_ThemeCarouselClassic: String { return self._s[2415]! } + public var SocksProxySetup_SecretPlaceholder: String { return self._s[2416]! } + public var AccessDenied_LocationDisabled: String { return self._s[2417]! } + public var Group_Location_Title: String { return self._s[2418]! } + public var SocksProxySetup_HostnamePlaceholder: String { return self._s[2420]! } + public var GroupInfo_Sound: String { return self._s[2421]! } + public var SettingsSearch_Synonyms_ChatSettings_OpenLinksIn: String { return self._s[2422]! } + public var ChannelInfo_ScamChannelWarning: String { return self._s[2423]! } + public var Stickers_RemoveFromFavorites: String { return self._s[2424]! } + public var Contacts_Title: String { return self._s[2425]! } + public var EditTheme_ThemeTemplateAlertText: String { return self._s[2426]! } + public var Passport_Language_fr: String { return self._s[2427]! } + public var TwoFactorSetup_EmailVerification_Action: String { return self._s[2428]! } + public var Notifications_ResetAllNotifications: String { return self._s[2429]! } + public var PrivacySettings_SecurityTitle: String { return self._s[2432]! } + public var Checkout_NewCard_Title: String { return self._s[2433]! } + public var Login_HaveNotReceivedCodeInternal: String { return self._s[2434]! } + public var Conversation_ForwardChats: String { return self._s[2435]! } + public var Wallet_SecureStorageReset_PasscodeText: String { return self._s[2437]! } + public var PasscodeSettings_4DigitCode: String { return self._s[2438]! } + public var Settings_FAQ: String { return self._s[2440]! } + public var AutoDownloadSettings_DocumentsTitle: String { return self._s[2441]! } + public var Conversation_ContextMenuForward: String { return self._s[2442]! } + public var VoiceOver_Chat_YourPhoto: String { return self._s[2445]! } + public var PrivacyPolicy_Title: String { return self._s[2448]! } + public var Notifications_TextTone: String { return self._s[2449]! } + public var Profile_CreateNewContact: String { return self._s[2450]! } + public var PrivacyPhoneNumberSettings_WhoCanSeeMyPhoneNumber: String { return self._s[2451]! } + public var TwoFactorSetup_EmailVerification_Title: String { return self._s[2453]! } + public var Call_Speaker: String { return self._s[2454]! } + public var AutoNightTheme_AutomaticSection: String { return self._s[2455]! } + public var Channel_OwnershipTransfer_EnterPassword: String { return self._s[2457]! } + public var Channel_Username_InvalidCharacters: String { return self._s[2458]! } public func Channel_AdminLog_MessageChangedChannelUsername(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2456]!, self._r[2456]!, [_0]) + return formatWithArgumentRanges(self._s[2459]!, self._r[2459]!, [_0]) } - public var AutoDownloadSettings_AutodownloadFiles: String { return self._s[2457]! } - public var PrivacySettings_LastSeenTitle: String { return self._s[2458]! } - public var Channel_AdminLog_CanInviteUsers: String { return self._s[2459]! } - public var SettingsSearch_Synonyms_Privacy_Data_ClearPaymentsInfo: String { return self._s[2460]! } - public var OwnershipTransfer_SecurityCheck: String { return self._s[2461]! } - public var Conversation_MessageDeliveryFailed: String { return self._s[2462]! } - public var Watch_ChatList_NoConversationsText: String { return self._s[2463]! } - public var Bot_Unblock: String { return self._s[2464]! } - public var TextFormat_Italic: String { return self._s[2465]! } - public var WallpaperSearch_ColorPink: String { return self._s[2466]! } - public var Settings_About_Help: String { return self._s[2467]! } - public var SearchImages_Title: String { return self._s[2468]! } - public var Weekday_Wednesday: String { return self._s[2469]! } - public var Conversation_ClousStorageInfo_Description1: String { return self._s[2470]! } - public var ExplicitContent_AlertTitle: String { return self._s[2471]! } + public var AutoDownloadSettings_AutodownloadFiles: String { return self._s[2460]! } + public var PrivacySettings_LastSeenTitle: String { return self._s[2461]! } + public var Channel_AdminLog_CanInviteUsers: String { return self._s[2462]! } + public var SettingsSearch_Synonyms_Privacy_Data_ClearPaymentsInfo: String { return self._s[2463]! } + public var OwnershipTransfer_SecurityCheck: String { return self._s[2464]! } + public var Conversation_MessageDeliveryFailed: String { return self._s[2465]! } + public var Watch_ChatList_NoConversationsText: String { return self._s[2466]! } + public var Bot_Unblock: String { return self._s[2467]! } + public var TextFormat_Italic: String { return self._s[2468]! } + public var WallpaperSearch_ColorPink: String { return self._s[2469]! } + public var Settings_About_Help: String { return self._s[2470]! } + public var SearchImages_Title: String { return self._s[2471]! } + public var Weekday_Wednesday: String { return self._s[2472]! } + public var Conversation_ClousStorageInfo_Description1: String { return self._s[2473]! } + public var ExplicitContent_AlertTitle: String { return self._s[2474]! } public func Time_PreciseDate_m5(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2472]!, self._r[2472]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2475]!, self._r[2475]!, [_1, _2, _3]) } - public var Channel_DiscussionGroup_Create: String { return self._s[2473]! } - public var Weekday_Thursday: String { return self._s[2474]! } - public var Channel_BanUser_PermissionChangeGroupInfo: String { return self._s[2475]! } - public var Channel_Members_AddMembersHelp: String { return self._s[2476]! } + public var Channel_DiscussionGroup_Create: String { return self._s[2476]! } + public var Weekday_Thursday: String { return self._s[2477]! } + public var Channel_BanUser_PermissionChangeGroupInfo: String { return self._s[2478]! } + public var Channel_Members_AddMembersHelp: String { return self._s[2479]! } public func Checkout_SavePasswordTimeout(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2477]!, self._r[2477]!, [_0]) + return formatWithArgumentRanges(self._s[2480]!, self._r[2480]!, [_0]) } - public var Channel_DiscussionGroup_LinkGroup: String { return self._s[2478]! } - public var SettingsSearch_Synonyms_Notifications_InAppNotificationsVibrate: String { return self._s[2479]! } - public var Passport_RequestedInformation: String { return self._s[2480]! } - public var Login_PhoneAndCountryHelp: String { return self._s[2481]! } - public var Conversation_EncryptionProcessing: String { return self._s[2483]! } - public var Notifications_PermissionsSuppressWarningTitle: String { return self._s[2484]! } - public var PhotoEditor_EnhanceTool: String { return self._s[2486]! } - public var Channel_Setup_Title: String { return self._s[2487]! } - public var Conversation_SearchPlaceholder: String { return self._s[2488]! } - public var AccessDenied_LocationAlwaysDenied: String { return self._s[2489]! } - public var Checkout_ErrorGeneric: String { return self._s[2490]! } - public var Passport_Language_hu: String { return self._s[2491]! } - public var GroupPermission_EditingDisabled: String { return self._s[2492]! } - public var Wallet_Month_ShortSeptember: String { return self._s[2494]! } + public var Channel_DiscussionGroup_LinkGroup: String { return self._s[2481]! } + public var SettingsSearch_Synonyms_Notifications_InAppNotificationsVibrate: String { return self._s[2482]! } + public var Passport_RequestedInformation: String { return self._s[2483]! } + public var Login_PhoneAndCountryHelp: String { return self._s[2484]! } + public var Conversation_EncryptionProcessing: String { return self._s[2486]! } + public var Notifications_PermissionsSuppressWarningTitle: String { return self._s[2487]! } + public var PhotoEditor_EnhanceTool: String { return self._s[2489]! } + public var Channel_Setup_Title: String { return self._s[2490]! } + public var Conversation_SearchPlaceholder: String { return self._s[2491]! } + public var AccessDenied_LocationAlwaysDenied: String { return self._s[2492]! } + public var Checkout_ErrorGeneric: String { return self._s[2493]! } + public var Passport_Language_hu: String { return self._s[2494]! } + public var GroupPermission_EditingDisabled: String { return self._s[2495]! } + public var Wallet_Month_ShortSeptember: String { return self._s[2497]! } public func Passport_Identity_UploadOneOfScan(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2495]!, self._r[2495]!, [_0]) + return formatWithArgumentRanges(self._s[2498]!, self._r[2498]!, [_0]) } public func PUSH_MESSAGE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2498]!, self._r[2498]!, [_1]) + return formatWithArgumentRanges(self._s[2501]!, self._r[2501]!, [_1]) } - public var ChatList_DeleteSavedMessagesConfirmationTitle: String { return self._s[2499]! } + public var ChatList_DeleteSavedMessagesConfirmationTitle: String { return self._s[2502]! } public func UserInfo_BlockConfirmationTitle(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2500]!, self._r[2500]!, [_0]) + return formatWithArgumentRanges(self._s[2503]!, self._r[2503]!, [_0]) } - public var Conversation_CloudStorageInfo_Title: String { return self._s[2501]! } - public var Group_Location_Info: String { return self._s[2502]! } - public var PhotoEditor_CropAspectRatioSquare: String { return self._s[2503]! } - public var Permissions_PeopleNearbyAllow_v0: String { return self._s[2504]! } + public var Conversation_CloudStorageInfo_Title: String { return self._s[2504]! } + public var Group_Location_Info: String { return self._s[2505]! } + public var PhotoEditor_CropAspectRatioSquare: String { return self._s[2506]! } + public var Permissions_PeopleNearbyAllow_v0: String { return self._s[2507]! } public func Notification_Exceptions_MutedUntil(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2505]!, self._r[2505]!, [_0]) + return formatWithArgumentRanges(self._s[2508]!, self._r[2508]!, [_0]) } - public var Conversation_ClearPrivateHistory: String { return self._s[2506]! } - public var ContactInfo_PhoneLabelHome: String { return self._s[2507]! } - public var Appearance_RemoveThemeConfirmation: String { return self._s[2508]! } - public var PrivacySettings_LastSeenContacts: String { return self._s[2509]! } + public var Conversation_ClearPrivateHistory: String { return self._s[2509]! } + public var ContactInfo_PhoneLabelHome: String { return self._s[2510]! } + public var Appearance_RemoveThemeConfirmation: String { return self._s[2511]! } + public var PrivacySettings_LastSeenContacts: String { return self._s[2512]! } public func ChangePhone_ErrorOccupied(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2510]!, self._r[2510]!, [_0]) + return formatWithArgumentRanges(self._s[2513]!, self._r[2513]!, [_0]) } - public var Passport_Language_cs: String { return self._s[2511]! } - public var Message_PinnedAnimationMessage: String { return self._s[2513]! } - public var Passport_Identity_ReverseSideHelp: String { return self._s[2515]! } - public var SettingsSearch_Synonyms_Data_Storage_Title: String { return self._s[2516]! } - public var Wallet_Info_TransactionTo: String { return self._s[2518]! } - public var ChatList_DeleteForEveryoneConfirmationText: String { return self._s[2519]! } - public var SettingsSearch_Synonyms_Privacy_PasscodeAndTouchId: String { return self._s[2520]! } - public var Embed_PlayingInPIP: String { return self._s[2521]! } - public var AutoNightTheme_ScheduleSection: String { return self._s[2522]! } + public var Passport_Language_cs: String { return self._s[2514]! } + public var Message_PinnedAnimationMessage: String { return self._s[2516]! } + public var Passport_Identity_ReverseSideHelp: String { return self._s[2518]! } + public var SettingsSearch_Synonyms_Data_Storage_Title: String { return self._s[2519]! } + public var Wallet_Info_TransactionTo: String { return self._s[2521]! } + public var ChatList_DeleteForEveryoneConfirmationText: String { return self._s[2522]! } + public var SettingsSearch_Synonyms_Privacy_PasscodeAndTouchId: String { return self._s[2523]! } + public var Embed_PlayingInPIP: String { return self._s[2524]! } + public var AutoNightTheme_ScheduleSection: String { return self._s[2525]! } public func Call_EmojiDescription(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2523]!, self._r[2523]!, [_0]) + return formatWithArgumentRanges(self._s[2526]!, self._r[2526]!, [_0]) } - public var MediaPicker_LivePhotoDescription: String { return self._s[2524]! } + public var MediaPicker_LivePhotoDescription: String { return self._s[2527]! } public func Channel_AdminLog_MessageRestrictedName(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2525]!, self._r[2525]!, [_1]) + return formatWithArgumentRanges(self._s[2528]!, self._r[2528]!, [_1]) } - public var Notification_PaymentSent: String { return self._s[2526]! } - public var PhotoEditor_CurvesGreen: String { return self._s[2527]! } - public var Notification_Exceptions_PreviewAlwaysOff: String { return self._s[2528]! } - public var AutoNightTheme_System: String { return self._s[2529]! } - public var SaveIncomingPhotosSettings_Title: String { return self._s[2530]! } - public var NotificationSettings_ShowNotificationsAllAccounts: String { return self._s[2531]! } - public var VoiceOver_Chat_PagePreview: String { return self._s[2532]! } + public var Notification_PaymentSent: String { return self._s[2529]! } + public var PhotoEditor_CurvesGreen: String { return self._s[2530]! } + public var Notification_Exceptions_PreviewAlwaysOff: String { return self._s[2531]! } + public var AutoNightTheme_System: String { return self._s[2532]! } + public var SaveIncomingPhotosSettings_Title: String { return self._s[2533]! } + public var NotificationSettings_ShowNotificationsAllAccounts: String { return self._s[2534]! } + public var VoiceOver_Chat_PagePreview: String { return self._s[2535]! } public func PUSH_MESSAGE_SCREENSHOT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2535]!, self._r[2535]!, [_1]) + return formatWithArgumentRanges(self._s[2538]!, self._r[2538]!, [_1]) } public func PUSH_MESSAGE_PHOTO_SECRET(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2536]!, self._r[2536]!, [_1]) + return formatWithArgumentRanges(self._s[2539]!, self._r[2539]!, [_1]) } public func ApplyLanguage_UnsufficientDataText(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2537]!, self._r[2537]!, [_1]) + return formatWithArgumentRanges(self._s[2540]!, self._r[2540]!, [_1]) } - public var NetworkUsageSettings_CallDataSection: String { return self._s[2539]! } - public var PasscodeSettings_HelpTop: String { return self._s[2540]! } - public var Conversation_WalletRequiredTitle: String { return self._s[2541]! } - public var Group_OwnershipTransfer_ErrorAdminsTooMuch: String { return self._s[2542]! } - public var Passport_Address_TypeRentalAgreement: String { return self._s[2543]! } - public var EditTheme_ShortLink: String { return self._s[2544]! } - public var Theme_Colors_ColorWallpaperWarning: String { return self._s[2545]! } - public var ProxyServer_VoiceOver_Active: String { return self._s[2546]! } - public var ReportPeer_ReasonOther_Placeholder: String { return self._s[2547]! } - public var CheckoutInfo_ErrorPhoneInvalid: String { return self._s[2548]! } - public var Call_Accept: String { return self._s[2550]! } - public var GroupRemoved_RemoveInfo: String { return self._s[2551]! } - public var Month_GenMarch: String { return self._s[2553]! } - public var PhotoEditor_ShadowsTool: String { return self._s[2554]! } - public var LoginPassword_Title: String { return self._s[2555]! } - public var Call_End: String { return self._s[2556]! } - public var Watch_Conversation_GroupInfo: String { return self._s[2557]! } - public var VoiceOver_Chat_Contact: String { return self._s[2558]! } - public var EditTheme_Create_Preview_IncomingText: String { return self._s[2559]! } - public var CallSettings_Always: String { return self._s[2560]! } - public var CallFeedback_Success: String { return self._s[2561]! } - public var TwoStepAuth_SetupHint: String { return self._s[2562]! } + public var NetworkUsageSettings_CallDataSection: String { return self._s[2542]! } + public var PasscodeSettings_HelpTop: String { return self._s[2543]! } + public var Conversation_WalletRequiredTitle: String { return self._s[2544]! } + public var Group_OwnershipTransfer_ErrorAdminsTooMuch: String { return self._s[2545]! } + public var Passport_Address_TypeRentalAgreement: String { return self._s[2546]! } + public var EditTheme_ShortLink: String { return self._s[2547]! } + public var Theme_Colors_ColorWallpaperWarning: String { return self._s[2548]! } + public var ProxyServer_VoiceOver_Active: String { return self._s[2549]! } + public var ReportPeer_ReasonOther_Placeholder: String { return self._s[2550]! } + public var CheckoutInfo_ErrorPhoneInvalid: String { return self._s[2551]! } + public var Call_Accept: String { return self._s[2553]! } + public var GroupRemoved_RemoveInfo: String { return self._s[2554]! } + public var Month_GenMarch: String { return self._s[2556]! } + public var PhotoEditor_ShadowsTool: String { return self._s[2557]! } + public var LoginPassword_Title: String { return self._s[2558]! } + public var Call_End: String { return self._s[2559]! } + public var Watch_Conversation_GroupInfo: String { return self._s[2560]! } + public var VoiceOver_Chat_Contact: String { return self._s[2561]! } + public var EditTheme_Create_Preview_IncomingText: String { return self._s[2562]! } + public var CallSettings_Always: String { return self._s[2563]! } + public var CallFeedback_Success: String { return self._s[2564]! } + public var TwoStepAuth_SetupHint: String { return self._s[2565]! } public func AddContact_ContactWillBeSharedAfterMutual(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2563]!, self._r[2563]!, [_1]) + return formatWithArgumentRanges(self._s[2566]!, self._r[2566]!, [_1]) } - public var ConversationProfile_UsersTooMuchError: String { return self._s[2564]! } - public var Login_PhoneTitle: String { return self._s[2565]! } - public var Passport_FieldPhoneHelp: String { return self._s[2566]! } - public var Weekday_ShortSunday: String { return self._s[2567]! } - public var Passport_InfoFAQ_URL: String { return self._s[2568]! } - public var ContactInfo_Job: String { return self._s[2570]! } - public var UserInfo_InviteBotToGroup: String { return self._s[2571]! } - public var Appearance_ThemeCarouselNightBlue: String { return self._s[2572]! } - public var TwoFactorSetup_Email_Text: String { return self._s[2573]! } - public var TwoStepAuth_PasswordRemovePassportConfirmation: String { return self._s[2574]! } - public var Invite_ChannelsTooMuch: String { return self._s[2575]! } - public var Wallet_Send_ConfirmationConfirm: String { return self._s[2576]! } - public var Wallet_TransactionInfo_OtherFeeInfo: String { return self._s[2577]! } - public var SettingsSearch_Synonyms_Notifications_InAppNotificationsPreview: String { return self._s[2578]! } - public var Wallet_Receive_AmountText: String { return self._s[2579]! } - public var Passport_DeletePersonalDetailsConfirmation: String { return self._s[2580]! } - public var CallFeedback_ReasonNoise: String { return self._s[2581]! } - public var Appearance_AppIconDefault: String { return self._s[2583]! } - public var Passport_Identity_AddInternalPassport: String { return self._s[2584]! } - public var MediaPicker_AddCaption: String { return self._s[2585]! } - public var CallSettings_TabIconDescription: String { return self._s[2586]! } + public var ConversationProfile_UsersTooMuchError: String { return self._s[2567]! } + public var Login_PhoneTitle: String { return self._s[2568]! } + public var Passport_FieldPhoneHelp: String { return self._s[2569]! } + public var Weekday_ShortSunday: String { return self._s[2570]! } + public var Passport_InfoFAQ_URL: String { return self._s[2571]! } + public var ContactInfo_Job: String { return self._s[2573]! } + public var UserInfo_InviteBotToGroup: String { return self._s[2574]! } + public var Appearance_ThemeCarouselNightBlue: String { return self._s[2575]! } + public var TwoFactorSetup_Email_Text: String { return self._s[2576]! } + public var TwoStepAuth_PasswordRemovePassportConfirmation: String { return self._s[2577]! } + public var Invite_ChannelsTooMuch: String { return self._s[2578]! } + public var Wallet_Send_ConfirmationConfirm: String { return self._s[2579]! } + public var Wallet_TransactionInfo_OtherFeeInfo: String { return self._s[2580]! } + public var SettingsSearch_Synonyms_Notifications_InAppNotificationsPreview: String { return self._s[2581]! } + public var Wallet_Receive_AmountText: String { return self._s[2582]! } + public var Passport_DeletePersonalDetailsConfirmation: String { return self._s[2583]! } + public var CallFeedback_ReasonNoise: String { return self._s[2584]! } + public var Appearance_AppIconDefault: String { return self._s[2586]! } + public var Passport_Identity_AddInternalPassport: String { return self._s[2587]! } + public var MediaPicker_AddCaption: String { return self._s[2588]! } + public var CallSettings_TabIconDescription: String { return self._s[2589]! } public func VoiceOver_Chat_Caption(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2587]!, self._r[2587]!, [_0]) + return formatWithArgumentRanges(self._s[2590]!, self._r[2590]!, [_0]) } - public var ChatList_UndoArchiveHiddenTitle: String { return self._s[2588]! } - public var Privacy_GroupsAndChannels_AlwaysAllow: String { return self._s[2589]! } - public var Passport_Identity_TypePersonalDetails: String { return self._s[2590]! } - public var DialogList_SearchSectionRecent: String { return self._s[2591]! } - public var PrivacyPolicy_DeclineMessage: String { return self._s[2592]! } - public var LogoutOptions_ClearCacheText: String { return self._s[2595]! } - public var LastSeen_WithinAWeek: String { return self._s[2596]! } - public var ChannelMembers_GroupAdminsTitle: String { return self._s[2597]! } - public var Conversation_CloudStorage_ChatStatus: String { return self._s[2599]! } - public var VoiceOver_Media_PlaybackRateNormal: String { return self._s[2600]! } + public var ChatList_UndoArchiveHiddenTitle: String { return self._s[2591]! } + public var Privacy_GroupsAndChannels_AlwaysAllow: String { return self._s[2592]! } + public var Passport_Identity_TypePersonalDetails: String { return self._s[2593]! } + public var DialogList_SearchSectionRecent: String { return self._s[2594]! } + public var PrivacyPolicy_DeclineMessage: String { return self._s[2595]! } + public var LogoutOptions_ClearCacheText: String { return self._s[2598]! } + public var LastSeen_WithinAWeek: String { return self._s[2599]! } + public var ChannelMembers_GroupAdminsTitle: String { return self._s[2600]! } + public var Conversation_CloudStorage_ChatStatus: String { return self._s[2602]! } + public var VoiceOver_Media_PlaybackRateNormal: String { return self._s[2603]! } public func AddContact_SharedContactExceptionInfo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2601]!, self._r[2601]!, [_0]) + return formatWithArgumentRanges(self._s[2604]!, self._r[2604]!, [_0]) } - public var Passport_Address_TypeResidentialAddress: String { return self._s[2602]! } - public var Conversation_StatusLeftGroup: String { return self._s[2603]! } - public var SocksProxySetup_ProxyDetailsTitle: String { return self._s[2604]! } - public var SettingsSearch_Synonyms_Calls_Title: String { return self._s[2606]! } - public var GroupPermission_AddSuccess: String { return self._s[2607]! } - public var PhotoEditor_BlurToolRadial: String { return self._s[2609]! } - public var Conversation_ContextMenuCopy: String { return self._s[2610]! } - public var AccessDenied_CallMicrophone: String { return self._s[2611]! } + public var Passport_Address_TypeResidentialAddress: String { return self._s[2605]! } + public var Conversation_StatusLeftGroup: String { return self._s[2606]! } + public var SocksProxySetup_ProxyDetailsTitle: String { return self._s[2607]! } + public var SettingsSearch_Synonyms_Calls_Title: String { return self._s[2609]! } + public var GroupPermission_AddSuccess: String { return self._s[2610]! } + public var PhotoEditor_BlurToolRadial: String { return self._s[2612]! } + public var Conversation_ContextMenuCopy: String { return self._s[2613]! } + public var AccessDenied_CallMicrophone: String { return self._s[2614]! } public func Time_PreciseDate_m2(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2612]!, self._r[2612]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2615]!, self._r[2615]!, [_1, _2, _3]) } - public var Login_InvalidFirstNameError: String { return self._s[2613]! } - public var Notifications_Badge_CountUnreadMessages_InfoOn: String { return self._s[2614]! } - public var Checkout_PaymentMethod_New: String { return self._s[2615]! } - public var ShareMenu_CopyShareLinkGame: String { return self._s[2616]! } - public var PhotoEditor_QualityTool: String { return self._s[2617]! } - public var Login_SendCodeViaSms: String { return self._s[2618]! } - public var SettingsSearch_Synonyms_Privacy_DeleteAccountIfAwayFor: String { return self._s[2619]! } - public var Chat_SlowmodeAttachmentLimitReached: String { return self._s[2620]! } - public var Wallet_Receive_CopyAddress: String { return self._s[2621]! } - public var Login_EmailNotConfiguredError: String { return self._s[2622]! } - public var SocksProxySetup_Status: String { return self._s[2623]! } - public var Conversation_ScheduleMessage_SendWhenOnline: String { return self._s[2624]! } - public var PrivacyPolicy_Accept: String { return self._s[2625]! } - public var Notifications_ExceptionsMessagePlaceholder: String { return self._s[2626]! } - public var Appearance_AppIconClassicX: String { return self._s[2627]! } + public var Login_InvalidFirstNameError: String { return self._s[2616]! } + public var Notifications_Badge_CountUnreadMessages_InfoOn: String { return self._s[2617]! } + public var Checkout_PaymentMethod_New: String { return self._s[2618]! } + public var ShareMenu_CopyShareLinkGame: String { return self._s[2619]! } + public var PhotoEditor_QualityTool: String { return self._s[2620]! } + public var Login_SendCodeViaSms: String { return self._s[2621]! } + public var SettingsSearch_Synonyms_Privacy_DeleteAccountIfAwayFor: String { return self._s[2622]! } + public var Chat_SlowmodeAttachmentLimitReached: String { return self._s[2623]! } + public var Wallet_Receive_CopyAddress: String { return self._s[2624]! } + public var Login_EmailNotConfiguredError: String { return self._s[2625]! } + public var SocksProxySetup_Status: String { return self._s[2626]! } + public var Conversation_ScheduleMessage_SendWhenOnline: String { return self._s[2627]! } + public var PrivacyPolicy_Accept: String { return self._s[2628]! } + public var Notifications_ExceptionsMessagePlaceholder: String { return self._s[2629]! } + public var Appearance_AppIconClassicX: String { return self._s[2630]! } public func PUSH_CHAT_MESSAGE_TEXT(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2628]!, self._r[2628]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2631]!, self._r[2631]!, [_1, _2, _3]) } - public var OwnershipTransfer_SecurityRequirements: String { return self._s[2629]! } - public var InfoPlist_NSLocationAlwaysUsageDescription: String { return self._s[2631]! } - public var AutoNightTheme_Automatic: String { return self._s[2632]! } - public var Channel_Username_InvalidStartsWithNumber: String { return self._s[2633]! } - public var Privacy_ContactsSyncHelp: String { return self._s[2634]! } - public var Cache_Help: String { return self._s[2635]! } - public var Group_ErrorAccessDenied: String { return self._s[2636]! } - public var Passport_Language_fa: String { return self._s[2637]! } - public var Wallet_Intro_Text: String { return self._s[2638]! } - public var Login_ResetAccountProtected_TimerTitle: String { return self._s[2639]! } - public var VoiceOver_Chat_YourVideoMessage: String { return self._s[2640]! } - public var PrivacySettings_LastSeen: String { return self._s[2641]! } + public var OwnershipTransfer_SecurityRequirements: String { return self._s[2632]! } + public var InfoPlist_NSLocationAlwaysUsageDescription: String { return self._s[2634]! } + public var AutoNightTheme_Automatic: String { return self._s[2635]! } + public var Channel_Username_InvalidStartsWithNumber: String { return self._s[2636]! } + public var Privacy_ContactsSyncHelp: String { return self._s[2637]! } + public var Cache_Help: String { return self._s[2638]! } + public var Group_ErrorAccessDenied: String { return self._s[2639]! } + public var Passport_Language_fa: String { return self._s[2640]! } + public var Wallet_Intro_Text: String { return self._s[2641]! } + public var Login_ResetAccountProtected_TimerTitle: String { return self._s[2642]! } + public var VoiceOver_Chat_YourVideoMessage: String { return self._s[2643]! } + public var PrivacySettings_LastSeen: String { return self._s[2644]! } public func DialogList_MultipleTyping(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2642]!, self._r[2642]!, [_0, _1]) + return formatWithArgumentRanges(self._s[2645]!, self._r[2645]!, [_0, _1]) } - public var Wallet_Configuration_Apply: String { return self._s[2646]! } - public var Preview_SaveGif: String { return self._s[2647]! } - public var SettingsSearch_Synonyms_Privacy_TwoStepAuth: String { return self._s[2648]! } - public var Profile_About: String { return self._s[2649]! } - public var Channel_About_Placeholder: String { return self._s[2650]! } - public var Login_InfoTitle: String { return self._s[2651]! } + public var Wallet_Configuration_Apply: String { return self._s[2649]! } + public var Preview_SaveGif: String { return self._s[2650]! } + public var SettingsSearch_Synonyms_Privacy_TwoStepAuth: String { return self._s[2651]! } + public var Profile_About: String { return self._s[2652]! } + public var Channel_About_Placeholder: String { return self._s[2653]! } + public var Login_InfoTitle: String { return self._s[2654]! } public func TwoStepAuth_SetupPendingEmail(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2652]!, self._r[2652]!, [_0]) + return formatWithArgumentRanges(self._s[2655]!, self._r[2655]!, [_0]) } - public var EditTheme_Expand_Preview_IncomingReplyText: String { return self._s[2653]! } - public var Watch_Suggestion_CantTalk: String { return self._s[2655]! } - public var ContactInfo_Title: String { return self._s[2656]! } - public var Media_ShareThisVideo: String { return self._s[2657]! } - public var Weekday_ShortFriday: String { return self._s[2658]! } - public var AccessDenied_Contacts: String { return self._s[2660]! } - public var Notification_CallIncomingShort: String { return self._s[2661]! } - public var Group_Setup_TypePublic: String { return self._s[2662]! } - public var Notifications_MessageNotificationsExceptions: String { return self._s[2663]! } - public var Notifications_Badge_IncludeChannels: String { return self._s[2664]! } - public var Notifications_MessageNotificationsPreview: String { return self._s[2667]! } - public var ConversationProfile_ErrorCreatingConversation: String { return self._s[2668]! } - public var Group_ErrorAddTooMuchBots: String { return self._s[2669]! } - public var Privacy_GroupsAndChannels_CustomShareHelp: String { return self._s[2670]! } - public var Permissions_CellularDataAllowInSettings_v0: String { return self._s[2671]! } + public var EditTheme_Expand_Preview_IncomingReplyText: String { return self._s[2656]! } + public var Watch_Suggestion_CantTalk: String { return self._s[2658]! } + public var ContactInfo_Title: String { return self._s[2659]! } + public var Media_ShareThisVideo: String { return self._s[2660]! } + public var Weekday_ShortFriday: String { return self._s[2661]! } + public var AccessDenied_Contacts: String { return self._s[2663]! } + public var Notification_CallIncomingShort: String { return self._s[2664]! } + public var Group_Setup_TypePublic: String { return self._s[2665]! } + public var Notifications_MessageNotificationsExceptions: String { return self._s[2666]! } + public var Notifications_Badge_IncludeChannels: String { return self._s[2667]! } + public var Notifications_MessageNotificationsPreview: String { return self._s[2670]! } + public var ConversationProfile_ErrorCreatingConversation: String { return self._s[2671]! } + public var Group_ErrorAddTooMuchBots: String { return self._s[2672]! } + public var Privacy_GroupsAndChannels_CustomShareHelp: String { return self._s[2673]! } + public var Permissions_CellularDataAllowInSettings_v0: String { return self._s[2674]! } public func Wallet_SecureStorageChanged_BiometryText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2672]!, self._r[2672]!, [_0]) + return formatWithArgumentRanges(self._s[2675]!, self._r[2675]!, [_0]) } - public var DialogList_Typing: String { return self._s[2673]! } - public var CallFeedback_IncludeLogs: String { return self._s[2675]! } - public var Checkout_Phone: String { return self._s[2677]! } - public var Login_InfoFirstNamePlaceholder: String { return self._s[2680]! } - public var Privacy_Calls_Integration: String { return self._s[2681]! } - public var Notifications_PermissionsAllow: String { return self._s[2682]! } - public var TwoStepAuth_AddHintDescription: String { return self._s[2686]! } - public var Settings_ChatSettings: String { return self._s[2687]! } + public var DialogList_Typing: String { return self._s[2676]! } + public var CallFeedback_IncludeLogs: String { return self._s[2678]! } + public var Checkout_Phone: String { return self._s[2680]! } + public var Login_InfoFirstNamePlaceholder: String { return self._s[2683]! } + public var Privacy_Calls_Integration: String { return self._s[2684]! } + public var Notifications_PermissionsAllow: String { return self._s[2685]! } + public var TwoStepAuth_AddHintDescription: String { return self._s[2689]! } + public var Settings_ChatSettings: String { return self._s[2690]! } public func UserInfo_StartSecretChatConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2688]!, self._r[2688]!, [_0]) + return formatWithArgumentRanges(self._s[2691]!, self._r[2691]!, [_0]) } public func Channel_AdminLog_MessageInvitedNameUsername(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2689]!, self._r[2689]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2692]!, self._r[2692]!, [_1, _2]) } - public var GroupRemoved_DeleteUser: String { return self._s[2691]! } + public var GroupRemoved_DeleteUser: String { return self._s[2694]! } public func Channel_AdminLog_PollStopped(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2692]!, self._r[2692]!, [_0]) + return formatWithArgumentRanges(self._s[2695]!, self._r[2695]!, [_0]) } public func PUSH_MESSAGE_PHOTO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2693]!, self._r[2693]!, [_1]) + return formatWithArgumentRanges(self._s[2696]!, self._r[2696]!, [_1]) } - public var Login_ContinueWithLocalization: String { return self._s[2694]! } - public var Watch_Message_ForwardedFrom: String { return self._s[2695]! } - public var TwoStepAuth_EnterEmailCode: String { return self._s[2697]! } - public var Conversation_Unblock: String { return self._s[2698]! } - public var PrivacySettings_DataSettings: String { return self._s[2699]! } - public var Group_PublicLink_Info: String { return self._s[2700]! } + public var Login_ContinueWithLocalization: String { return self._s[2697]! } + public var Watch_Message_ForwardedFrom: String { return self._s[2698]! } + public var TwoStepAuth_EnterEmailCode: String { return self._s[2700]! } + public var Conversation_Unblock: String { return self._s[2701]! } + public var PrivacySettings_DataSettings: String { return self._s[2702]! } + public var Group_PublicLink_Info: String { return self._s[2703]! } public func Wallet_Time_PreciseDate_m1(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2701]!, self._r[2701]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2704]!, self._r[2704]!, [_1, _2, _3]) } - public var Notifications_InAppNotificationsVibrate: String { return self._s[2702]! } + public var Notifications_InAppNotificationsVibrate: String { return self._s[2705]! } public func Privacy_GroupsAndChannels_InviteToChannelError(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2703]!, self._r[2703]!, [_0, _1]) + return formatWithArgumentRanges(self._s[2706]!, self._r[2706]!, [_0, _1]) } - public var Wallet_RestoreFailed_CreateWallet: String { return self._s[2705]! } - public var PrivacySettings_Passcode: String { return self._s[2707]! } - public var Call_Mute: String { return self._s[2708]! } - public var Wallet_Weekday_Yesterday: String { return self._s[2709]! } - public var Passport_Language_dz: String { return self._s[2710]! } - public var Wallet_Receive_AmountHeader: String { return self._s[2711]! } - public var Wallet_TransactionInfo_OtherFeeInfoUrl: String { return self._s[2712]! } - public var Passport_Language_tk: String { return self._s[2713]! } + public var Wallet_RestoreFailed_CreateWallet: String { return self._s[2708]! } + public var PrivacySettings_Passcode: String { return self._s[2710]! } + public var Call_Mute: String { return self._s[2711]! } + public var Wallet_Weekday_Yesterday: String { return self._s[2712]! } + public var Passport_Language_dz: String { return self._s[2713]! } + public var Wallet_Receive_AmountHeader: String { return self._s[2714]! } + public var Wallet_TransactionInfo_OtherFeeInfoUrl: String { return self._s[2715]! } + public var Passport_Language_tk: String { return self._s[2716]! } public func Login_EmailCodeSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2714]!, self._r[2714]!, [_0]) + return formatWithArgumentRanges(self._s[2717]!, self._r[2717]!, [_0]) } - public var Settings_Search: String { return self._s[2715]! } - public var Wallet_Month_ShortFebruary: String { return self._s[2716]! } - public var InfoPlist_NSPhotoLibraryUsageDescription: String { return self._s[2717]! } - public var Wallet_Configuration_SourceJSON: String { return self._s[2718]! } - public var Conversation_ContextMenuReply: String { return self._s[2719]! } - public var WallpaperSearch_ColorBrown: String { return self._s[2720]! } - public var Chat_AttachmentMultipleForwardDisabled: String { return self._s[2721]! } - public var Tour_Title1: String { return self._s[2722]! } - public var Wallet_Alert_Cancel: String { return self._s[2723]! } - public var Conversation_ClearGroupHistory: String { return self._s[2725]! } - public var Wallet_TransactionInfo_RecipientHeader: String { return self._s[2726]! } - public var WallpaperPreview_Motion: String { return self._s[2727]! } + public var Settings_Search: String { return self._s[2718]! } + public var Wallet_Month_ShortFebruary: String { return self._s[2719]! } + public var InfoPlist_NSPhotoLibraryUsageDescription: String { return self._s[2720]! } + public var Wallet_Configuration_SourceJSON: String { return self._s[2721]! } + public var Conversation_ContextMenuReply: String { return self._s[2722]! } + public var WallpaperSearch_ColorBrown: String { return self._s[2723]! } + public var Chat_AttachmentMultipleForwardDisabled: String { return self._s[2724]! } + public var Tour_Title1: String { return self._s[2725]! } + public var Wallet_Alert_Cancel: String { return self._s[2726]! } + public var Conversation_ClearGroupHistory: String { return self._s[2728]! } + public var Wallet_TransactionInfo_RecipientHeader: String { return self._s[2729]! } + public var WallpaperPreview_Motion: String { return self._s[2730]! } public func Checkout_PasswordEntry_Text(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2728]!, self._r[2728]!, [_0]) + return formatWithArgumentRanges(self._s[2731]!, self._r[2731]!, [_0]) } - public var Wallet_Configuration_ApplyErrorTextJSONInvalidData: String { return self._s[2729]! } - public var Call_RateCall: String { return self._s[2730]! } - public var Channel_AdminLog_BanSendStickersAndGifs: String { return self._s[2731]! } - public var Passport_PasswordCompleteSetup: String { return self._s[2732]! } - public var Conversation_InputTextSilentBroadcastPlaceholder: String { return self._s[2733]! } - public var UserInfo_LastNamePlaceholder: String { return self._s[2735]! } + public var Wallet_Configuration_ApplyErrorTextJSONInvalidData: String { return self._s[2732]! } + public var Call_RateCall: String { return self._s[2733]! } + public var Channel_AdminLog_BanSendStickersAndGifs: String { return self._s[2734]! } + public var Passport_PasswordCompleteSetup: String { return self._s[2735]! } + public var Conversation_InputTextSilentBroadcastPlaceholder: String { return self._s[2736]! } + public var UserInfo_LastNamePlaceholder: String { return self._s[2738]! } public func Login_WillCallYou(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2737]!, self._r[2737]!, [_0]) + return formatWithArgumentRanges(self._s[2740]!, self._r[2740]!, [_0]) } - public var Compose_Create: String { return self._s[2738]! } - public var Contacts_InviteToTelegram: String { return self._s[2739]! } - public var GroupInfo_Notifications: String { return self._s[2740]! } - public var ChatList_DeleteSavedMessagesConfirmationAction: String { return self._s[2742]! } - public var Message_PinnedLiveLocationMessage: String { return self._s[2743]! } - public var Month_GenApril: String { return self._s[2744]! } - public var Appearance_AutoNightTheme: String { return self._s[2745]! } - public var ChatSettings_AutomaticAudioDownload: String { return self._s[2747]! } - public var Login_CodeSentSms: String { return self._s[2749]! } + public var Compose_Create: String { return self._s[2741]! } + public var Contacts_InviteToTelegram: String { return self._s[2742]! } + public var GroupInfo_Notifications: String { return self._s[2743]! } + public var ChatList_DeleteSavedMessagesConfirmationAction: String { return self._s[2745]! } + public var Message_PinnedLiveLocationMessage: String { return self._s[2746]! } + public var Month_GenApril: String { return self._s[2747]! } + public var Appearance_AutoNightTheme: String { return self._s[2748]! } + public var ChatSettings_AutomaticAudioDownload: String { return self._s[2750]! } + public var Login_CodeSentSms: String { return self._s[2752]! } public func UserInfo_UnblockConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2750]!, self._r[2750]!, [_0]) + return formatWithArgumentRanges(self._s[2753]!, self._r[2753]!, [_0]) } - public var EmptyGroupInfo_Line3: String { return self._s[2751]! } - public var LogoutOptions_ContactSupportText: String { return self._s[2752]! } - public var Passport_Language_hr: String { return self._s[2753]! } - public var Common_ActionNotAllowedError: String { return self._s[2754]! } + public var EmptyGroupInfo_Line3: String { return self._s[2754]! } + public var LogoutOptions_ContactSupportText: String { return self._s[2755]! } + public var Passport_Language_hr: String { return self._s[2756]! } + public var Common_ActionNotAllowedError: String { return self._s[2757]! } public func Channel_AdminLog_MessageRestrictedNewSetting(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2755]!, self._r[2755]!, [_0]) + return formatWithArgumentRanges(self._s[2758]!, self._r[2758]!, [_0]) } - public var GroupInfo_InviteLink_CopyLink: String { return self._s[2756]! } - public var Wallet_Info_TransactionFrom: String { return self._s[2757]! } - public var Wallet_Send_ErrorDecryptionFailed: String { return self._s[2758]! } - public var Conversation_InputTextBroadcastPlaceholder: String { return self._s[2759]! } - public var Privacy_SecretChatsTitle: String { return self._s[2760]! } - public var Notification_SecretChatMessageScreenshotSelf: String { return self._s[2762]! } - public var GroupInfo_AddUserLeftError: String { return self._s[2763]! } - public var AutoDownloadSettings_TypePrivateChats: String { return self._s[2764]! } - public var LogoutOptions_ContactSupportTitle: String { return self._s[2765]! } - public var Channel_AddBotErrorHaveRights: String { return self._s[2766]! } - public var Preview_DeleteGif: String { return self._s[2767]! } - public var GroupInfo_Permissions_Exceptions: String { return self._s[2768]! } - public var Group_ErrorNotMutualContact: String { return self._s[2769]! } - public var Notification_MessageLifetime5s: String { return self._s[2770]! } - public var Wallet_Send_OwnAddressAlertText: String { return self._s[2771]! } + public var GroupInfo_InviteLink_CopyLink: String { return self._s[2759]! } + public var Wallet_Info_TransactionFrom: String { return self._s[2760]! } + public var Wallet_Send_ErrorDecryptionFailed: String { return self._s[2761]! } + public var Conversation_InputTextBroadcastPlaceholder: String { return self._s[2762]! } + public var Privacy_SecretChatsTitle: String { return self._s[2763]! } + public var Notification_SecretChatMessageScreenshotSelf: String { return self._s[2765]! } + public var GroupInfo_AddUserLeftError: String { return self._s[2766]! } + public var AutoDownloadSettings_TypePrivateChats: String { return self._s[2767]! } + public var LogoutOptions_ContactSupportTitle: String { return self._s[2768]! } + public var Channel_AddBotErrorHaveRights: String { return self._s[2769]! } + public var Preview_DeleteGif: String { return self._s[2770]! } + public var GroupInfo_Permissions_Exceptions: String { return self._s[2771]! } + public var Group_ErrorNotMutualContact: String { return self._s[2772]! } + public var Notification_MessageLifetime5s: String { return self._s[2773]! } + public var Wallet_Send_OwnAddressAlertText: String { return self._s[2774]! } public func Watch_LastSeen_AtDate(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2772]!, self._r[2772]!, [_0]) + return formatWithArgumentRanges(self._s[2775]!, self._r[2775]!, [_0]) } - public var VoiceOver_Chat_Video: String { return self._s[2773]! } - public var Channel_OwnershipTransfer_ErrorPublicChannelsTooMuch: String { return self._s[2775]! } - public var ReportSpam_DeleteThisChat: String { return self._s[2776]! } - public var Passport_Address_AddBankStatement: String { return self._s[2777]! } - public var Notification_CallIncoming: String { return self._s[2778]! } - public var Wallet_Words_NotDoneTitle: String { return self._s[2779]! } - public var Compose_NewGroupTitle: String { return self._s[2780]! } - public var TwoStepAuth_RecoveryCodeHelp: String { return self._s[2782]! } - public var Passport_Address_Postcode: String { return self._s[2784]! } + public var VoiceOver_Chat_Video: String { return self._s[2776]! } + public var Channel_OwnershipTransfer_ErrorPublicChannelsTooMuch: String { return self._s[2778]! } + public var ReportSpam_DeleteThisChat: String { return self._s[2779]! } + public var Passport_Address_AddBankStatement: String { return self._s[2780]! } + public var Notification_CallIncoming: String { return self._s[2781]! } + public var Wallet_Words_NotDoneTitle: String { return self._s[2782]! } + public var Compose_NewGroupTitle: String { return self._s[2783]! } + public var TwoStepAuth_RecoveryCodeHelp: String { return self._s[2785]! } + public var Passport_Address_Postcode: String { return self._s[2787]! } public func LastSeen_YesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2785]!, self._r[2785]!, [_0]) + return formatWithArgumentRanges(self._s[2788]!, self._r[2788]!, [_0]) } - public var Checkout_NewCard_SaveInfoHelp: String { return self._s[2786]! } - public var Wallet_Month_ShortOctober: String { return self._s[2787]! } - public var VoiceOver_Chat_YourMusic: String { return self._s[2788]! } - public var WallpaperColors_Title: String { return self._s[2789]! } - public var SocksProxySetup_ShareQRCodeInfo: String { return self._s[2790]! } - public var VoiceOver_MessageContextForward: String { return self._s[2791]! } - public var GroupPermission_Duration: String { return self._s[2792]! } + public var Checkout_NewCard_SaveInfoHelp: String { return self._s[2789]! } + public var Wallet_Month_ShortOctober: String { return self._s[2790]! } + public var VoiceOver_Chat_YourMusic: String { return self._s[2791]! } + public var WallpaperColors_Title: String { return self._s[2792]! } + public var SocksProxySetup_ShareQRCodeInfo: String { return self._s[2793]! } + public var VoiceOver_MessageContextForward: String { return self._s[2794]! } + public var GroupPermission_Duration: String { return self._s[2795]! } public func Cache_Clear(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2793]!, self._r[2793]!, [_0]) + return formatWithArgumentRanges(self._s[2796]!, self._r[2796]!, [_0]) } - public var Bot_GroupStatusDoesNotReadHistory: String { return self._s[2794]! } - public var Username_Placeholder: String { return self._s[2795]! } - public var CallFeedback_WhatWentWrong: String { return self._s[2796]! } - public var Passport_FieldAddressUploadHelp: String { return self._s[2797]! } - public var Permissions_NotificationsAllowInSettings_v0: String { return self._s[2798]! } + public var Bot_GroupStatusDoesNotReadHistory: String { return self._s[2797]! } + public var Username_Placeholder: String { return self._s[2798]! } + public var CallFeedback_WhatWentWrong: String { return self._s[2799]! } + public var Passport_FieldAddressUploadHelp: String { return self._s[2800]! } + public var Permissions_NotificationsAllowInSettings_v0: String { return self._s[2801]! } public func Channel_AdminLog_MessageChangedUnlinkedChannel(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2800]!, self._r[2800]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2803]!, self._r[2803]!, [_1, _2]) } - public var Passport_PasswordDescription: String { return self._s[2801]! } - public var Channel_MessagePhotoUpdated: String { return self._s[2802]! } - public var MediaPicker_TapToUngroupDescription: String { return self._s[2803]! } - public var SettingsSearch_Synonyms_Notifications_BadgeCountUnreadMessages: String { return self._s[2804]! } - public var AttachmentMenu_PhotoOrVideo: String { return self._s[2805]! } - public var Conversation_ContextMenuMore: String { return self._s[2806]! } - public var Privacy_PaymentsClearInfo: String { return self._s[2807]! } - public var CallSettings_TabIcon: String { return self._s[2808]! } - public var KeyCommand_Find: String { return self._s[2809]! } - public var ClearCache_FreeSpaceDescription: String { return self._s[2810]! } - public var Appearance_ThemePreview_ChatList_7_Text: String { return self._s[2811]! } - public var EditTheme_Edit_Preview_IncomingText: String { return self._s[2812]! } - public var Message_PinnedGame: String { return self._s[2813]! } - public var VoiceOver_Chat_ForwardedFromYou: String { return self._s[2814]! } - public var Notifications_Badge_CountUnreadMessages_InfoOff: String { return self._s[2816]! } - public var Login_CallRequestState2: String { return self._s[2818]! } - public var CheckoutInfo_ReceiverInfoNamePlaceholder: String { return self._s[2820]! } + public var Passport_PasswordDescription: String { return self._s[2804]! } + public var Channel_MessagePhotoUpdated: String { return self._s[2805]! } + public var MediaPicker_TapToUngroupDescription: String { return self._s[2806]! } + public var SettingsSearch_Synonyms_Notifications_BadgeCountUnreadMessages: String { return self._s[2807]! } + public var AttachmentMenu_PhotoOrVideo: String { return self._s[2808]! } + public var Conversation_ContextMenuMore: String { return self._s[2809]! } + public var Privacy_PaymentsClearInfo: String { return self._s[2810]! } + public var CallSettings_TabIcon: String { return self._s[2811]! } + public var KeyCommand_Find: String { return self._s[2812]! } + public var ClearCache_FreeSpaceDescription: String { return self._s[2813]! } + public var Appearance_ThemePreview_ChatList_7_Text: String { return self._s[2814]! } + public var EditTheme_Edit_Preview_IncomingText: String { return self._s[2815]! } + public var Message_PinnedGame: String { return self._s[2816]! } + public var VoiceOver_Chat_ForwardedFromYou: String { return self._s[2817]! } + public var Notifications_Badge_CountUnreadMessages_InfoOff: String { return self._s[2819]! } + public var Login_CallRequestState2: String { return self._s[2821]! } + public var CheckoutInfo_ReceiverInfoNamePlaceholder: String { return self._s[2823]! } public func VoiceOver_Chat_PhotoFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2821]!, self._r[2821]!, [_0]) + return formatWithArgumentRanges(self._s[2824]!, self._r[2824]!, [_0]) } public func Checkout_PayPrice(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2823]!, self._r[2823]!, [_0]) - } - public var WallpaperPreview_Blurred: String { return self._s[2824]! } - public var Conversation_InstantPagePreview: String { return self._s[2825]! } - public func DialogList_SingleUploadingVideoSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[2826]!, self._r[2826]!, [_0]) } - public var SecretTimer_VideoDescription: String { return self._s[2829]! } - public var WallpaperSearch_ColorRed: String { return self._s[2830]! } - public var GroupPermission_NoPinMessages: String { return self._s[2831]! } - public var Passport_Language_es: String { return self._s[2832]! } - public var Permissions_ContactsAllow_v0: String { return self._s[2834]! } - public var Conversation_EditingMessageMediaEditCurrentVideo: String { return self._s[2835]! } + public var WallpaperPreview_Blurred: String { return self._s[2827]! } + public var Conversation_InstantPagePreview: String { return self._s[2828]! } + public func DialogList_SingleUploadingVideoSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[2829]!, self._r[2829]!, [_0]) + } + public var SecretTimer_VideoDescription: String { return self._s[2832]! } + public var WallpaperSearch_ColorRed: String { return self._s[2833]! } + public var GroupPermission_NoPinMessages: String { return self._s[2834]! } + public var Passport_Language_es: String { return self._s[2835]! } + public var Permissions_ContactsAllow_v0: String { return self._s[2837]! } + public var Conversation_EditingMessageMediaEditCurrentVideo: String { return self._s[2838]! } public func PUSH_CHAT_MESSAGE_CONTACT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2836]!, self._r[2836]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2839]!, self._r[2839]!, [_1, _2]) } - public var Privacy_Forwards_CustomHelp: String { return self._s[2837]! } - public var WebPreview_GettingLinkInfo: String { return self._s[2838]! } - public var Watch_UserInfo_Unmute: String { return self._s[2839]! } - public var GroupInfo_ChannelListNamePlaceholder: String { return self._s[2840]! } - public var AccessDenied_CameraRestricted: String { return self._s[2842]! } + public var Privacy_Forwards_CustomHelp: String { return self._s[2840]! } + public var WebPreview_GettingLinkInfo: String { return self._s[2841]! } + public var Watch_UserInfo_Unmute: String { return self._s[2842]! } + public var GroupInfo_ChannelListNamePlaceholder: String { return self._s[2843]! } + public var AccessDenied_CameraRestricted: String { return self._s[2845]! } public func Conversation_Kilobytes(_ _0: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2843]!, self._r[2843]!, ["\(_0)"]) + return formatWithArgumentRanges(self._s[2846]!, self._r[2846]!, ["\(_0)"]) } - public var ChatList_ReadAll: String { return self._s[2845]! } - public var Settings_CopyUsername: String { return self._s[2846]! } - public var Contacts_SearchLabel: String { return self._s[2847]! } - public var Map_OpenInYandexNavigator: String { return self._s[2849]! } - public var PasscodeSettings_EncryptData: String { return self._s[2850]! } - public var Settings_Wallet: String { return self._s[2851]! } - public var Group_ErrorSupergroupConversionNotPossible: String { return self._s[2852]! } - public var WallpaperSearch_ColorPrefix: String { return self._s[2853]! } - public var Notifications_GroupNotificationsPreview: String { return self._s[2854]! } - public var DialogList_AdNoticeAlert: String { return self._s[2855]! } - public var Wallet_Month_GenMay: String { return self._s[2857]! } - public var CheckoutInfo_ShippingInfoAddress1: String { return self._s[2858]! } - public var CheckoutInfo_ShippingInfoAddress2: String { return self._s[2859]! } - public var Localization_LanguageCustom: String { return self._s[2860]! } - public var Passport_Identity_TypeDriversLicenseUploadScan: String { return self._s[2861]! } - public var CallFeedback_Title: String { return self._s[2862]! } - public var VoiceOver_Chat_RecordPreviewVoiceMessage: String { return self._s[2865]! } - public var Passport_Address_OneOfTypePassportRegistration: String { return self._s[2866]! } - public var Wallet_Intro_CreateErrorTitle: String { return self._s[2867]! } - public var Conversation_InfoGroup: String { return self._s[2868]! } - public var Compose_NewMessage: String { return self._s[2869]! } - public var FastTwoStepSetup_HintPlaceholder: String { return self._s[2870]! } - public var ChatSettings_AutoDownloadVideoMessages: String { return self._s[2871]! } - public var Wallet_SecureStorageReset_BiometryFaceId: String { return self._s[2872]! } - public var Channel_DiscussionGroup_UnlinkChannel: String { return self._s[2873]! } + public var ChatList_ReadAll: String { return self._s[2848]! } + public var Settings_CopyUsername: String { return self._s[2849]! } + public var Contacts_SearchLabel: String { return self._s[2850]! } + public var Map_OpenInYandexNavigator: String { return self._s[2852]! } + public var PasscodeSettings_EncryptData: String { return self._s[2853]! } + public var Settings_Wallet: String { return self._s[2854]! } + public var Group_ErrorSupergroupConversionNotPossible: String { return self._s[2855]! } + public var WallpaperSearch_ColorPrefix: String { return self._s[2856]! } + public var Notifications_GroupNotificationsPreview: String { return self._s[2857]! } + public var DialogList_AdNoticeAlert: String { return self._s[2858]! } + public var Wallet_Month_GenMay: String { return self._s[2860]! } + public var CheckoutInfo_ShippingInfoAddress1: String { return self._s[2861]! } + public var CheckoutInfo_ShippingInfoAddress2: String { return self._s[2862]! } + public var Localization_LanguageCustom: String { return self._s[2863]! } + public var Passport_Identity_TypeDriversLicenseUploadScan: String { return self._s[2864]! } + public var CallFeedback_Title: String { return self._s[2865]! } + public var VoiceOver_Chat_RecordPreviewVoiceMessage: String { return self._s[2868]! } + public var Passport_Address_OneOfTypePassportRegistration: String { return self._s[2869]! } + public var Wallet_Intro_CreateErrorTitle: String { return self._s[2870]! } + public var Conversation_InfoGroup: String { return self._s[2871]! } + public var Compose_NewMessage: String { return self._s[2872]! } + public var FastTwoStepSetup_HintPlaceholder: String { return self._s[2873]! } + public var ChatSettings_AutoDownloadVideoMessages: String { return self._s[2874]! } + public var Wallet_SecureStorageReset_BiometryFaceId: String { return self._s[2875]! } + public var Channel_DiscussionGroup_UnlinkChannel: String { return self._s[2876]! } public func Passport_Scans_ScanIndex(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2874]!, self._r[2874]!, [_0]) + return formatWithArgumentRanges(self._s[2877]!, self._r[2877]!, [_0]) } - public var Channel_AdminLog_CanDeleteMessages: String { return self._s[2875]! } - public var Login_CancelSignUpConfirmation: String { return self._s[2876]! } - public var ChangePhoneNumberCode_Help: String { return self._s[2877]! } - public var PrivacySettings_DeleteAccountHelp: String { return self._s[2878]! } - public var Channel_BlackList_Title: String { return self._s[2879]! } - public var UserInfo_PhoneCall: String { return self._s[2880]! } - public var Passport_Address_OneOfTypeBankStatement: String { return self._s[2882]! } - public var Wallet_Month_ShortJanuary: String { return self._s[2883]! } - public var State_connecting: String { return self._s[2884]! } - public var Appearance_ThemePreview_ChatList_6_Text: String { return self._s[2885]! } - public var Wallet_Month_GenMarch: String { return self._s[2886]! } - public var EditTheme_Expand_BottomInfo: String { return self._s[2887]! } + public var Channel_AdminLog_CanDeleteMessages: String { return self._s[2878]! } + public var Login_CancelSignUpConfirmation: String { return self._s[2879]! } + public var ChangePhoneNumberCode_Help: String { return self._s[2880]! } + public var PrivacySettings_DeleteAccountHelp: String { return self._s[2881]! } + public var Channel_BlackList_Title: String { return self._s[2882]! } + public var UserInfo_PhoneCall: String { return self._s[2883]! } + public var Passport_Address_OneOfTypeBankStatement: String { return self._s[2885]! } + public var Wallet_Month_ShortJanuary: String { return self._s[2886]! } + public var State_connecting: String { return self._s[2887]! } + public var Appearance_ThemePreview_ChatList_6_Text: String { return self._s[2888]! } + public var Wallet_Month_GenMarch: String { return self._s[2889]! } + public var EditTheme_Expand_BottomInfo: String { return self._s[2890]! } public func LastSeen_TodayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2888]!, self._r[2888]!, [_0]) + return formatWithArgumentRanges(self._s[2891]!, self._r[2891]!, [_0]) } public func DialogList_SingleRecordingAudioSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2889]!, self._r[2889]!, [_0]) + return formatWithArgumentRanges(self._s[2892]!, self._r[2892]!, [_0]) } - public var Notifications_GroupNotifications: String { return self._s[2890]! } - public var Conversation_SendMessageErrorTooMuchScheduled: String { return self._s[2891]! } - public var Passport_Identity_EditPassport: String { return self._s[2892]! } - public var EnterPasscode_RepeatNewPasscode: String { return self._s[2894]! } - public var Localization_EnglishLanguageName: String { return self._s[2895]! } - public var Share_AuthDescription: String { return self._s[2896]! } - public var SettingsSearch_Synonyms_Notifications_ChannelNotificationsAlert: String { return self._s[2897]! } - public var Passport_Identity_Surname: String { return self._s[2898]! } - public var Compose_TokenListPlaceholder: String { return self._s[2899]! } - public var Wallet_AccessDenied_Camera: String { return self._s[2900]! } - public var Passport_Identity_OneOfTypePassport: String { return self._s[2901]! } - public var Settings_AboutEmpty: String { return self._s[2902]! } - public var Conversation_Unmute: String { return self._s[2903]! } - public var CreateGroup_ChannelsTooMuch: String { return self._s[2905]! } - public var Wallet_Sending_Text: String { return self._s[2906]! } + public var Notifications_GroupNotifications: String { return self._s[2893]! } + public var Conversation_SendMessageErrorTooMuchScheduled: String { return self._s[2894]! } + public var Passport_Identity_EditPassport: String { return self._s[2895]! } + public var EnterPasscode_RepeatNewPasscode: String { return self._s[2897]! } + public var Localization_EnglishLanguageName: String { return self._s[2898]! } + public var Share_AuthDescription: String { return self._s[2899]! } + public var SettingsSearch_Synonyms_Notifications_ChannelNotificationsAlert: String { return self._s[2900]! } + public var Passport_Identity_Surname: String { return self._s[2901]! } + public var Compose_TokenListPlaceholder: String { return self._s[2902]! } + public var Wallet_AccessDenied_Camera: String { return self._s[2903]! } + public var Passport_Identity_OneOfTypePassport: String { return self._s[2904]! } + public var Settings_AboutEmpty: String { return self._s[2905]! } + public var Conversation_Unmute: String { return self._s[2906]! } + public var CreateGroup_ChannelsTooMuch: String { return self._s[2908]! } + public var Wallet_Sending_Text: String { return self._s[2909]! } public func PUSH_CONTACT_JOINED(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2907]!, self._r[2907]!, [_1]) + return formatWithArgumentRanges(self._s[2910]!, self._r[2910]!, [_1]) } - public var Login_CodeSentCall: String { return self._s[2908]! } - public var ContactInfo_PhoneLabelHomeFax: String { return self._s[2910]! } - public var ChatSettings_Appearance: String { return self._s[2911]! } - public var ClearCache_StorageUsage: String { return self._s[2912]! } - public var Appearance_PickAccentColor: String { return self._s[2913]! } + public var Login_CodeSentCall: String { return self._s[2911]! } + public var ContactInfo_PhoneLabelHomeFax: String { return self._s[2913]! } + public var ChatSettings_Appearance: String { return self._s[2914]! } + public var ClearCache_StorageUsage: String { return self._s[2915]! } + public var Appearance_PickAccentColor: String { return self._s[2916]! } public func PUSH_CHAT_MESSAGE_NOTEXT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2914]!, self._r[2914]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2917]!, self._r[2917]!, [_1, _2]) } public func PUSH_MESSAGE_GEO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2915]!, self._r[2915]!, [_1]) + return formatWithArgumentRanges(self._s[2918]!, self._r[2918]!, [_1]) } - public var Notification_CallMissed: String { return self._s[2916]! } - public var SettingsSearch_Synonyms_Appearance_ChatBackground_Custom: String { return self._s[2917]! } - public var Channel_AdminLogFilter_EventsInfo: String { return self._s[2918]! } - public var Wallet_Month_GenOctober: String { return self._s[2920]! } - public var ChatAdmins_AdminLabel: String { return self._s[2921]! } - public var KeyCommand_JumpToNextChat: String { return self._s[2922]! } - public var Conversation_StopPollConfirmationTitle: String { return self._s[2924]! } - public var ChangePhoneNumberCode_CodePlaceholder: String { return self._s[2925]! } - public var Month_GenJune: String { return self._s[2926]! } - public var Watch_Location_Current: String { return self._s[2927]! } - public var Wallet_Receive_CopyInvoiceUrl: String { return self._s[2928]! } - public var Conversation_TitleMute: String { return self._s[2929]! } + public var Notification_CallMissed: String { return self._s[2919]! } + public var SettingsSearch_Synonyms_Appearance_ChatBackground_Custom: String { return self._s[2920]! } + public var Channel_AdminLogFilter_EventsInfo: String { return self._s[2921]! } + public var Wallet_Month_GenOctober: String { return self._s[2923]! } + public var ChatAdmins_AdminLabel: String { return self._s[2924]! } + public var KeyCommand_JumpToNextChat: String { return self._s[2925]! } + public var Conversation_StopPollConfirmationTitle: String { return self._s[2927]! } + public var ChangePhoneNumberCode_CodePlaceholder: String { return self._s[2928]! } + public var Month_GenJune: String { return self._s[2929]! } + public var Watch_Location_Current: String { return self._s[2930]! } + public var Wallet_Receive_CopyInvoiceUrl: String { return self._s[2931]! } + public var Conversation_TitleMute: String { return self._s[2932]! } public func PUSH_CHANNEL_MESSAGE_ROUND(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2930]!, self._r[2930]!, [_1]) + return formatWithArgumentRanges(self._s[2933]!, self._r[2933]!, [_1]) } - public var GroupInfo_DeleteAndExit: String { return self._s[2931]! } + public var GroupInfo_DeleteAndExit: String { return self._s[2934]! } public func Conversation_Moderate_DeleteAllMessages(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2932]!, self._r[2932]!, [_0]) + return formatWithArgumentRanges(self._s[2935]!, self._r[2935]!, [_0]) } - public var Call_ReportPlaceholder: String { return self._s[2933]! } - public var Chat_SlowmodeSendError: String { return self._s[2934]! } - public var MaskStickerSettings_Info: String { return self._s[2935]! } - public var EditTheme_Expand_TopInfo: String { return self._s[2936]! } + public var Call_ReportPlaceholder: String { return self._s[2936]! } + public var Chat_SlowmodeSendError: String { return self._s[2937]! } + public var MaskStickerSettings_Info: String { return self._s[2938]! } + public var EditTheme_Expand_TopInfo: String { return self._s[2939]! } public func GroupInfo_AddParticipantConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2937]!, self._r[2937]!, [_0]) + return formatWithArgumentRanges(self._s[2940]!, self._r[2940]!, [_0]) } - public var Checkout_NewCard_PostcodeTitle: String { return self._s[2938]! } - public var Passport_Address_RegionPlaceholder: String { return self._s[2940]! } - public var Contacts_ShareTelegram: String { return self._s[2941]! } - public var EnterPasscode_EnterNewPasscodeNew: String { return self._s[2942]! } - public var Channel_ErrorAccessDenied: String { return self._s[2943]! } - public var UserInfo_ScamBotWarning: String { return self._s[2945]! } - public var Stickers_GroupChooseStickerPack: String { return self._s[2946]! } - public var Call_ConnectionErrorTitle: String { return self._s[2947]! } - public var UserInfo_NotificationsEnable: String { return self._s[2948]! } - public var ArchivedChats_IntroText1: String { return self._s[2949]! } - public var Tour_Text4: String { return self._s[2952]! } - public var WallpaperSearch_Recent: String { return self._s[2953]! } - public var GroupInfo_ScamGroupWarning: String { return self._s[2954]! } - public var Profile_MessageLifetime2s: String { return self._s[2956]! } - public var Appearance_ThemePreview_ChatList_5_Text: String { return self._s[2957]! } - public var Notification_MessageLifetime2s: String { return self._s[2958]! } + public var Checkout_NewCard_PostcodeTitle: String { return self._s[2941]! } + public var Passport_Address_RegionPlaceholder: String { return self._s[2943]! } + public var Contacts_ShareTelegram: String { return self._s[2944]! } + public var EnterPasscode_EnterNewPasscodeNew: String { return self._s[2945]! } + public var Channel_ErrorAccessDenied: String { return self._s[2946]! } + public var UserInfo_ScamBotWarning: String { return self._s[2948]! } + public var Stickers_GroupChooseStickerPack: String { return self._s[2949]! } + public var Call_ConnectionErrorTitle: String { return self._s[2950]! } + public var UserInfo_NotificationsEnable: String { return self._s[2951]! } + public var ArchivedChats_IntroText1: String { return self._s[2952]! } + public var Tour_Text4: String { return self._s[2955]! } + public var WallpaperSearch_Recent: String { return self._s[2956]! } + public var GroupInfo_ScamGroupWarning: String { return self._s[2957]! } + public var Profile_MessageLifetime2s: String { return self._s[2959]! } + public var Appearance_ThemePreview_ChatList_5_Text: String { return self._s[2960]! } + public var Notification_MessageLifetime2s: String { return self._s[2961]! } public func Time_PreciseDate_m10(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2959]!, self._r[2959]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[2962]!, self._r[2962]!, [_1, _2, _3]) } - public var Cache_ClearCache: String { return self._s[2960]! } - public var AutoNightTheme_UpdateLocation: String { return self._s[2961]! } - public var Permissions_NotificationsUnreachableText_v0: String { return self._s[2962]! } + public var Cache_ClearCache: String { return self._s[2963]! } + public var AutoNightTheme_UpdateLocation: String { return self._s[2964]! } + public var Permissions_NotificationsUnreachableText_v0: String { return self._s[2965]! } public func Channel_AdminLog_MessageChangedGroupUsername(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2966]!, self._r[2966]!, [_0]) + return formatWithArgumentRanges(self._s[2969]!, self._r[2969]!, [_0]) } public func Conversation_ShareMyPhoneNumber_StatusSuccess(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2968]!, self._r[2968]!, [_0]) + return formatWithArgumentRanges(self._s[2971]!, self._r[2971]!, [_0]) } - public var LocalGroup_Text: String { return self._s[2969]! } - public var Channel_AdminLog_EmptyFilterTitle: String { return self._s[2970]! } - public var SocksProxySetup_TypeSocks: String { return self._s[2971]! } - public var ChatList_UnarchiveAction: String { return self._s[2972]! } - public var AutoNightTheme_Title: String { return self._s[2973]! } - public var InstantPage_FeedbackButton: String { return self._s[2974]! } - public var Passport_FieldAddress: String { return self._s[2975]! } + public var LocalGroup_Text: String { return self._s[2972]! } + public var Channel_AdminLog_EmptyFilterTitle: String { return self._s[2973]! } + public var SocksProxySetup_TypeSocks: String { return self._s[2974]! } + public var ChatList_UnarchiveAction: String { return self._s[2975]! } + public var AutoNightTheme_Title: String { return self._s[2976]! } + public var InstantPage_FeedbackButton: String { return self._s[2977]! } + public var Passport_FieldAddress: String { return self._s[2978]! } public func Channel_AdminLog_SetSlowmode(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2976]!, self._r[2976]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2979]!, self._r[2979]!, [_1, _2]) } - public var Month_ShortMarch: String { return self._s[2977]! } + public var Month_ShortMarch: String { return self._s[2980]! } public func PUSH_MESSAGE_INVOICE(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[2978]!, self._r[2978]!, [_1, _2]) + return formatWithArgumentRanges(self._s[2981]!, self._r[2981]!, [_1, _2]) } - public var SocksProxySetup_UsernamePlaceholder: String { return self._s[2979]! } - public var Conversation_ShareInlineBotLocationConfirmation: String { return self._s[2980]! } - public var Passport_FloodError: String { return self._s[2981]! } - public var SecretGif_Title: String { return self._s[2982]! } - public var NotificationSettings_ShowNotificationsAllAccountsInfoOn: String { return self._s[2983]! } - public var ChatList_Context_UnhideArchive: String { return self._s[2984]! } - public var Passport_Language_th: String { return self._s[2986]! } - public var Passport_Address_Address: String { return self._s[2987]! } - public var Login_InvalidLastNameError: String { return self._s[2988]! } - public var Notifications_InAppNotificationsPreview: String { return self._s[2989]! } - public var Notifications_PermissionsUnreachableTitle: String { return self._s[2990]! } - public var ChatList_Context_Archive: String { return self._s[2991]! } - public var SettingsSearch_FAQ: String { return self._s[2992]! } - public var ShareMenu_Send: String { return self._s[2993]! } - public var WallpaperSearch_ColorYellow: String { return self._s[2995]! } - public var Month_GenNovember: String { return self._s[2997]! } - public var SettingsSearch_Synonyms_Appearance_LargeEmoji: String { return self._s[2999]! } + public var SocksProxySetup_UsernamePlaceholder: String { return self._s[2982]! } + public var Conversation_ShareInlineBotLocationConfirmation: String { return self._s[2983]! } + public var Passport_FloodError: String { return self._s[2984]! } + public var SecretGif_Title: String { return self._s[2985]! } + public var NotificationSettings_ShowNotificationsAllAccountsInfoOn: String { return self._s[2986]! } + public var ChatList_Context_UnhideArchive: String { return self._s[2987]! } + public var Passport_Language_th: String { return self._s[2989]! } + public var Passport_Address_Address: String { return self._s[2990]! } + public var Login_InvalidLastNameError: String { return self._s[2991]! } + public var Notifications_InAppNotificationsPreview: String { return self._s[2992]! } + public var Notifications_PermissionsUnreachableTitle: String { return self._s[2993]! } + public var ChatList_Context_Archive: String { return self._s[2994]! } + public var SettingsSearch_FAQ: String { return self._s[2995]! } + public var ShareMenu_Send: String { return self._s[2996]! } + public var WallpaperSearch_ColorYellow: String { return self._s[2998]! } + public var Month_GenNovember: String { return self._s[3000]! } + public var SettingsSearch_Synonyms_Appearance_LargeEmoji: String { return self._s[3002]! } public func Conversation_ShareMyPhoneNumberConfirmation(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3000]!, self._r[3000]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3003]!, self._r[3003]!, [_1, _2]) } - public var Conversation_SwipeToReplyHintText: String { return self._s[3001]! } - public var Checkout_Email: String { return self._s[3002]! } - public var NotificationsSound_Tritone: String { return self._s[3003]! } - public var StickerPacksSettings_ManagingHelp: String { return self._s[3005]! } - public var Wallet_ContextMenuCopy: String { return self._s[3007]! } + public var Conversation_SwipeToReplyHintText: String { return self._s[3004]! } + public var Checkout_Email: String { return self._s[3005]! } + public var NotificationsSound_Tritone: String { return self._s[3006]! } + public var StickerPacksSettings_ManagingHelp: String { return self._s[3008]! } + public var Wallet_ContextMenuCopy: String { return self._s[3010]! } public func Wallet_Time_PreciseDate_m6(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3009]!, self._r[3009]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3012]!, self._r[3012]!, [_1, _2, _3]) } + public var Appearance_TextSize_Automatic: String { return self._s[3013]! } public func PUSH_PINNED_ROUND(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3010]!, self._r[3010]!, [_1]) + return formatWithArgumentRanges(self._s[3014]!, self._r[3014]!, [_1]) } - public var ChangePhoneNumberNumber_Help: String { return self._s[3011]! } + public var ChangePhoneNumberNumber_Help: String { return self._s[3015]! } public func Checkout_LiabilityAlert(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3012]!, self._r[3012]!, [_1, _1, _1, _2]) + return formatWithArgumentRanges(self._s[3016]!, self._r[3016]!, [_1, _1, _1, _2]) } - public var ChatList_UndoArchiveTitle: String { return self._s[3013]! } - public var Notification_Exceptions_Add: String { return self._s[3014]! } - public var DialogList_You: String { return self._s[3015]! } - public var MediaPicker_Send: String { return self._s[3018]! } - public var SettingsSearch_Synonyms_Stickers_Title: String { return self._s[3019]! } - public var Appearance_ThemePreview_ChatList_4_Text: String { return self._s[3020]! } - public var Call_AudioRouteSpeaker: String { return self._s[3021]! } - public var Watch_UserInfo_Title: String { return self._s[3022]! } - public var VoiceOver_Chat_PollFinalResults: String { return self._s[3023]! } - public var Appearance_AccentColor: String { return self._s[3025]! } + public var ChatList_UndoArchiveTitle: String { return self._s[3017]! } + public var Notification_Exceptions_Add: String { return self._s[3018]! } + public var DialogList_You: String { return self._s[3019]! } + public var MediaPicker_Send: String { return self._s[3022]! } + public var SettingsSearch_Synonyms_Stickers_Title: String { return self._s[3023]! } + public var Appearance_ThemePreview_ChatList_4_Text: String { return self._s[3024]! } + public var Call_AudioRouteSpeaker: String { return self._s[3025]! } + public var Watch_UserInfo_Title: String { return self._s[3026]! } + public var VoiceOver_Chat_PollFinalResults: String { return self._s[3027]! } + public var Appearance_AccentColor: String { return self._s[3029]! } public func Login_EmailPhoneSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3026]!, self._r[3026]!, [_0]) + return formatWithArgumentRanges(self._s[3030]!, self._r[3030]!, [_0]) } - public var Permissions_ContactsAllowInSettings_v0: String { return self._s[3027]! } + public var Permissions_ContactsAllowInSettings_v0: String { return self._s[3031]! } public func PUSH_CHANNEL_MESSAGE_GAME(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3028]!, self._r[3028]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3032]!, self._r[3032]!, [_1, _2]) } - public var Conversation_ClousStorageInfo_Description2: String { return self._s[3029]! } - public var WebSearch_RecentClearConfirmation: String { return self._s[3030]! } - public var Notification_CallOutgoing: String { return self._s[3031]! } - public var PrivacySettings_PasscodeAndFaceId: String { return self._s[3032]! } - public var Channel_DiscussionGroup_MakeHistoryPublic: String { return self._s[3033]! } - public var Call_RecordingDisabledMessage: String { return self._s[3034]! } - public var Message_Game: String { return self._s[3035]! } - public var Conversation_PressVolumeButtonForSound: String { return self._s[3036]! } - public var PrivacyLastSeenSettings_CustomHelp: String { return self._s[3037]! } - public var Channel_DiscussionGroup_PrivateGroup: String { return self._s[3038]! } - public var Channel_EditAdmin_PermissionAddAdmins: String { return self._s[3039]! } - public var Date_DialogDateFormat: String { return self._s[3040]! } - public var WallpaperColors_SetCustomColor: String { return self._s[3041]! } - public var Notifications_InAppNotifications: String { return self._s[3042]! } + public var Conversation_ClousStorageInfo_Description2: String { return self._s[3033]! } + public var WebSearch_RecentClearConfirmation: String { return self._s[3034]! } + public var Notification_CallOutgoing: String { return self._s[3035]! } + public var PrivacySettings_PasscodeAndFaceId: String { return self._s[3036]! } + public var Channel_DiscussionGroup_MakeHistoryPublic: String { return self._s[3037]! } + public var Call_RecordingDisabledMessage: String { return self._s[3038]! } + public var Message_Game: String { return self._s[3039]! } + public var Conversation_PressVolumeButtonForSound: String { return self._s[3040]! } + public var PrivacyLastSeenSettings_CustomHelp: String { return self._s[3041]! } + public var Channel_DiscussionGroup_PrivateGroup: String { return self._s[3042]! } + public var Channel_EditAdmin_PermissionAddAdmins: String { return self._s[3043]! } + public var Date_DialogDateFormat: String { return self._s[3044]! } + public var WallpaperColors_SetCustomColor: String { return self._s[3045]! } + public var Notifications_InAppNotifications: String { return self._s[3046]! } public func Channel_Management_RemovedBy(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3043]!, self._r[3043]!, [_0]) + return formatWithArgumentRanges(self._s[3047]!, self._r[3047]!, [_0]) } public func Settings_ApplyProxyAlert(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3044]!, self._r[3044]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3048]!, self._r[3048]!, [_1, _2]) } - public var NewContact_Title: String { return self._s[3045]! } + public var NewContact_Title: String { return self._s[3049]! } public func AutoDownloadSettings_UpToForAll(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3046]!, self._r[3046]!, [_0]) + return formatWithArgumentRanges(self._s[3050]!, self._r[3050]!, [_0]) } - public var Conversation_ViewContactDetails: String { return self._s[3047]! } + public var Conversation_ViewContactDetails: String { return self._s[3051]! } public func PUSH_CHANNEL_MESSAGE_CONTACT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3049]!, self._r[3049]!, [_1]) + return formatWithArgumentRanges(self._s[3053]!, self._r[3053]!, [_1]) } - public var Checkout_NewCard_CardholderNameTitle: String { return self._s[3050]! } - public var Passport_Identity_ExpiryDateNone: String { return self._s[3051]! } - public var PrivacySettings_Title: String { return self._s[3052]! } - public var Conversation_SilentBroadcastTooltipOff: String { return self._s[3055]! } - public var GroupRemoved_UsersSectionTitle: String { return self._s[3056]! } - public var VoiceOver_Chat_ContactEmail: String { return self._s[3057]! } - public var Contacts_PhoneNumber: String { return self._s[3058]! } - public var TwoFactorSetup_Password_PlaceholderConfirmPassword: String { return self._s[3060]! } - public var Map_ShowPlaces: String { return self._s[3061]! } - public var ChatAdmins_Title: String { return self._s[3062]! } - public var InstantPage_Reference: String { return self._s[3064]! } - public var Wallet_Info_Updating: String { return self._s[3065]! } - public var ReportGroupLocation_Text: String { return self._s[3066]! } + public var Checkout_NewCard_CardholderNameTitle: String { return self._s[3054]! } + public var Passport_Identity_ExpiryDateNone: String { return self._s[3055]! } + public var PrivacySettings_Title: String { return self._s[3056]! } + public var Conversation_SilentBroadcastTooltipOff: String { return self._s[3059]! } + public var GroupRemoved_UsersSectionTitle: String { return self._s[3060]! } + public var VoiceOver_Chat_ContactEmail: String { return self._s[3061]! } + public var Contacts_PhoneNumber: String { return self._s[3062]! } + public var TwoFactorSetup_Password_PlaceholderConfirmPassword: String { return self._s[3064]! } + public var Map_ShowPlaces: String { return self._s[3065]! } + public var ChatAdmins_Title: String { return self._s[3066]! } + public var InstantPage_Reference: String { return self._s[3068]! } + public var Wallet_Info_Updating: String { return self._s[3069]! } + public var ReportGroupLocation_Text: String { return self._s[3070]! } public func PUSH_CHAT_MESSAGE_FWD(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3067]!, self._r[3067]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3071]!, self._r[3071]!, [_1, _2]) } - public var Camera_FlashOff: String { return self._s[3068]! } - public var Watch_UserInfo_Block: String { return self._s[3069]! } - public var ChatSettings_Stickers: String { return self._s[3070]! } - public var ChatSettings_DownloadInBackground: String { return self._s[3071]! } - public var Appearance_ThemeCarouselTintedNight: String { return self._s[3072]! } + public var Camera_FlashOff: String { return self._s[3072]! } + public var Watch_UserInfo_Block: String { return self._s[3073]! } + public var ChatSettings_Stickers: String { return self._s[3074]! } + public var ChatSettings_DownloadInBackground: String { return self._s[3075]! } + public var Appearance_ThemeCarouselTintedNight: String { return self._s[3076]! } public func UserInfo_BlockConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3073]!, self._r[3073]!, [_0]) + return formatWithArgumentRanges(self._s[3077]!, self._r[3077]!, [_0]) } - public var Settings_ViewPhoto: String { return self._s[3074]! } - public var Login_CheckOtherSessionMessages: String { return self._s[3075]! } - public var AutoDownloadSettings_Cellular: String { return self._s[3076]! } - public var Wallet_Created_ExportErrorTitle: String { return self._s[3077]! } - public var SettingsSearch_Synonyms_Notifications_GroupNotificationsExceptions: String { return self._s[3078]! } - public var VoiceOver_MessageContextShare: String { return self._s[3079]! } + public var Settings_ViewPhoto: String { return self._s[3078]! } + public var Login_CheckOtherSessionMessages: String { return self._s[3079]! } + public var AutoDownloadSettings_Cellular: String { return self._s[3080]! } + public var Wallet_Created_ExportErrorTitle: String { return self._s[3081]! } + public var SettingsSearch_Synonyms_Notifications_GroupNotificationsExceptions: String { return self._s[3082]! } + public var VoiceOver_MessageContextShare: String { return self._s[3083]! } public func Target_InviteToGroupConfirmation(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3081]!, self._r[3081]!, [_0]) + return formatWithArgumentRanges(self._s[3085]!, self._r[3085]!, [_0]) } - public var Privacy_DeleteDrafts: String { return self._s[3082]! } - public var Wallpaper_SetCustomBackgroundInfo: String { return self._s[3083]! } + public var Privacy_DeleteDrafts: String { return self._s[3086]! } + public var Wallpaper_SetCustomBackgroundInfo: String { return self._s[3087]! } public func LastSeen_AtDate(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3084]!, self._r[3084]!, [_0]) + return formatWithArgumentRanges(self._s[3088]!, self._r[3088]!, [_0]) } - public var DialogList_SavedMessagesHelp: String { return self._s[3085]! } - public var Wallet_SecureStorageNotAvailable_Title: String { return self._s[3086]! } - public var DialogList_SavedMessages: String { return self._s[3087]! } - public var GroupInfo_UpgradeButton: String { return self._s[3088]! } - public var Appearance_ThemePreview_ChatList_3_Text: String { return self._s[3090]! } - public var DialogList_Pin: String { return self._s[3091]! } + public var DialogList_SavedMessagesHelp: String { return self._s[3089]! } + public var Wallet_SecureStorageNotAvailable_Title: String { return self._s[3090]! } + public var DialogList_SavedMessages: String { return self._s[3091]! } + public var GroupInfo_UpgradeButton: String { return self._s[3092]! } + public var Appearance_ThemePreview_ChatList_3_Text: String { return self._s[3094]! } + public var DialogList_Pin: String { return self._s[3095]! } public func ForwardedAuthors2(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3092]!, self._r[3092]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3096]!, self._r[3096]!, [_0, _1]) } public func Login_PhoneGenericEmailSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3093]!, self._r[3093]!, [_0]) + return formatWithArgumentRanges(self._s[3097]!, self._r[3097]!, [_0]) } - public var Notification_Exceptions_AlwaysOn: String { return self._s[3094]! } - public var UserInfo_NotificationsDisable: String { return self._s[3095]! } - public var Paint_Outlined: String { return self._s[3096]! } - public var Activity_PlayingGame: String { return self._s[3097]! } - public var SearchImages_NoImagesFound: String { return self._s[3098]! } - public var SocksProxySetup_ProxyType: String { return self._s[3099]! } - public var AppleWatch_ReplyPresetsHelp: String { return self._s[3101]! } - public var Conversation_ContextMenuCancelSending: String { return self._s[3102]! } - public var Settings_AppLanguage: String { return self._s[3103]! } - public var TwoStepAuth_ResetAccountHelp: String { return self._s[3104]! } - public var Common_ChoosePhoto: String { return self._s[3105]! } - public var CallFeedback_ReasonEcho: String { return self._s[3106]! } + public var Notification_Exceptions_AlwaysOn: String { return self._s[3098]! } + public var UserInfo_NotificationsDisable: String { return self._s[3099]! } + public var Paint_Outlined: String { return self._s[3100]! } + public var Activity_PlayingGame: String { return self._s[3101]! } + public var SearchImages_NoImagesFound: String { return self._s[3102]! } + public var SocksProxySetup_ProxyType: String { return self._s[3103]! } + public var AppleWatch_ReplyPresetsHelp: String { return self._s[3105]! } + public var Conversation_ContextMenuCancelSending: String { return self._s[3106]! } + public var Settings_AppLanguage: String { return self._s[3107]! } + public var TwoStepAuth_ResetAccountHelp: String { return self._s[3108]! } + public var Common_ChoosePhoto: String { return self._s[3109]! } + public var CallFeedback_ReasonEcho: String { return self._s[3110]! } public func PUSH_PINNED_AUDIO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3107]!, self._r[3107]!, [_1]) + return formatWithArgumentRanges(self._s[3111]!, self._r[3111]!, [_1]) } - public var Privacy_Calls_AlwaysAllow: String { return self._s[3108]! } - public var Activity_UploadingVideo: String { return self._s[3109]! } - public var Conversation_WalletRequiredNotNow: String { return self._s[3110]! } - public var ChannelInfo_DeleteChannelConfirmation: String { return self._s[3111]! } - public var NetworkUsageSettings_Wifi: String { return self._s[3112]! } - public var VoiceOver_Editing_ClearText: String { return self._s[3113]! } - public var PUSH_SENDER_YOU: String { return self._s[3114]! } - public var Channel_BanUser_PermissionReadMessages: String { return self._s[3115]! } - public var Checkout_PayWithTouchId: String { return self._s[3116]! } - public var Wallpaper_ResetWallpapersConfirmation: String { return self._s[3117]! } + public var Privacy_Calls_AlwaysAllow: String { return self._s[3112]! } + public var Activity_UploadingVideo: String { return self._s[3113]! } + public var Conversation_WalletRequiredNotNow: String { return self._s[3114]! } + public var ChannelInfo_DeleteChannelConfirmation: String { return self._s[3115]! } + public var NetworkUsageSettings_Wifi: String { return self._s[3116]! } + public var VoiceOver_Editing_ClearText: String { return self._s[3117]! } + public var PUSH_SENDER_YOU: String { return self._s[3118]! } + public var Channel_BanUser_PermissionReadMessages: String { return self._s[3119]! } + public var Checkout_PayWithTouchId: String { return self._s[3120]! } + public var Wallpaper_ResetWallpapersConfirmation: String { return self._s[3121]! } public func PUSH_LOCKED_MESSAGE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3119]!, self._r[3119]!, [_1]) + return formatWithArgumentRanges(self._s[3123]!, self._r[3123]!, [_1]) } - public var Notifications_ExceptionsNone: String { return self._s[3120]! } + public var Notifications_ExceptionsNone: String { return self._s[3124]! } public func Message_ForwardedMessageShort(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3121]!, self._r[3121]!, [_0]) + return formatWithArgumentRanges(self._s[3125]!, self._r[3125]!, [_0]) } public func PUSH_PINNED_GEO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3122]!, self._r[3122]!, [_1]) + return formatWithArgumentRanges(self._s[3126]!, self._r[3126]!, [_1]) } - public var AuthSessions_IncompleteAttempts: String { return self._s[3124]! } - public var Passport_Address_Region: String { return self._s[3127]! } - public var ChatList_DeleteChat: String { return self._s[3128]! } - public var LogoutOptions_ClearCacheTitle: String { return self._s[3129]! } - public var PhotoEditor_TiltShift: String { return self._s[3130]! } - public var Settings_FAQ_URL: String { return self._s[3131]! } - public var TwoFactorSetup_EmailVerification_ChangeAction: String { return self._s[3132]! } - public var Passport_Language_sl: String { return self._s[3133]! } - public var Settings_PrivacySettings: String { return self._s[3135]! } - public var SharedMedia_TitleLink: String { return self._s[3136]! } - public var Passport_Identity_TypePassportUploadScan: String { return self._s[3137]! } - public var Settings_SetProfilePhoto: String { return self._s[3138]! } - public var Channel_About_Help: String { return self._s[3139]! } - public var Contacts_PermissionsEnable: String { return self._s[3140]! } - public var Wallet_Sending_Title: String { return self._s[3141]! } - public var SettingsSearch_Synonyms_Notifications_GroupNotificationsAlert: String { return self._s[3142]! } - public var AttachmentMenu_SendAsFiles: String { return self._s[3143]! } - public var CallFeedback_ReasonInterruption: String { return self._s[3145]! } - public var Passport_Address_AddTemporaryRegistration: String { return self._s[3146]! } - public var AutoDownloadSettings_AutodownloadVideos: String { return self._s[3147]! } - public var ChatSettings_AutoDownloadSettings_Delimeter: String { return self._s[3148]! } - public var PrivacySettings_DeleteAccountTitle: String { return self._s[3149]! } - public var AccessDenied_VideoMessageCamera: String { return self._s[3151]! } - public var Map_OpenInYandexMaps: String { return self._s[3153]! } - public var CreateGroup_ErrorLocatedGroupsTooMuch: String { return self._s[3154]! } - public var VoiceOver_MessageContextReply: String { return self._s[3155]! } - public var PhotoEditor_SaturationTool: String { return self._s[3156]! } + public var AuthSessions_IncompleteAttempts: String { return self._s[3128]! } + public var Passport_Address_Region: String { return self._s[3131]! } + public var ChatList_DeleteChat: String { return self._s[3132]! } + public var LogoutOptions_ClearCacheTitle: String { return self._s[3133]! } + public var PhotoEditor_TiltShift: String { return self._s[3134]! } + public var Settings_FAQ_URL: String { return self._s[3135]! } + public var TwoFactorSetup_EmailVerification_ChangeAction: String { return self._s[3136]! } + public var Passport_Language_sl: String { return self._s[3137]! } + public var Settings_PrivacySettings: String { return self._s[3139]! } + public var SharedMedia_TitleLink: String { return self._s[3140]! } + public var Passport_Identity_TypePassportUploadScan: String { return self._s[3141]! } + public var Settings_SetProfilePhoto: String { return self._s[3142]! } + public var Channel_About_Help: String { return self._s[3143]! } + public var Contacts_PermissionsEnable: String { return self._s[3144]! } + public var Wallet_Sending_Title: String { return self._s[3145]! } + public var SettingsSearch_Synonyms_Notifications_GroupNotificationsAlert: String { return self._s[3146]! } + public var AttachmentMenu_SendAsFiles: String { return self._s[3147]! } + public var CallFeedback_ReasonInterruption: String { return self._s[3149]! } + public var Passport_Address_AddTemporaryRegistration: String { return self._s[3150]! } + public var AutoDownloadSettings_AutodownloadVideos: String { return self._s[3151]! } + public var ChatSettings_AutoDownloadSettings_Delimeter: String { return self._s[3152]! } + public var PrivacySettings_DeleteAccountTitle: String { return self._s[3153]! } + public var AccessDenied_VideoMessageCamera: String { return self._s[3155]! } + public var Map_OpenInYandexMaps: String { return self._s[3157]! } + public var CreateGroup_ErrorLocatedGroupsTooMuch: String { return self._s[3158]! } + public var VoiceOver_MessageContextReply: String { return self._s[3159]! } + public var PhotoEditor_SaturationTool: String { return self._s[3160]! } public func PUSH_MESSAGE_STICKER(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3157]!, self._r[3157]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3161]!, self._r[3161]!, [_1, _2]) } - public var PrivacyPhoneNumberSettings_CustomHelp: String { return self._s[3158]! } - public var Notification_Exceptions_NewException_NotificationHeader: String { return self._s[3159]! } - public var Group_OwnershipTransfer_ErrorLocatedGroupsTooMuch: String { return self._s[3160]! } - public var Appearance_TextSize: String { return self._s[3161]! } + public var PrivacyPhoneNumberSettings_CustomHelp: String { return self._s[3162]! } + public var Notification_Exceptions_NewException_NotificationHeader: String { return self._s[3163]! } + public var Group_OwnershipTransfer_ErrorLocatedGroupsTooMuch: String { return self._s[3164]! } public func LOCAL_MESSAGE_FWDS(_ _1: String, _ _2: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3162]!, self._r[3162]!, [_1, "\(_2)"]) + return formatWithArgumentRanges(self._s[3165]!, self._r[3165]!, [_1, "\(_2)"]) } - public var Appearance_ThemePreview_ChatList_2_Text: String { return self._s[3163]! } - public var Channel_Username_InvalidTooShort: String { return self._s[3165]! } - public var SettingsSearch_Synonyms_Wallet: String { return self._s[3166]! } + public var Appearance_ThemePreview_ChatList_2_Text: String { return self._s[3166]! } + public var Channel_Username_InvalidTooShort: String { return self._s[3168]! } + public var SettingsSearch_Synonyms_Wallet: String { return self._s[3169]! } public func Group_OwnershipTransfer_DescriptionInfo(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3167]!, self._r[3167]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3170]!, self._r[3170]!, [_1, _2]) } public func PUSH_CHAT_MESSAGE_GAME(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3168]!, self._r[3168]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3171]!, self._r[3171]!, [_1, _2, _3]) } - public var GroupInfo_PublicLinkAdd: String { return self._s[3169]! } - public var Passport_PassportInformation: String { return self._s[3172]! } - public var Theme_Unsupported: String { return self._s[3173]! } - public var WatchRemote_AlertTitle: String { return self._s[3174]! } - public var Privacy_GroupsAndChannels_NeverAllow: String { return self._s[3175]! } - public var ConvertToSupergroup_HelpText: String { return self._s[3177]! } + public var GroupInfo_PublicLinkAdd: String { return self._s[3172]! } + public var Passport_PassportInformation: String { return self._s[3175]! } + public var Theme_Unsupported: String { return self._s[3176]! } + public var WatchRemote_AlertTitle: String { return self._s[3177]! } + public var Privacy_GroupsAndChannels_NeverAllow: String { return self._s[3178]! } + public var ConvertToSupergroup_HelpText: String { return self._s[3180]! } public func Time_MonthOfYear_m7(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3178]!, self._r[3178]!, [_0]) + return formatWithArgumentRanges(self._s[3181]!, self._r[3181]!, [_0]) } public func PUSH_PHONE_CALL_REQUEST(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3179]!, self._r[3179]!, [_1]) + return formatWithArgumentRanges(self._s[3182]!, self._r[3182]!, [_1]) } - public var Privacy_GroupsAndChannels_CustomHelp: String { return self._s[3180]! } - public var Wallet_Navigation_Done: String { return self._s[3182]! } - public var TwoStepAuth_RecoveryCodeInvalid: String { return self._s[3183]! } - public var AccessDenied_CameraDisabled: String { return self._s[3184]! } + public var Privacy_GroupsAndChannels_CustomHelp: String { return self._s[3183]! } + public var Wallet_Navigation_Done: String { return self._s[3185]! } + public var TwoStepAuth_RecoveryCodeInvalid: String { return self._s[3186]! } + public var AccessDenied_CameraDisabled: String { return self._s[3187]! } public func Channel_Username_UsernameIsAvailable(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3185]!, self._r[3185]!, [_0]) + return formatWithArgumentRanges(self._s[3188]!, self._r[3188]!, [_0]) } - public var ClearCache_Forever: String { return self._s[3186]! } - public var PhotoEditor_ContrastTool: String { return self._s[3189]! } + public var ClearCache_Forever: String { return self._s[3189]! } + public var PhotoEditor_ContrastTool: String { return self._s[3192]! } public func PUSH_PINNED_DOC(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3190]!, self._r[3190]!, [_1]) + return formatWithArgumentRanges(self._s[3193]!, self._r[3193]!, [_1]) } - public var DialogList_Draft: String { return self._s[3191]! } - public var Wallet_Configuration_BlockchainIdInfo: String { return self._s[3192]! } - public var Privacy_TopPeersDelete: String { return self._s[3194]! } - public var LoginPassword_PasswordPlaceholder: String { return self._s[3195]! } - public var Passport_Identity_TypeIdentityCardUploadScan: String { return self._s[3196]! } - public var WebSearch_RecentSectionClear: String { return self._s[3197]! } - public var EditTheme_ErrorInvalidCharacters: String { return self._s[3198]! } - public var Watch_ChatList_NoConversationsTitle: String { return self._s[3200]! } - public var Common_Done: String { return self._s[3202]! } - public var AuthSessions_EmptyText: String { return self._s[3203]! } - public var Wallet_Configuration_BlockchainNameChangedTitle: String { return self._s[3204]! } - public var Conversation_ShareBotContactConfirmation: String { return self._s[3205]! } - public var Tour_Title5: String { return self._s[3206]! } - public var Wallet_Settings_Title: String { return self._s[3207]! } + public var DialogList_Draft: String { return self._s[3194]! } + public var Wallet_Configuration_BlockchainIdInfo: String { return self._s[3195]! } + public var Privacy_TopPeersDelete: String { return self._s[3197]! } + public var LoginPassword_PasswordPlaceholder: String { return self._s[3198]! } + public var Passport_Identity_TypeIdentityCardUploadScan: String { return self._s[3199]! } + public var WebSearch_RecentSectionClear: String { return self._s[3200]! } + public var EditTheme_ErrorInvalidCharacters: String { return self._s[3201]! } + public var Watch_ChatList_NoConversationsTitle: String { return self._s[3203]! } + public var Common_Done: String { return self._s[3205]! } + public var AuthSessions_EmptyText: String { return self._s[3206]! } + public var Wallet_Configuration_BlockchainNameChangedTitle: String { return self._s[3207]! } + public var Conversation_ShareBotContactConfirmation: String { return self._s[3208]! } + public var Tour_Title5: String { return self._s[3209]! } + public var Wallet_Settings_Title: String { return self._s[3210]! } public func Map_DirectionsDriveEta(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3208]!, self._r[3208]!, [_0]) + return formatWithArgumentRanges(self._s[3211]!, self._r[3211]!, [_0]) } - public var ApplyLanguage_UnsufficientDataTitle: String { return self._s[3209]! } - public var Conversation_LinkDialogSave: String { return self._s[3210]! } - public var GroupInfo_ActionRestrict: String { return self._s[3211]! } - public var Checkout_Title: String { return self._s[3212]! } - public var Channel_DiscussionGroup_HeaderLabel: String { return self._s[3214]! } - public var Channel_AdminLog_CanChangeInfo: String { return self._s[3216]! } - public var Notification_RenamedGroup: String { return self._s[3217]! } - public var PeopleNearby_Groups: String { return self._s[3218]! } - public var Checkout_PayWithFaceId: String { return self._s[3219]! } - public var Channel_BanList_BlockedTitle: String { return self._s[3220]! } - public var SettingsSearch_Synonyms_Notifications_InAppNotificationsSound: String { return self._s[3222]! } - public var Checkout_WebConfirmation_Title: String { return self._s[3223]! } - public var Notifications_MessageNotificationsAlert: String { return self._s[3224]! } + public var ApplyLanguage_UnsufficientDataTitle: String { return self._s[3212]! } + public var Conversation_LinkDialogSave: String { return self._s[3213]! } + public var GroupInfo_ActionRestrict: String { return self._s[3214]! } + public var Checkout_Title: String { return self._s[3215]! } + public var Channel_DiscussionGroup_HeaderLabel: String { return self._s[3217]! } + public var Channel_AdminLog_CanChangeInfo: String { return self._s[3219]! } + public var Notification_RenamedGroup: String { return self._s[3220]! } + public var PeopleNearby_Groups: String { return self._s[3221]! } + public var Checkout_PayWithFaceId: String { return self._s[3222]! } + public var Channel_BanList_BlockedTitle: String { return self._s[3223]! } + public var SettingsSearch_Synonyms_Notifications_InAppNotificationsSound: String { return self._s[3225]! } + public var Checkout_WebConfirmation_Title: String { return self._s[3226]! } + public var Notifications_MessageNotificationsAlert: String { return self._s[3227]! } public func Activity_RemindAboutGroup(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3225]!, self._r[3225]!, [_0]) + return formatWithArgumentRanges(self._s[3228]!, self._r[3228]!, [_0]) } - public var Profile_AddToExisting: String { return self._s[3227]! } + public var Profile_AddToExisting: String { return self._s[3230]! } public func Profile_CreateEncryptedChatOutdatedError(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3228]!, self._r[3228]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3231]!, self._r[3231]!, [_0, _1]) } - public var Cache_Files: String { return self._s[3230]! } - public var Permissions_PrivacyPolicy: String { return self._s[3231]! } - public var SocksProxySetup_ConnectAndSave: String { return self._s[3232]! } - public var UserInfo_NotificationsDefaultDisabled: String { return self._s[3233]! } - public var AutoDownloadSettings_TypeContacts: String { return self._s[3235]! } - public var Appearance_ThemePreview_ChatList_1_Text: String { return self._s[3237]! } - public var Calls_NoCallsPlaceholder: String { return self._s[3238]! } + public var Cache_Files: String { return self._s[3233]! } + public var Permissions_PrivacyPolicy: String { return self._s[3234]! } + public var SocksProxySetup_ConnectAndSave: String { return self._s[3235]! } + public var UserInfo_NotificationsDefaultDisabled: String { return self._s[3236]! } + public var AutoDownloadSettings_TypeContacts: String { return self._s[3238]! } + public var Appearance_ThemePreview_ChatList_1_Text: String { return self._s[3240]! } + public var Calls_NoCallsPlaceholder: String { return self._s[3241]! } public func Wallet_Receive_ShareInvoiceUrlInfo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3239]!, self._r[3239]!, [_0]) + return formatWithArgumentRanges(self._s[3242]!, self._r[3242]!, [_0]) } - public var Channel_Username_RevokeExistingUsernamesInfo: String { return self._s[3240]! } - public var VoiceOver_AttachMedia: String { return self._s[3242]! } - public var Notifications_ExceptionsGroupPlaceholder: String { return self._s[3243]! } + public var Channel_Username_RevokeExistingUsernamesInfo: String { return self._s[3243]! } + public var VoiceOver_AttachMedia: String { return self._s[3245]! } + public var Notifications_ExceptionsGroupPlaceholder: String { return self._s[3246]! } public func PUSH_CHAT_MESSAGE_INVOICE(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3244]!, self._r[3244]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3247]!, self._r[3247]!, [_1, _2, _3]) } - public var SettingsSearch_Synonyms_Notifications_GroupNotificationsSound: String { return self._s[3245]! } - public var Conversation_SetReminder_Title: String { return self._s[3246]! } - public var Passport_FieldAddressHelp: String { return self._s[3247]! } - public var Privacy_GroupsAndChannels_InviteToChannelMultipleError: String { return self._s[3248]! } - public var PUSH_REMINDER_TITLE: String { return self._s[3249]! } + public var SettingsSearch_Synonyms_Notifications_GroupNotificationsSound: String { return self._s[3248]! } + public var Conversation_SetReminder_Title: String { return self._s[3249]! } + public var Passport_FieldAddressHelp: String { return self._s[3250]! } + public var Privacy_GroupsAndChannels_InviteToChannelMultipleError: String { return self._s[3251]! } + public var PUSH_REMINDER_TITLE: String { return self._s[3252]! } public func Login_TermsOfService_ProceedBot(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3250]!, self._r[3250]!, [_0]) + return formatWithArgumentRanges(self._s[3253]!, self._r[3253]!, [_0]) } - public var Channel_AdminLog_EmptyTitle: String { return self._s[3251]! } - public var Privacy_Calls_NeverAllow_Title: String { return self._s[3252]! } - public var Login_UnknownError: String { return self._s[3253]! } - public var Group_UpgradeNoticeText2: String { return self._s[3256]! } - public var Watch_Compose_AddContact: String { return self._s[3257]! } - public var ClearCache_StorageServiceFiles: String { return self._s[3258]! } - public var Web_Error: String { return self._s[3259]! } - public var Gif_Search: String { return self._s[3260]! } - public var Profile_MessageLifetime1h: String { return self._s[3261]! } - public var CheckoutInfo_ReceiverInfoEmailPlaceholder: String { return self._s[3262]! } - public var Channel_Username_CheckingUsername: String { return self._s[3263]! } - public var CallFeedback_ReasonSilentRemote: String { return self._s[3264]! } - public var AutoDownloadSettings_TypeChannels: String { return self._s[3265]! } - public var Channel_AboutItem: String { return self._s[3266]! } - public var Privacy_GroupsAndChannels_AlwaysAllow_Placeholder: String { return self._s[3268]! } - public var VoiceOver_Chat_VoiceMessage: String { return self._s[3269]! } - public var GroupInfo_SharedMedia: String { return self._s[3270]! } + public var Channel_AdminLog_EmptyTitle: String { return self._s[3254]! } + public var Privacy_Calls_NeverAllow_Title: String { return self._s[3255]! } + public var Login_UnknownError: String { return self._s[3256]! } + public var Group_UpgradeNoticeText2: String { return self._s[3259]! } + public var Watch_Compose_AddContact: String { return self._s[3260]! } + public var ClearCache_StorageServiceFiles: String { return self._s[3261]! } + public var Web_Error: String { return self._s[3262]! } + public var Gif_Search: String { return self._s[3263]! } + public var Profile_MessageLifetime1h: String { return self._s[3264]! } + public var CheckoutInfo_ReceiverInfoEmailPlaceholder: String { return self._s[3265]! } + public var Channel_Username_CheckingUsername: String { return self._s[3266]! } + public var CallFeedback_ReasonSilentRemote: String { return self._s[3267]! } + public var AutoDownloadSettings_TypeChannels: String { return self._s[3268]! } + public var Channel_AboutItem: String { return self._s[3269]! } + public var Privacy_GroupsAndChannels_AlwaysAllow_Placeholder: String { return self._s[3271]! } + public var VoiceOver_Chat_VoiceMessage: String { return self._s[3272]! } + public var GroupInfo_SharedMedia: String { return self._s[3273]! } public func Channel_AdminLog_MessagePromotedName(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3271]!, self._r[3271]!, [_1]) + return formatWithArgumentRanges(self._s[3274]!, self._r[3274]!, [_1]) } - public var Call_PhoneCallInProgressMessage: String { return self._s[3272]! } + public var Call_PhoneCallInProgressMessage: String { return self._s[3275]! } public func PUSH_CHANNEL_ALBUM(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3273]!, self._r[3273]!, [_1]) + return formatWithArgumentRanges(self._s[3276]!, self._r[3276]!, [_1]) } - public var ChatList_UndoArchiveRevealedText: String { return self._s[3274]! } - public var GroupInfo_InviteLink_RevokeAlert_Text: String { return self._s[3275]! } - public var Conversation_SearchByName_Placeholder: String { return self._s[3276]! } - public var CreatePoll_AddOption: String { return self._s[3277]! } - public var GroupInfo_Permissions_SearchPlaceholder: String { return self._s[3278]! } - public var Group_UpgradeNoticeHeader: String { return self._s[3279]! } - public var Channel_Management_AddModerator: String { return self._s[3280]! } - public var AutoDownloadSettings_MaxFileSize: String { return self._s[3281]! } - public var StickerPacksSettings_ShowStickersButton: String { return self._s[3282]! } - public var Wallet_Info_RefreshErrorNetworkText: String { return self._s[3283]! } - public var Theme_Colors_Background: String { return self._s[3284]! } - public var NotificationsSound_Hello: String { return self._s[3286]! } - public var SocksProxySetup_SavedProxies: String { return self._s[3287]! } - public var Channel_Stickers_Placeholder: String { return self._s[3289]! } + public var ChatList_UndoArchiveRevealedText: String { return self._s[3277]! } + public var GroupInfo_InviteLink_RevokeAlert_Text: String { return self._s[3278]! } + public var Conversation_SearchByName_Placeholder: String { return self._s[3279]! } + public var CreatePoll_AddOption: String { return self._s[3280]! } + public var GroupInfo_Permissions_SearchPlaceholder: String { return self._s[3281]! } + public var Group_UpgradeNoticeHeader: String { return self._s[3282]! } + public var Channel_Management_AddModerator: String { return self._s[3283]! } + public var AutoDownloadSettings_MaxFileSize: String { return self._s[3284]! } + public var StickerPacksSettings_ShowStickersButton: String { return self._s[3285]! } + public var Wallet_Info_RefreshErrorNetworkText: String { return self._s[3286]! } + public var Theme_Colors_Background: String { return self._s[3287]! } + public var NotificationsSound_Hello: String { return self._s[3289]! } + public var SocksProxySetup_SavedProxies: String { return self._s[3290]! } + public var Channel_Stickers_Placeholder: String { return self._s[3292]! } public func Login_EmailCodeBody(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3290]!, self._r[3290]!, [_0]) + return formatWithArgumentRanges(self._s[3293]!, self._r[3293]!, [_0]) } - public var PrivacyPolicy_DeclineDeclineAndDelete: String { return self._s[3291]! } - public var Channel_Management_AddModeratorHelp: String { return self._s[3292]! } - public var ContactInfo_BirthdayLabel: String { return self._s[3293]! } - public var ChangePhoneNumberCode_RequestingACall: String { return self._s[3294]! } - public var AutoDownloadSettings_Channels: String { return self._s[3295]! } - public var Passport_Language_mn: String { return self._s[3296]! } - public var Notifications_ResetAllNotificationsHelp: String { return self._s[3299]! } - public var GroupInfo_Permissions_SlowmodeValue_Off: String { return self._s[3300]! } - public var Passport_Language_ja: String { return self._s[3302]! } - public var Settings_About_Title: String { return self._s[3303]! } - public var Settings_NotificationsAndSounds: String { return self._s[3304]! } - public var ChannelInfo_DeleteGroup: String { return self._s[3305]! } - public var Settings_BlockedUsers: String { return self._s[3306]! } + public var PrivacyPolicy_DeclineDeclineAndDelete: String { return self._s[3294]! } + public var Channel_Management_AddModeratorHelp: String { return self._s[3295]! } + public var ContactInfo_BirthdayLabel: String { return self._s[3296]! } + public var ChangePhoneNumberCode_RequestingACall: String { return self._s[3297]! } + public var AutoDownloadSettings_Channels: String { return self._s[3298]! } + public var Passport_Language_mn: String { return self._s[3299]! } + public var Notifications_ResetAllNotificationsHelp: String { return self._s[3302]! } + public var GroupInfo_Permissions_SlowmodeValue_Off: String { return self._s[3303]! } + public var Passport_Language_ja: String { return self._s[3305]! } + public var Settings_About_Title: String { return self._s[3306]! } + public var Settings_NotificationsAndSounds: String { return self._s[3307]! } + public var ChannelInfo_DeleteGroup: String { return self._s[3308]! } + public var Settings_BlockedUsers: String { return self._s[3309]! } public func Time_MonthOfYear_m4(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3307]!, self._r[3307]!, [_0]) + return formatWithArgumentRanges(self._s[3310]!, self._r[3310]!, [_0]) } - public var EditTheme_Create_Preview_OutgoingText: String { return self._s[3308]! } - public var Wallet_Weekday_Today: String { return self._s[3309]! } - public var AutoDownloadSettings_PreloadVideo: String { return self._s[3310]! } - public var Widget_ApplicationLocked: String { return self._s[3311]! } - public var Passport_Address_AddResidentialAddress: String { return self._s[3312]! } - public var Channel_Username_Title: String { return self._s[3313]! } + public var EditTheme_Create_Preview_OutgoingText: String { return self._s[3311]! } + public var Wallet_Weekday_Today: String { return self._s[3312]! } + public var AutoDownloadSettings_PreloadVideo: String { return self._s[3313]! } + public var Widget_ApplicationLocked: String { return self._s[3314]! } + public var Passport_Address_AddResidentialAddress: String { return self._s[3315]! } + public var Channel_Username_Title: String { return self._s[3316]! } public func Notification_RemovedGroupPhoto(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3314]!, self._r[3314]!, [_0]) + return formatWithArgumentRanges(self._s[3317]!, self._r[3317]!, [_0]) } - public var AttachmentMenu_File: String { return self._s[3316]! } - public var AppleWatch_Title: String { return self._s[3317]! } - public var Activity_RecordingVideoMessage: String { return self._s[3318]! } + public var AttachmentMenu_File: String { return self._s[3319]! } + public var AppleWatch_Title: String { return self._s[3320]! } + public var Activity_RecordingVideoMessage: String { return self._s[3321]! } public func Channel_DiscussionGroup_PublicChannelLink(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3319]!, self._r[3319]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3322]!, self._r[3322]!, [_1, _2]) } - public var Theme_Colors_Messages: String { return self._s[3320]! } - public var Weekday_Saturday: String { return self._s[3321]! } - public var WallpaperPreview_SwipeColorsTopText: String { return self._s[3322]! } - public var Profile_CreateEncryptedChatError: String { return self._s[3323]! } - public var Common_Next: String { return self._s[3325]! } - public var Channel_Stickers_YourStickers: String { return self._s[3327]! } - public var Message_Theme: String { return self._s[3328]! } - public var Call_AudioRouteHeadphones: String { return self._s[3329]! } - public var TwoStepAuth_EnterPasswordForgot: String { return self._s[3331]! } - public var Watch_Contacts_NoResults: String { return self._s[3333]! } - public var PhotoEditor_TintTool: String { return self._s[3336]! } - public var LoginPassword_ResetAccount: String { return self._s[3338]! } - public var Settings_SavedMessages: String { return self._s[3339]! } - public var SettingsSearch_Synonyms_Appearance_Animations: String { return self._s[3340]! } - public var Bot_GenericSupportStatus: String { return self._s[3341]! } - public var StickerPack_Add: String { return self._s[3342]! } - public var Checkout_TotalAmount: String { return self._s[3343]! } - public var Your_cards_number_is_invalid: String { return self._s[3344]! } - public var SettingsSearch_Synonyms_Appearance_AutoNightTheme: String { return self._s[3345]! } - public var VoiceOver_Chat_VideoMessage: String { return self._s[3346]! } + public var Theme_Colors_Messages: String { return self._s[3323]! } + public var Weekday_Saturday: String { return self._s[3324]! } + public var WallpaperPreview_SwipeColorsTopText: String { return self._s[3325]! } + public var Profile_CreateEncryptedChatError: String { return self._s[3326]! } + public var Common_Next: String { return self._s[3328]! } + public var Channel_Stickers_YourStickers: String { return self._s[3330]! } + public var Message_Theme: String { return self._s[3331]! } + public var Call_AudioRouteHeadphones: String { return self._s[3332]! } + public var TwoStepAuth_EnterPasswordForgot: String { return self._s[3334]! } + public var Watch_Contacts_NoResults: String { return self._s[3336]! } + public var PhotoEditor_TintTool: String { return self._s[3339]! } + public var LoginPassword_ResetAccount: String { return self._s[3341]! } + public var Settings_SavedMessages: String { return self._s[3342]! } + public var SettingsSearch_Synonyms_Appearance_Animations: String { return self._s[3343]! } + public var Bot_GenericSupportStatus: String { return self._s[3344]! } + public var StickerPack_Add: String { return self._s[3345]! } + public var Checkout_TotalAmount: String { return self._s[3346]! } + public var Your_cards_number_is_invalid: String { return self._s[3347]! } + public var SettingsSearch_Synonyms_Appearance_AutoNightTheme: String { return self._s[3348]! } + public var VoiceOver_Chat_VideoMessage: String { return self._s[3349]! } public func ChangePhoneNumberCode_CallTimer(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3347]!, self._r[3347]!, [_0]) + return formatWithArgumentRanges(self._s[3350]!, self._r[3350]!, [_0]) } public func GroupPermission_AddedInfo(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3348]!, self._r[3348]!, [_1, _2]) - } - public var ChatSettings_ConnectionType_UseSocks5: String { return self._s[3349]! } - public func PUSH_CHAT_PHOTO_EDITED(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3351]!, self._r[3351]!, [_1, _2]) } + public var ChatSettings_ConnectionType_UseSocks5: String { return self._s[3352]! } + public func PUSH_CHAT_PHOTO_EDITED(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3354]!, self._r[3354]!, [_1, _2]) + } public func Conversation_RestrictedTextTimed(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3352]!, self._r[3352]!, [_0]) + return formatWithArgumentRanges(self._s[3355]!, self._r[3355]!, [_0]) } - public var GroupInfo_InviteLink_ShareLink: String { return self._s[3353]! } - public var StickerPack_Share: String { return self._s[3354]! } - public var Passport_DeleteAddress: String { return self._s[3355]! } - public var Settings_Passport: String { return self._s[3356]! } - public var SharedMedia_EmptyFilesText: String { return self._s[3357]! } - public var Conversation_DeleteMessagesForMe: String { return self._s[3358]! } - public var PasscodeSettings_AutoLock_IfAwayFor_1hour: String { return self._s[3359]! } - public var Contacts_PermissionsText: String { return self._s[3360]! } - public var Group_Setup_HistoryVisible: String { return self._s[3361]! } - public var Wallet_Month_ShortDecember: String { return self._s[3363]! } - public var Channel_EditAdmin_PermissionEnabledByDefault: String { return self._s[3364]! } - public var Passport_Address_AddRentalAgreement: String { return self._s[3365]! } - public var SocksProxySetup_Title: String { return self._s[3366]! } - public var Notification_Mute1h: String { return self._s[3367]! } + public var GroupInfo_InviteLink_ShareLink: String { return self._s[3356]! } + public var StickerPack_Share: String { return self._s[3357]! } + public var Passport_DeleteAddress: String { return self._s[3358]! } + public var Settings_Passport: String { return self._s[3359]! } + public var SharedMedia_EmptyFilesText: String { return self._s[3360]! } + public var Conversation_DeleteMessagesForMe: String { return self._s[3361]! } + public var PasscodeSettings_AutoLock_IfAwayFor_1hour: String { return self._s[3362]! } + public var Contacts_PermissionsText: String { return self._s[3363]! } + public var Group_Setup_HistoryVisible: String { return self._s[3364]! } + public var Wallet_Month_ShortDecember: String { return self._s[3366]! } + public var Channel_EditAdmin_PermissionEnabledByDefault: String { return self._s[3367]! } + public var Passport_Address_AddRentalAgreement: String { return self._s[3368]! } + public var SocksProxySetup_Title: String { return self._s[3369]! } + public var Notification_Mute1h: String { return self._s[3370]! } public func Passport_Email_CodeHelp(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3368]!, self._r[3368]!, [_0]) + return formatWithArgumentRanges(self._s[3371]!, self._r[3371]!, [_0]) } - public var NotificationSettings_ShowNotificationsAllAccountsInfoOff: String { return self._s[3369]! } + public var NotificationSettings_ShowNotificationsAllAccountsInfoOff: String { return self._s[3372]! } public func PUSH_PINNED_GEOLIVE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3370]!, self._r[3370]!, [_1]) + return formatWithArgumentRanges(self._s[3373]!, self._r[3373]!, [_1]) } - public var FastTwoStepSetup_PasswordSection: String { return self._s[3371]! } - public var NetworkUsageSettings_ResetStatsConfirmation: String { return self._s[3374]! } - public var InfoPlist_NSFaceIDUsageDescription: String { return self._s[3376]! } - public var DialogList_NoMessagesText: String { return self._s[3377]! } - public var Privacy_ContactsResetConfirmation: String { return self._s[3378]! } - public var Privacy_Calls_P2PHelp: String { return self._s[3379]! } - public var Channel_DiscussionGroup_SearchPlaceholder: String { return self._s[3381]! } - public var Your_cards_expiration_year_is_invalid: String { return self._s[3382]! } - public var Common_TakePhotoOrVideo: String { return self._s[3383]! } - public var Wallet_Words_Text: String { return self._s[3384]! } - public var Call_StatusBusy: String { return self._s[3385]! } - public var Conversation_PinnedMessage: String { return self._s[3386]! } - public var AutoDownloadSettings_VoiceMessagesTitle: String { return self._s[3387]! } - public var Wallet_Configuration_BlockchainNameChangedProceed: String { return self._s[3388]! } - public var TwoStepAuth_SetupPasswordConfirmFailed: String { return self._s[3389]! } - public var Undo_ChatCleared: String { return self._s[3390]! } - public var AppleWatch_ReplyPresets: String { return self._s[3391]! } - public var Passport_DiscardMessageDescription: String { return self._s[3393]! } - public var Login_NetworkError: String { return self._s[3394]! } + public var FastTwoStepSetup_PasswordSection: String { return self._s[3374]! } + public var NetworkUsageSettings_ResetStatsConfirmation: String { return self._s[3377]! } + public var InfoPlist_NSFaceIDUsageDescription: String { return self._s[3379]! } + public var DialogList_NoMessagesText: String { return self._s[3380]! } + public var Privacy_ContactsResetConfirmation: String { return self._s[3381]! } + public var Privacy_Calls_P2PHelp: String { return self._s[3382]! } + public var Channel_DiscussionGroup_SearchPlaceholder: String { return self._s[3384]! } + public var Your_cards_expiration_year_is_invalid: String { return self._s[3385]! } + public var Common_TakePhotoOrVideo: String { return self._s[3386]! } + public var Wallet_Words_Text: String { return self._s[3387]! } + public var Call_StatusBusy: String { return self._s[3388]! } + public var Conversation_PinnedMessage: String { return self._s[3389]! } + public var AutoDownloadSettings_VoiceMessagesTitle: String { return self._s[3390]! } + public var Wallet_Configuration_BlockchainNameChangedProceed: String { return self._s[3391]! } + public var TwoStepAuth_SetupPasswordConfirmFailed: String { return self._s[3392]! } + public var Undo_ChatCleared: String { return self._s[3393]! } + public var AppleWatch_ReplyPresets: String { return self._s[3394]! } + public var Passport_DiscardMessageDescription: String { return self._s[3396]! } + public var Login_NetworkError: String { return self._s[3397]! } public func Notification_PinnedRoundMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3395]!, self._r[3395]!, [_0]) + return formatWithArgumentRanges(self._s[3398]!, self._r[3398]!, [_0]) } public func Channel_AdminLog_MessageRemovedChannelUsername(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3396]!, self._r[3396]!, [_0]) + return formatWithArgumentRanges(self._s[3399]!, self._r[3399]!, [_0]) } - public var SocksProxySetup_PasswordPlaceholder: String { return self._s[3397]! } - public var Wallet_WordCheck_ViewWords: String { return self._s[3399]! } - public var Login_ResetAccountProtected_LimitExceeded: String { return self._s[3400]! } + public var SocksProxySetup_PasswordPlaceholder: String { return self._s[3400]! } + public var Wallet_WordCheck_ViewWords: String { return self._s[3402]! } + public var Login_ResetAccountProtected_LimitExceeded: String { return self._s[3403]! } public func Watch_LastSeen_YesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3402]!, self._r[3402]!, [_0]) + return formatWithArgumentRanges(self._s[3405]!, self._r[3405]!, [_0]) } - public var Call_ConnectionErrorMessage: String { return self._s[3403]! } - public var VoiceOver_Chat_Music: String { return self._s[3404]! } - public var SettingsSearch_Synonyms_Notifications_MessageNotificationsSound: String { return self._s[3405]! } - public var Compose_GroupTokenListPlaceholder: String { return self._s[3407]! } - public var ConversationMedia_Title: String { return self._s[3408]! } - public var EncryptionKey_Title: String { return self._s[3410]! } - public var TwoStepAuth_EnterPasswordTitle: String { return self._s[3411]! } - public var Notification_Exceptions_AddException: String { return self._s[3412]! } - public var PrivacySettings_BlockedPeersEmpty: String { return self._s[3413]! } - public var Profile_MessageLifetime1m: String { return self._s[3414]! } + public var Call_ConnectionErrorMessage: String { return self._s[3406]! } + public var VoiceOver_Chat_Music: String { return self._s[3407]! } + public var SettingsSearch_Synonyms_Notifications_MessageNotificationsSound: String { return self._s[3408]! } + public var Compose_GroupTokenListPlaceholder: String { return self._s[3410]! } + public var ConversationMedia_Title: String { return self._s[3411]! } + public var EncryptionKey_Title: String { return self._s[3413]! } + public var TwoStepAuth_EnterPasswordTitle: String { return self._s[3414]! } + public var Notification_Exceptions_AddException: String { return self._s[3415]! } + public var PrivacySettings_BlockedPeersEmpty: String { return self._s[3416]! } + public var Profile_MessageLifetime1m: String { return self._s[3417]! } public func Channel_AdminLog_MessageUnkickedName(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3415]!, self._r[3415]!, [_1]) + return formatWithArgumentRanges(self._s[3418]!, self._r[3418]!, [_1]) } - public var Month_GenMay: String { return self._s[3416]! } + public var Month_GenMay: String { return self._s[3419]! } public func LiveLocationUpdated_TodayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3417]!, self._r[3417]!, [_0]) + return formatWithArgumentRanges(self._s[3420]!, self._r[3420]!, [_0]) } - public var PeopleNearby_Users: String { return self._s[3418]! } - public var Wallet_Send_AddressInfo: String { return self._s[3419]! } - public var ChannelMembers_WhoCanAddMembersAllHelp: String { return self._s[3420]! } - public var AutoDownloadSettings_ResetSettings: String { return self._s[3421]! } + public var PeopleNearby_Users: String { return self._s[3421]! } + public var Wallet_Send_AddressInfo: String { return self._s[3422]! } + public var ChannelMembers_WhoCanAddMembersAllHelp: String { return self._s[3423]! } + public var AutoDownloadSettings_ResetSettings: String { return self._s[3424]! } public func Wallet_Updated_AtDate(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3423]!, self._r[3423]!, [_0]) + return formatWithArgumentRanges(self._s[3426]!, self._r[3426]!, [_0]) } - public var Conversation_EmptyPlaceholder: String { return self._s[3424]! } - public var Passport_Address_AddPassportRegistration: String { return self._s[3425]! } - public var Notifications_ChannelNotificationsAlert: String { return self._s[3426]! } - public var ChatSettings_AutoDownloadUsingCellular: String { return self._s[3427]! } - public var Camera_TapAndHoldForVideo: String { return self._s[3428]! } - public var Channel_JoinChannel: String { return self._s[3430]! } - public var Appearance_Animations: String { return self._s[3433]! } + public var Conversation_EmptyPlaceholder: String { return self._s[3427]! } + public var Passport_Address_AddPassportRegistration: String { return self._s[3428]! } + public var Notifications_ChannelNotificationsAlert: String { return self._s[3429]! } + public var ChatSettings_AutoDownloadUsingCellular: String { return self._s[3430]! } + public var Camera_TapAndHoldForVideo: String { return self._s[3431]! } + public var Channel_JoinChannel: String { return self._s[3433]! } + public var Appearance_Animations: String { return self._s[3436]! } public func Notification_MessageLifetimeChanged(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3434]!, self._r[3434]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3437]!, self._r[3437]!, [_1, _2]) } - public var Stickers_GroupStickers: String { return self._s[3436]! } - public var Appearance_ShareTheme: String { return self._s[3437]! } - public var TwoFactorSetup_Hint_Placeholder: String { return self._s[3438]! } - public var ConvertToSupergroup_HelpTitle: String { return self._s[3440]! } - public var Passport_Address_Street: String { return self._s[3441]! } - public var Conversation_AddContact: String { return self._s[3442]! } - public var Login_PhonePlaceholder: String { return self._s[3443]! } - public var Channel_Members_InviteLink: String { return self._s[3445]! } - public var Bot_Stop: String { return self._s[3446]! } - public var SettingsSearch_Synonyms_Proxy_UseForCalls: String { return self._s[3448]! } - public var Notification_PassportValueAddress: String { return self._s[3449]! } - public var Month_ShortJuly: String { return self._s[3450]! } - public var Passport_Address_TypeTemporaryRegistrationUploadScan: String { return self._s[3451]! } - public var Channel_AdminLog_BanSendMedia: String { return self._s[3452]! } - public var Passport_Identity_ReverseSide: String { return self._s[3453]! } - public var Watch_Stickers_Recents: String { return self._s[3456]! } - public var PrivacyLastSeenSettings_EmpryUsersPlaceholder: String { return self._s[3458]! } - public var Map_SendThisLocation: String { return self._s[3459]! } + public var Stickers_GroupStickers: String { return self._s[3439]! } + public var Appearance_ShareTheme: String { return self._s[3440]! } + public var TwoFactorSetup_Hint_Placeholder: String { return self._s[3441]! } + public var ConvertToSupergroup_HelpTitle: String { return self._s[3443]! } + public var Passport_Address_Street: String { return self._s[3444]! } + public var Conversation_AddContact: String { return self._s[3445]! } + public var Login_PhonePlaceholder: String { return self._s[3446]! } + public var Channel_Members_InviteLink: String { return self._s[3448]! } + public var Bot_Stop: String { return self._s[3449]! } + public var SettingsSearch_Synonyms_Proxy_UseForCalls: String { return self._s[3451]! } + public var Notification_PassportValueAddress: String { return self._s[3452]! } + public var Month_ShortJuly: String { return self._s[3453]! } + public var Passport_Address_TypeTemporaryRegistrationUploadScan: String { return self._s[3454]! } + public var Channel_AdminLog_BanSendMedia: String { return self._s[3455]! } + public var Passport_Identity_ReverseSide: String { return self._s[3456]! } + public var Watch_Stickers_Recents: String { return self._s[3459]! } + public var PrivacyLastSeenSettings_EmpryUsersPlaceholder: String { return self._s[3461]! } + public var Map_SendThisLocation: String { return self._s[3462]! } public func Time_MonthOfYear_m1(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3460]!, self._r[3460]!, [_0]) + return formatWithArgumentRanges(self._s[3463]!, self._r[3463]!, [_0]) } public func InviteText_SingleContact(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3461]!, self._r[3461]!, [_0]) - } - public var ConvertToSupergroup_Note: String { return self._s[3462]! } - public var Wallet_Intro_NotNow: String { return self._s[3463]! } - public func FileSize_MB(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3464]!, self._r[3464]!, [_0]) } - public var NetworkUsageSettings_GeneralDataSection: String { return self._s[3465]! } + public var ConvertToSupergroup_Note: String { return self._s[3465]! } + public var Wallet_Intro_NotNow: String { return self._s[3466]! } + public func FileSize_MB(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3467]!, self._r[3467]!, [_0]) + } + public var NetworkUsageSettings_GeneralDataSection: String { return self._s[3468]! } public func Compatibility_SecretMediaVersionTooLow(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3466]!, self._r[3466]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3469]!, self._r[3469]!, [_0, _1]) } - public var Login_CallRequestState3: String { return self._s[3468]! } - public var Wallpaper_SearchShort: String { return self._s[3469]! } - public var SettingsSearch_Synonyms_Appearance_ColorTheme: String { return self._s[3471]! } - public var PasscodeSettings_UnlockWithFaceId: String { return self._s[3472]! } - public var Channel_BotDoesntSupportGroups: String { return self._s[3473]! } + public var Login_CallRequestState3: String { return self._s[3471]! } + public var Wallpaper_SearchShort: String { return self._s[3472]! } + public var SettingsSearch_Synonyms_Appearance_ColorTheme: String { return self._s[3474]! } + public var PasscodeSettings_UnlockWithFaceId: String { return self._s[3475]! } + public var Channel_BotDoesntSupportGroups: String { return self._s[3476]! } public func PUSH_CHAT_MESSAGE_GEOLIVE(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3474]!, self._r[3474]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3477]!, self._r[3477]!, [_1, _2]) } - public var Channel_AdminLogFilter_Title: String { return self._s[3475]! } - public var Notifications_GroupNotificationsExceptions: String { return self._s[3479]! } + public var Channel_AdminLogFilter_Title: String { return self._s[3478]! } + public var Notifications_GroupNotificationsExceptions: String { return self._s[3482]! } public func FileSize_B(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3480]!, self._r[3480]!, [_0]) - } - public var Passport_CorrectErrors: String { return self._s[3481]! } - public var VoiceOver_Chat_YourAnonymousPoll: String { return self._s[3482]! } - public func Channel_MessageTitleUpdated(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3483]!, self._r[3483]!, [_0]) } - public var Map_SendMyCurrentLocation: String { return self._s[3484]! } - public var Channel_DiscussionGroup: String { return self._s[3485]! } - public var TwoFactorSetup_Email_SkipConfirmationSkip: String { return self._s[3486]! } + public var Passport_CorrectErrors: String { return self._s[3484]! } + public var VoiceOver_Chat_YourAnonymousPoll: String { return self._s[3485]! } + public func Channel_MessageTitleUpdated(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3486]!, self._r[3486]!, [_0]) + } + public var Map_SendMyCurrentLocation: String { return self._s[3487]! } + public var Channel_DiscussionGroup: String { return self._s[3488]! } + public var TwoFactorSetup_Email_SkipConfirmationSkip: String { return self._s[3489]! } public func PUSH_PINNED_CONTACT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3487]!, self._r[3487]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3490]!, self._r[3490]!, [_1, _2]) } - public var SharedMedia_SearchNoResults: String { return self._s[3488]! } - public var Permissions_NotificationsText_v0: String { return self._s[3489]! } - public var Channel_EditAdmin_PermissionDeleteMessagesOfOthers: String { return self._s[3490]! } - public var Appearance_AppIcon: String { return self._s[3491]! } - public var Appearance_ThemePreview_ChatList_3_AuthorName: String { return self._s[3492]! } - public var LoginPassword_FloodError: String { return self._s[3493]! } - public var Wallet_Send_OwnAddressAlertProceed: String { return self._s[3495]! } - public var Group_Setup_HistoryHiddenHelp: String { return self._s[3496]! } + public var SharedMedia_SearchNoResults: String { return self._s[3491]! } + public var Permissions_NotificationsText_v0: String { return self._s[3492]! } + public var Channel_EditAdmin_PermissionDeleteMessagesOfOthers: String { return self._s[3493]! } + public var Appearance_AppIcon: String { return self._s[3494]! } + public var Appearance_ThemePreview_ChatList_3_AuthorName: String { return self._s[3495]! } + public var LoginPassword_FloodError: String { return self._s[3496]! } + public var Wallet_Send_OwnAddressAlertProceed: String { return self._s[3498]! } + public var Group_Setup_HistoryHiddenHelp: String { return self._s[3499]! } public func TwoStepAuth_PendingEmailHelp(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3497]!, self._r[3497]!, [_0]) + return formatWithArgumentRanges(self._s[3500]!, self._r[3500]!, [_0]) } - public var Passport_Language_bn: String { return self._s[3498]! } + public var Passport_Language_bn: String { return self._s[3501]! } public func DialogList_SingleUploadingPhotoSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3499]!, self._r[3499]!, [_0]) - } - public var ChatList_Context_Pin: String { return self._s[3500]! } - public func Notification_PinnedAudioMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3501]!, self._r[3501]!, [_0]) - } - public func Channel_AdminLog_MessageChangedGroupStickerPack(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3502]!, self._r[3502]!, [_0]) } - public var Wallet_Navigation_Close: String { return self._s[3503]! } - public var GroupInfo_InvitationLinkGroupFull: String { return self._s[3507]! } - public var Group_EditAdmin_PermissionChangeInfo: String { return self._s[3509]! } - public var Wallet_Month_GenDecember: String { return self._s[3510]! } - public var Contacts_PermissionsAllow: String { return self._s[3511]! } - public var ReportPeer_ReasonCopyright: String { return self._s[3512]! } - public var Channel_EditAdmin_PermissinAddAdminOn: String { return self._s[3513]! } - public var WallpaperPreview_Pattern: String { return self._s[3514]! } - public var Paint_Duplicate: String { return self._s[3515]! } - public var Passport_Address_Country: String { return self._s[3516]! } - public var Notification_RenamedChannel: String { return self._s[3518]! } - public var ChatList_Context_Unmute: String { return self._s[3519]! } - public var CheckoutInfo_ErrorPostcodeInvalid: String { return self._s[3520]! } - public var Group_MessagePhotoUpdated: String { return self._s[3521]! } - public var Channel_BanUser_PermissionSendMedia: String { return self._s[3522]! } - public var Conversation_ContextMenuBan: String { return self._s[3523]! } - public var TwoStepAuth_EmailSent: String { return self._s[3524]! } - public var MessagePoll_NoVotes: String { return self._s[3525]! } - public var Wallet_Send_ErrorNotEnoughFundsTitle: String { return self._s[3526]! } - public var Passport_Language_is: String { return self._s[3527]! } - public var PeopleNearby_UsersEmpty: String { return self._s[3529]! } - public var Tour_Text5: String { return self._s[3530]! } + public var ChatList_Context_Pin: String { return self._s[3503]! } + public func Notification_PinnedAudioMessage(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3504]!, self._r[3504]!, [_0]) + } + public func Channel_AdminLog_MessageChangedGroupStickerPack(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3505]!, self._r[3505]!, [_0]) + } + public var Wallet_Navigation_Close: String { return self._s[3506]! } + public var GroupInfo_InvitationLinkGroupFull: String { return self._s[3510]! } + public var Group_EditAdmin_PermissionChangeInfo: String { return self._s[3512]! } + public var Wallet_Month_GenDecember: String { return self._s[3513]! } + public var Contacts_PermissionsAllow: String { return self._s[3514]! } + public var ReportPeer_ReasonCopyright: String { return self._s[3515]! } + public var Channel_EditAdmin_PermissinAddAdminOn: String { return self._s[3516]! } + public var WallpaperPreview_Pattern: String { return self._s[3517]! } + public var Paint_Duplicate: String { return self._s[3518]! } + public var Passport_Address_Country: String { return self._s[3519]! } + public var Notification_RenamedChannel: String { return self._s[3521]! } + public var ChatList_Context_Unmute: String { return self._s[3522]! } + public var CheckoutInfo_ErrorPostcodeInvalid: String { return self._s[3523]! } + public var Group_MessagePhotoUpdated: String { return self._s[3524]! } + public var Channel_BanUser_PermissionSendMedia: String { return self._s[3525]! } + public var Conversation_ContextMenuBan: String { return self._s[3526]! } + public var TwoStepAuth_EmailSent: String { return self._s[3527]! } + public var MessagePoll_NoVotes: String { return self._s[3528]! } + public var Wallet_Send_ErrorNotEnoughFundsTitle: String { return self._s[3529]! } + public var Passport_Language_is: String { return self._s[3530]! } + public var PeopleNearby_UsersEmpty: String { return self._s[3532]! } + public var Tour_Text5: String { return self._s[3533]! } public func Call_GroupFormat(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3532]!, self._r[3532]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3535]!, self._r[3535]!, [_1, _2]) } - public var Undo_SecretChatDeleted: String { return self._s[3533]! } - public var SocksProxySetup_ShareQRCode: String { return self._s[3534]! } + public var Undo_SecretChatDeleted: String { return self._s[3536]! } + public var SocksProxySetup_ShareQRCode: String { return self._s[3537]! } public func VoiceOver_Chat_Size(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3535]!, self._r[3535]!, [_0]) + return formatWithArgumentRanges(self._s[3538]!, self._r[3538]!, [_0]) } - public var LogoutOptions_ChangePhoneNumberText: String { return self._s[3536]! } - public var Paint_Edit: String { return self._s[3538]! } - public var ScheduledMessages_ReminderNotification: String { return self._s[3540]! } - public var Undo_DeletedGroup: String { return self._s[3542]! } - public var LoginPassword_ForgotPassword: String { return self._s[3543]! } - public var Wallet_WordImport_IncorrectTitle: String { return self._s[3544]! } - public var GroupInfo_GroupNamePlaceholder: String { return self._s[3545]! } + public var LogoutOptions_ChangePhoneNumberText: String { return self._s[3539]! } + public var Paint_Edit: String { return self._s[3541]! } + public var ScheduledMessages_ReminderNotification: String { return self._s[3543]! } + public var Undo_DeletedGroup: String { return self._s[3545]! } + public var LoginPassword_ForgotPassword: String { return self._s[3546]! } + public var Wallet_WordImport_IncorrectTitle: String { return self._s[3547]! } + public var GroupInfo_GroupNamePlaceholder: String { return self._s[3548]! } public func Notification_Kicked(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3546]!, self._r[3546]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3549]!, self._r[3549]!, [_0, _1]) } - public var AppWallet_TransactionInfo_FeeInfoURL: String { return self._s[3547]! } - public var Conversation_InputTextCaptionPlaceholder: String { return self._s[3548]! } - public var AutoDownloadSettings_VideoMessagesTitle: String { return self._s[3549]! } - public var Passport_Language_uz: String { return self._s[3550]! } - public var Conversation_PinMessageAlertGroup: String { return self._s[3551]! } - public var SettingsSearch_Synonyms_Privacy_GroupsAndChannels: String { return self._s[3552]! } - public var Map_StopLiveLocation: String { return self._s[3554]! } - public var VoiceOver_MessageContextSend: String { return self._s[3556]! } - public var PasscodeSettings_Help: String { return self._s[3557]! } - public var NotificationsSound_Input: String { return self._s[3558]! } - public var Share_Title: String { return self._s[3561]! } - public var LogoutOptions_Title: String { return self._s[3562]! } - public var Wallet_Send_AddressText: String { return self._s[3563]! } - public var Login_TermsOfServiceAgree: String { return self._s[3564]! } - public var Compose_NewEncryptedChatTitle: String { return self._s[3565]! } - public var Channel_AdminLog_TitleSelectedEvents: String { return self._s[3566]! } - public var Channel_EditAdmin_PermissionEditMessages: String { return self._s[3567]! } - public var EnterPasscode_EnterTitle: String { return self._s[3568]! } + public var AppWallet_TransactionInfo_FeeInfoURL: String { return self._s[3550]! } + public var Conversation_InputTextCaptionPlaceholder: String { return self._s[3551]! } + public var AutoDownloadSettings_VideoMessagesTitle: String { return self._s[3552]! } + public var Passport_Language_uz: String { return self._s[3553]! } + public var Conversation_PinMessageAlertGroup: String { return self._s[3554]! } + public var SettingsSearch_Synonyms_Privacy_GroupsAndChannels: String { return self._s[3555]! } + public var Map_StopLiveLocation: String { return self._s[3557]! } + public var VoiceOver_MessageContextSend: String { return self._s[3559]! } + public var PasscodeSettings_Help: String { return self._s[3560]! } + public var NotificationsSound_Input: String { return self._s[3561]! } + public var Share_Title: String { return self._s[3564]! } + public var LogoutOptions_Title: String { return self._s[3565]! } + public var Wallet_Send_AddressText: String { return self._s[3566]! } + public var Login_TermsOfServiceAgree: String { return self._s[3567]! } + public var Compose_NewEncryptedChatTitle: String { return self._s[3568]! } + public var Channel_AdminLog_TitleSelectedEvents: String { return self._s[3569]! } + public var Channel_EditAdmin_PermissionEditMessages: String { return self._s[3570]! } + public var EnterPasscode_EnterTitle: String { return self._s[3571]! } public func Call_PrivacyErrorMessage(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3569]!, self._r[3569]!, [_0]) - } - public var Settings_CopyPhoneNumber: String { return self._s[3570]! } - public var Conversation_AddToContacts: String { return self._s[3571]! } - public func VoiceOver_Chat_ReplyFrom(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3572]!, self._r[3572]!, [_0]) } - public var NotificationsSound_Keys: String { return self._s[3573]! } + public var Settings_CopyPhoneNumber: String { return self._s[3573]! } + public var Conversation_AddToContacts: String { return self._s[3574]! } + public func VoiceOver_Chat_ReplyFrom(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3575]!, self._r[3575]!, [_0]) + } + public var NotificationsSound_Keys: String { return self._s[3576]! } public func Call_ParticipantVersionOutdatedError(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3574]!, self._r[3574]!, [_0]) + return formatWithArgumentRanges(self._s[3577]!, self._r[3577]!, [_0]) } - public var Notification_MessageLifetime1w: String { return self._s[3575]! } - public var Message_Video: String { return self._s[3576]! } - public var AutoDownloadSettings_CellularTitle: String { return self._s[3577]! } + public var Notification_MessageLifetime1w: String { return self._s[3578]! } + public var Message_Video: String { return self._s[3579]! } + public var AutoDownloadSettings_CellularTitle: String { return self._s[3580]! } public func PUSH_CHANNEL_MESSAGE_PHOTO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3578]!, self._r[3578]!, [_1]) + return formatWithArgumentRanges(self._s[3581]!, self._r[3581]!, [_1]) } - public var Wallet_Receive_AmountInfo: String { return self._s[3581]! } + public var Wallet_Receive_AmountInfo: String { return self._s[3584]! } public func Notification_JoinedChat(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3582]!, self._r[3582]!, [_0]) + return formatWithArgumentRanges(self._s[3585]!, self._r[3585]!, [_0]) } public func PrivacySettings_LastSeenContactsPlus(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3583]!, self._r[3583]!, [_0]) + return formatWithArgumentRanges(self._s[3586]!, self._r[3586]!, [_0]) } - public var Passport_Language_mk: String { return self._s[3584]! } + public var Passport_Language_mk: String { return self._s[3587]! } public func Wallet_Time_PreciseDate_m2(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3585]!, self._r[3585]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3588]!, self._r[3588]!, [_1, _2, _3]) } - public var CreatePoll_CancelConfirmation: String { return self._s[3586]! } - public var Conversation_SilentBroadcastTooltipOn: String { return self._s[3588]! } - public var PrivacyPolicy_Decline: String { return self._s[3589]! } - public var Passport_Identity_DoesNotExpire: String { return self._s[3590]! } - public var Channel_AdminLogFilter_EventsRestrictions: String { return self._s[3591]! } - public var Permissions_SiriAllow_v0: String { return self._s[3593]! } - public var Wallet_Month_ShortAugust: String { return self._s[3594]! } - public var Appearance_ThemeCarouselNight: String { return self._s[3595]! } + public var CreatePoll_CancelConfirmation: String { return self._s[3589]! } + public var Conversation_SilentBroadcastTooltipOn: String { return self._s[3591]! } + public var PrivacyPolicy_Decline: String { return self._s[3592]! } + public var Passport_Identity_DoesNotExpire: String { return self._s[3593]! } + public var Channel_AdminLogFilter_EventsRestrictions: String { return self._s[3594]! } + public var Permissions_SiriAllow_v0: String { return self._s[3596]! } + public var Wallet_Month_ShortAugust: String { return self._s[3597]! } + public var Appearance_ThemeCarouselNight: String { return self._s[3598]! } public func LOCAL_CHAT_MESSAGE_FWDS(_ _1: String, _ _2: Int) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3596]!, self._r[3596]!, [_1, "\(_2)"]) + return formatWithArgumentRanges(self._s[3599]!, self._r[3599]!, [_1, "\(_2)"]) } public func Notification_RenamedChat(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3597]!, self._r[3597]!, [_0]) + return formatWithArgumentRanges(self._s[3600]!, self._r[3600]!, [_0]) } - public var Paint_Regular: String { return self._s[3598]! } - public var ChatSettings_AutoDownloadReset: String { return self._s[3599]! } - public var SocksProxySetup_ShareLink: String { return self._s[3600]! } - public var Wallet_Qr_Title: String { return self._s[3601]! } - public var BlockedUsers_SelectUserTitle: String { return self._s[3602]! } - public var VoiceOver_Chat_RecordModeVoiceMessage: String { return self._s[3604]! } - public var Wallet_Settings_Configuration: String { return self._s[3605]! } - public var GroupInfo_InviteByLink: String { return self._s[3606]! } - public var MessageTimer_Custom: String { return self._s[3607]! } - public var UserInfo_NotificationsDefaultEnabled: String { return self._s[3608]! } - public var Passport_Address_TypeTemporaryRegistration: String { return self._s[3610]! } - public var Conversation_SendMessage_SetReminder: String { return self._s[3611]! } - public var VoiceOver_Chat_Selected: String { return self._s[3612]! } - public var ChatSettings_AutoDownloadUsingWiFi: String { return self._s[3613]! } - public var Channel_Username_InvalidTaken: String { return self._s[3614]! } - public var Conversation_ClousStorageInfo_Description3: String { return self._s[3615]! } - public var Wallet_WordCheck_TryAgain: String { return self._s[3616]! } - public var Wallet_Info_TransactionPendingHeader: String { return self._s[3617]! } - public var Settings_ChatBackground: String { return self._s[3618]! } - public var Channel_Subscribers_Title: String { return self._s[3619]! } - public var Wallet_Receive_InvoiceUrlHeader: String { return self._s[3620]! } - public var ApplyLanguage_ChangeLanguageTitle: String { return self._s[3621]! } - public var Watch_ConnectionDescription: String { return self._s[3622]! } - public var Wallet_Configuration_ApplyErrorTitle: String { return self._s[3625]! } - public var ChatList_ArchivedChatsTitle: String { return self._s[3627]! } - public var Wallpaper_ResetWallpapers: String { return self._s[3628]! } - public var Wallet_Send_TransactionInProgress: String { return self._s[3629]! } - public var EditProfile_Title: String { return self._s[3630]! } - public var NotificationsSound_Bamboo: String { return self._s[3632]! } - public var Channel_AdminLog_MessagePreviousMessage: String { return self._s[3634]! } - public var Login_SmsRequestState2: String { return self._s[3635]! } - public var Passport_Language_ar: String { return self._s[3636]! } + public var Paint_Regular: String { return self._s[3601]! } + public var ChatSettings_AutoDownloadReset: String { return self._s[3602]! } + public var SocksProxySetup_ShareLink: String { return self._s[3603]! } + public var Wallet_Qr_Title: String { return self._s[3604]! } + public var BlockedUsers_SelectUserTitle: String { return self._s[3605]! } + public var VoiceOver_Chat_RecordModeVoiceMessage: String { return self._s[3607]! } + public var Wallet_Settings_Configuration: String { return self._s[3608]! } + public var GroupInfo_InviteByLink: String { return self._s[3609]! } + public var MessageTimer_Custom: String { return self._s[3610]! } + public var UserInfo_NotificationsDefaultEnabled: String { return self._s[3611]! } + public var Passport_Address_TypeTemporaryRegistration: String { return self._s[3613]! } + public var Conversation_SendMessage_SetReminder: String { return self._s[3614]! } + public var VoiceOver_Chat_Selected: String { return self._s[3615]! } + public var ChatSettings_AutoDownloadUsingWiFi: String { return self._s[3616]! } + public var Channel_Username_InvalidTaken: String { return self._s[3617]! } + public var Conversation_ClousStorageInfo_Description3: String { return self._s[3618]! } + public var Wallet_WordCheck_TryAgain: String { return self._s[3619]! } + public var Wallet_Info_TransactionPendingHeader: String { return self._s[3620]! } + public var Settings_ChatBackground: String { return self._s[3621]! } + public var Channel_Subscribers_Title: String { return self._s[3622]! } + public var Wallet_Receive_InvoiceUrlHeader: String { return self._s[3623]! } + public var ApplyLanguage_ChangeLanguageTitle: String { return self._s[3624]! } + public var Watch_ConnectionDescription: String { return self._s[3625]! } + public var Wallet_Configuration_ApplyErrorTitle: String { return self._s[3628]! } + public var ChatList_ArchivedChatsTitle: String { return self._s[3630]! } + public var Wallpaper_ResetWallpapers: String { return self._s[3631]! } + public var Wallet_Send_TransactionInProgress: String { return self._s[3632]! } + public var EditProfile_Title: String { return self._s[3633]! } + public var NotificationsSound_Bamboo: String { return self._s[3635]! } + public var Channel_AdminLog_MessagePreviousMessage: String { return self._s[3637]! } + public var Login_SmsRequestState2: String { return self._s[3638]! } + public var Passport_Language_ar: String { return self._s[3639]! } public func Message_AuthorPinnedGame(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3637]!, self._r[3637]!, [_0]) + return formatWithArgumentRanges(self._s[3640]!, self._r[3640]!, [_0]) } - public var SettingsSearch_Synonyms_EditProfile_Title: String { return self._s[3638]! } - public var Wallet_Created_Text: String { return self._s[3639]! } - public var Conversation_MessageDialogEdit: String { return self._s[3641]! } - public var Wallet_Created_Proceed: String { return self._s[3642]! } - public var Wallet_Words_Done: String { return self._s[3643]! } - public var VoiceOver_Media_PlaybackPause: String { return self._s[3644]! } + public var SettingsSearch_Synonyms_EditProfile_Title: String { return self._s[3641]! } + public var Wallet_Created_Text: String { return self._s[3642]! } + public var Conversation_MessageDialogEdit: String { return self._s[3644]! } + public var Wallet_Created_Proceed: String { return self._s[3645]! } + public var Wallet_Words_Done: String { return self._s[3646]! } + public var VoiceOver_Media_PlaybackPause: String { return self._s[3647]! } public func PUSH_AUTH_UNKNOWN(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3645]!, self._r[3645]!, [_1]) + return formatWithArgumentRanges(self._s[3648]!, self._r[3648]!, [_1]) } - public var Common_Close: String { return self._s[3646]! } - public var GroupInfo_PublicLink: String { return self._s[3647]! } - public var Channel_OwnershipTransfer_ErrorPrivacyRestricted: String { return self._s[3648]! } - public var SettingsSearch_Synonyms_Notifications_GroupNotificationsPreview: String { return self._s[3649]! } + public var Common_Close: String { return self._s[3649]! } + public var GroupInfo_PublicLink: String { return self._s[3650]! } + public var Channel_OwnershipTransfer_ErrorPrivacyRestricted: String { return self._s[3651]! } + public var SettingsSearch_Synonyms_Notifications_GroupNotificationsPreview: String { return self._s[3652]! } public func Channel_AdminLog_MessageToggleInvitesOff(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3653]!, self._r[3653]!, [_0]) + return formatWithArgumentRanges(self._s[3656]!, self._r[3656]!, [_0]) } - public var UserInfo_About_Placeholder: String { return self._s[3654]! } + public var UserInfo_About_Placeholder: String { return self._s[3657]! } public func Conversation_FileHowToText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3655]!, self._r[3655]!, [_0]) + return formatWithArgumentRanges(self._s[3658]!, self._r[3658]!, [_0]) } - public var GroupInfo_Permissions_SectionTitle: String { return self._s[3656]! } - public var Channel_Info_Banned: String { return self._s[3658]! } + public var GroupInfo_Permissions_SectionTitle: String { return self._s[3659]! } + public var Channel_Info_Banned: String { return self._s[3661]! } public func Time_MonthOfYear_m11(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3659]!, self._r[3659]!, [_0]) + return formatWithArgumentRanges(self._s[3662]!, self._r[3662]!, [_0]) } - public var Appearance_Other: String { return self._s[3660]! } - public var Passport_Language_my: String { return self._s[3661]! } - public var Group_Setup_BasicHistoryHiddenHelp: String { return self._s[3662]! } + public var Appearance_Other: String { return self._s[3663]! } + public var Passport_Language_my: String { return self._s[3664]! } + public var Group_Setup_BasicHistoryHiddenHelp: String { return self._s[3665]! } public func Time_PreciseDate_m9(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3663]!, self._r[3663]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3666]!, self._r[3666]!, [_1, _2, _3]) } - public var SettingsSearch_Synonyms_Privacy_PasscodeAndFaceId: String { return self._s[3664]! } - public var Preview_CopyAddress: String { return self._s[3665]! } + public var SettingsSearch_Synonyms_Privacy_PasscodeAndFaceId: String { return self._s[3667]! } + public var Preview_CopyAddress: String { return self._s[3668]! } public func DialogList_SinglePlayingGameSuffix(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3666]!, self._r[3666]!, [_0]) + return formatWithArgumentRanges(self._s[3669]!, self._r[3669]!, [_0]) } - public var KeyCommand_JumpToPreviousChat: String { return self._s[3667]! } - public var UserInfo_BotSettings: String { return self._s[3668]! } - public var LiveLocation_MenuStopAll: String { return self._s[3670]! } - public var Passport_PasswordCreate: String { return self._s[3671]! } - public var StickerSettings_MaskContextInfo: String { return self._s[3672]! } - public var Message_PinnedLocationMessage: String { return self._s[3673]! } - public var Map_Satellite: String { return self._s[3674]! } - public var Watch_Message_Unsupported: String { return self._s[3675]! } - public var Username_TooManyPublicUsernamesError: String { return self._s[3676]! } - public var TwoStepAuth_EnterPasswordInvalid: String { return self._s[3677]! } + public var KeyCommand_JumpToPreviousChat: String { return self._s[3670]! } + public var UserInfo_BotSettings: String { return self._s[3671]! } + public var LiveLocation_MenuStopAll: String { return self._s[3673]! } + public var Passport_PasswordCreate: String { return self._s[3674]! } + public var StickerSettings_MaskContextInfo: String { return self._s[3675]! } + public var Message_PinnedLocationMessage: String { return self._s[3676]! } + public var Map_Satellite: String { return self._s[3677]! } + public var Watch_Message_Unsupported: String { return self._s[3678]! } + public var Username_TooManyPublicUsernamesError: String { return self._s[3679]! } + public var TwoStepAuth_EnterPasswordInvalid: String { return self._s[3680]! } public func Notification_PinnedTextMessage(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3678]!, self._r[3678]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3681]!, self._r[3681]!, [_0, _1]) } public func Conversation_OpenBotLinkText(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3679]!, self._r[3679]!, [_0]) + return formatWithArgumentRanges(self._s[3682]!, self._r[3682]!, [_0]) } - public var Wallet_WordImport_Continue: String { return self._s[3680]! } + public var Wallet_WordImport_Continue: String { return self._s[3683]! } public func TwoFactorSetup_EmailVerification_Text(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3681]!, self._r[3681]!, [_0]) + return formatWithArgumentRanges(self._s[3684]!, self._r[3684]!, [_0]) } - public var Notifications_ChannelNotificationsHelp: String { return self._s[3682]! } - public var Privacy_Calls_P2PContacts: String { return self._s[3683]! } - public var NotificationsSound_None: String { return self._s[3684]! } - public var Wallet_TransactionInfo_StorageFeeHeader: String { return self._s[3685]! } - public var Channel_DiscussionGroup_UnlinkGroup: String { return self._s[3687]! } - public var AccessDenied_VoiceMicrophone: String { return self._s[3688]! } + public var Notifications_ChannelNotificationsHelp: String { return self._s[3685]! } + public var Privacy_Calls_P2PContacts: String { return self._s[3686]! } + public var NotificationsSound_None: String { return self._s[3687]! } + public var Wallet_TransactionInfo_StorageFeeHeader: String { return self._s[3688]! } + public var Channel_DiscussionGroup_UnlinkGroup: String { return self._s[3690]! } + public var AccessDenied_VoiceMicrophone: String { return self._s[3691]! } public func ApplyLanguage_ChangeLanguageAlreadyActive(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3689]!, self._r[3689]!, [_1]) + return formatWithArgumentRanges(self._s[3692]!, self._r[3692]!, [_1]) } - public var Cache_Indexing: String { return self._s[3690]! } - public var DialogList_RecentTitlePeople: String { return self._s[3692]! } - public var DialogList_EncryptionRejected: String { return self._s[3693]! } - public var GroupInfo_Administrators: String { return self._s[3694]! } - public var Passport_ScanPassportHelp: String { return self._s[3695]! } - public var Application_Name: String { return self._s[3696]! } - public var Channel_AdminLogFilter_ChannelEventsInfo: String { return self._s[3697]! } - public var Appearance_ThemeCarouselDay: String { return self._s[3699]! } - public var Passport_Identity_TranslationHelp: String { return self._s[3700]! } + public var Cache_Indexing: String { return self._s[3693]! } + public var DialogList_RecentTitlePeople: String { return self._s[3695]! } + public var DialogList_EncryptionRejected: String { return self._s[3696]! } + public var GroupInfo_Administrators: String { return self._s[3697]! } + public var Passport_ScanPassportHelp: String { return self._s[3698]! } + public var Application_Name: String { return self._s[3699]! } + public var Channel_AdminLogFilter_ChannelEventsInfo: String { return self._s[3700]! } + public var Appearance_ThemeCarouselDay: String { return self._s[3702]! } + public var Passport_Identity_TranslationHelp: String { return self._s[3703]! } public func VoiceOver_Chat_VideoMessageFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3701]!, self._r[3701]!, [_0]) + return formatWithArgumentRanges(self._s[3704]!, self._r[3704]!, [_0]) } public func Notification_JoinedGroupByLink(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3702]!, self._r[3702]!, [_0]) + return formatWithArgumentRanges(self._s[3705]!, self._r[3705]!, [_0]) } public func DialogList_EncryptedChatStartedOutgoing(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3703]!, self._r[3703]!, [_0]) + return formatWithArgumentRanges(self._s[3706]!, self._r[3706]!, [_0]) } - public var Channel_EditAdmin_PermissionDeleteMessages: String { return self._s[3704]! } - public var Privacy_ChatsTitle: String { return self._s[3705]! } - public var DialogList_ClearHistoryConfirmation: String { return self._s[3706]! } - public var SettingsSearch_Synonyms_Data_Storage_ClearCache: String { return self._s[3707]! } - public var Watch_Suggestion_HoldOn: String { return self._s[3708]! } - public var Group_EditAdmin_TransferOwnership: String { return self._s[3709]! } - public var WebBrowser_Title: String { return self._s[3710]! } - public var Group_LinkedChannel: String { return self._s[3711]! } - public var VoiceOver_Chat_SeenByRecipient: String { return self._s[3712]! } - public var SocksProxySetup_RequiredCredentials: String { return self._s[3713]! } - public var Passport_Address_TypeRentalAgreementUploadScan: String { return self._s[3714]! } - public var TwoStepAuth_EmailSkipAlert: String { return self._s[3715]! } - public var ScheduledMessages_RemindersTitle: String { return self._s[3717]! } - public var Channel_Setup_TypePublic: String { return self._s[3719]! } + public var Channel_EditAdmin_PermissionDeleteMessages: String { return self._s[3707]! } + public var Privacy_ChatsTitle: String { return self._s[3708]! } + public var DialogList_ClearHistoryConfirmation: String { return self._s[3709]! } + public var SettingsSearch_Synonyms_Data_Storage_ClearCache: String { return self._s[3710]! } + public var Watch_Suggestion_HoldOn: String { return self._s[3711]! } + public var Group_EditAdmin_TransferOwnership: String { return self._s[3712]! } + public var WebBrowser_Title: String { return self._s[3713]! } + public var Group_LinkedChannel: String { return self._s[3714]! } + public var VoiceOver_Chat_SeenByRecipient: String { return self._s[3715]! } + public var SocksProxySetup_RequiredCredentials: String { return self._s[3716]! } + public var Passport_Address_TypeRentalAgreementUploadScan: String { return self._s[3717]! } + public var Appearance_TextSize_UseSystem: String { return self._s[3718]! } + public var TwoStepAuth_EmailSkipAlert: String { return self._s[3719]! } + public var ScheduledMessages_RemindersTitle: String { return self._s[3721]! } + public var Channel_Setup_TypePublic: String { return self._s[3723]! } public func Channel_AdminLog_MessageToggleInvitesOn(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3720]!, self._r[3720]!, [_0]) + return formatWithArgumentRanges(self._s[3724]!, self._r[3724]!, [_0]) } - public var Channel_TypeSetup_Title: String { return self._s[3722]! } - public var Map_OpenInMaps: String { return self._s[3724]! } + public var Channel_TypeSetup_Title: String { return self._s[3726]! } + public var Map_OpenInMaps: String { return self._s[3728]! } public func PUSH_PINNED_NOTEXT(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3725]!, self._r[3725]!, [_1]) + return formatWithArgumentRanges(self._s[3729]!, self._r[3729]!, [_1]) } - public var NotificationsSound_Tremolo: String { return self._s[3727]! } + public var NotificationsSound_Tremolo: String { return self._s[3731]! } public func Date_ChatDateHeaderYear(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3728]!, self._r[3728]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3732]!, self._r[3732]!, [_1, _2, _3]) } - public var ConversationProfile_UnknownAddMemberError: String { return self._s[3729]! } - public var Channel_OwnershipTransfer_PasswordPlaceholder: String { return self._s[3730]! } - public var Passport_PasswordHelp: String { return self._s[3731]! } - public var Login_CodeExpiredError: String { return self._s[3732]! } - public var Channel_EditAdmin_PermissionChangeInfo: String { return self._s[3733]! } - public var Conversation_TitleUnmute: String { return self._s[3734]! } - public var Passport_Identity_ScansHelp: String { return self._s[3735]! } - public var Passport_Language_lo: String { return self._s[3736]! } - public var Camera_FlashAuto: String { return self._s[3737]! } - public var Conversation_OpenBotLinkOpen: String { return self._s[3738]! } - public var Common_Cancel: String { return self._s[3739]! } - public var DialogList_SavedMessagesTooltip: String { return self._s[3740]! } - public var TwoStepAuth_SetupPasswordTitle: String { return self._s[3741]! } - public var Appearance_TintAllColors: String { return self._s[3742]! } + public var ConversationProfile_UnknownAddMemberError: String { return self._s[3733]! } + public var Channel_OwnershipTransfer_PasswordPlaceholder: String { return self._s[3734]! } + public var Passport_PasswordHelp: String { return self._s[3735]! } + public var Login_CodeExpiredError: String { return self._s[3736]! } + public var Channel_EditAdmin_PermissionChangeInfo: String { return self._s[3737]! } + public var Conversation_TitleUnmute: String { return self._s[3738]! } + public var Passport_Identity_ScansHelp: String { return self._s[3739]! } + public var Passport_Language_lo: String { return self._s[3740]! } + public var Camera_FlashAuto: String { return self._s[3741]! } + public var Conversation_OpenBotLinkOpen: String { return self._s[3742]! } + public var Common_Cancel: String { return self._s[3743]! } + public var DialogList_SavedMessagesTooltip: String { return self._s[3744]! } + public var TwoStepAuth_SetupPasswordTitle: String { return self._s[3745]! } + public var Appearance_TintAllColors: String { return self._s[3746]! } public func PUSH_MESSAGE_FWD(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3743]!, self._r[3743]!, [_1]) + return formatWithArgumentRanges(self._s[3747]!, self._r[3747]!, [_1]) } - public var Conversation_ReportSpamConfirmation: String { return self._s[3744]! } - public var ChatSettings_Title: String { return self._s[3746]! } - public var Passport_PasswordReset: String { return self._s[3747]! } - public var SocksProxySetup_TypeNone: String { return self._s[3748]! } - public var EditTheme_Title: String { return self._s[3750]! } - public var PhoneNumberHelp_Help: String { return self._s[3751]! } - public var Checkout_EnterPassword: String { return self._s[3752]! } - public var Share_AuthTitle: String { return self._s[3754]! } - public var Activity_UploadingDocument: String { return self._s[3755]! } - public var State_Connecting: String { return self._s[3756]! } - public var Profile_MessageLifetime1w: String { return self._s[3757]! } - public var Conversation_ContextMenuReport: String { return self._s[3758]! } - public var CheckoutInfo_ReceiverInfoPhone: String { return self._s[3759]! } - public var AutoNightTheme_ScheduledTo: String { return self._s[3760]! } + public var Conversation_ReportSpamConfirmation: String { return self._s[3748]! } + public var ChatSettings_Title: String { return self._s[3750]! } + public var Passport_PasswordReset: String { return self._s[3751]! } + public var SocksProxySetup_TypeNone: String { return self._s[3752]! } + public var EditTheme_Title: String { return self._s[3754]! } + public var PhoneNumberHelp_Help: String { return self._s[3755]! } + public var Checkout_EnterPassword: String { return self._s[3756]! } + public var Share_AuthTitle: String { return self._s[3758]! } + public var Activity_UploadingDocument: String { return self._s[3759]! } + public var State_Connecting: String { return self._s[3760]! } + public var Profile_MessageLifetime1w: String { return self._s[3761]! } + public var Conversation_ContextMenuReport: String { return self._s[3762]! } + public var CheckoutInfo_ReceiverInfoPhone: String { return self._s[3763]! } + public var AutoNightTheme_ScheduledTo: String { return self._s[3764]! } public func VoiceOver_Chat_AnonymousPollFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3761]!, self._r[3761]!, [_0]) + return formatWithArgumentRanges(self._s[3765]!, self._r[3765]!, [_0]) } - public var AuthSessions_Terminate: String { return self._s[3762]! } - public var Wallet_WordImport_CanNotRemember: String { return self._s[3763]! } - public var Checkout_NewCard_CardholderNamePlaceholder: String { return self._s[3765]! } - public var KeyCommand_JumpToPreviousUnreadChat: String { return self._s[3766]! } - public var PhotoEditor_Set: String { return self._s[3767]! } - public var EmptyGroupInfo_Title: String { return self._s[3768]! } - public var Login_PadPhoneHelp: String { return self._s[3769]! } - public var AutoDownloadSettings_TypeGroupChats: String { return self._s[3771]! } - public var PrivacyPolicy_DeclineLastWarning: String { return self._s[3773]! } - public var NotificationsSound_Complete: String { return self._s[3774]! } - public var SettingsSearch_Synonyms_Privacy_Data_Title: String { return self._s[3775]! } - public var Group_Info_AdminLog: String { return self._s[3776]! } - public var GroupPermission_NotAvailableInPublicGroups: String { return self._s[3777]! } + public var AuthSessions_Terminate: String { return self._s[3766]! } + public var Wallet_WordImport_CanNotRemember: String { return self._s[3767]! } + public var Checkout_NewCard_CardholderNamePlaceholder: String { return self._s[3769]! } + public var KeyCommand_JumpToPreviousUnreadChat: String { return self._s[3770]! } + public var PhotoEditor_Set: String { return self._s[3771]! } + public var EmptyGroupInfo_Title: String { return self._s[3772]! } + public var Login_PadPhoneHelp: String { return self._s[3773]! } + public var AutoDownloadSettings_TypeGroupChats: String { return self._s[3775]! } + public var PrivacyPolicy_DeclineLastWarning: String { return self._s[3777]! } + public var NotificationsSound_Complete: String { return self._s[3778]! } + public var SettingsSearch_Synonyms_Privacy_Data_Title: String { return self._s[3779]! } + public var Group_Info_AdminLog: String { return self._s[3780]! } + public var GroupPermission_NotAvailableInPublicGroups: String { return self._s[3781]! } public func Wallet_Time_PreciseDate_m11(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3778]!, self._r[3778]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3782]!, self._r[3782]!, [_1, _2, _3]) } - public var Channel_AdminLog_InfoPanelAlertText: String { return self._s[3779]! } - public var Group_Location_CreateInThisPlace: String { return self._s[3781]! } - public var Conversation_Admin: String { return self._s[3782]! } - public var Conversation_GifTooltip: String { return self._s[3783]! } - public var Passport_NotLoggedInMessage: String { return self._s[3784]! } + public var Channel_AdminLog_InfoPanelAlertText: String { return self._s[3783]! } + public var Group_Location_CreateInThisPlace: String { return self._s[3785]! } + public var Conversation_Admin: String { return self._s[3786]! } + public var Conversation_GifTooltip: String { return self._s[3787]! } + public var Passport_NotLoggedInMessage: String { return self._s[3788]! } public func AutoDownloadSettings_OnFor(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3786]!, self._r[3786]!, [_0]) + return formatWithArgumentRanges(self._s[3790]!, self._r[3790]!, [_0]) } - public var Profile_MessageLifetimeForever: String { return self._s[3787]! } - public var SharedMedia_EmptyTitle: String { return self._s[3789]! } - public var Channel_Edit_PrivatePublicLinkAlert: String { return self._s[3791]! } - public var Username_Help: String { return self._s[3792]! } - public var DialogList_LanguageTooltip: String { return self._s[3794]! } - public var Map_LoadError: String { return self._s[3795]! } - public var Login_PhoneNumberAlreadyAuthorized: String { return self._s[3796]! } - public var Channel_AdminLog_AddMembers: String { return self._s[3797]! } - public var ArchivedChats_IntroTitle2: String { return self._s[3798]! } - public var Notification_Exceptions_NewException: String { return self._s[3799]! } - public var TwoStepAuth_EmailTitle: String { return self._s[3800]! } - public var WatchRemote_AlertText: String { return self._s[3801]! } + public var Profile_MessageLifetimeForever: String { return self._s[3791]! } + public var SharedMedia_EmptyTitle: String { return self._s[3793]! } + public var Channel_Edit_PrivatePublicLinkAlert: String { return self._s[3795]! } + public var Username_Help: String { return self._s[3796]! } + public var DialogList_LanguageTooltip: String { return self._s[3798]! } + public var Map_LoadError: String { return self._s[3799]! } + public var Login_PhoneNumberAlreadyAuthorized: String { return self._s[3800]! } + public var Channel_AdminLog_AddMembers: String { return self._s[3801]! } + public var ArchivedChats_IntroTitle2: String { return self._s[3802]! } + public var Notification_Exceptions_NewException: String { return self._s[3803]! } + public var TwoStepAuth_EmailTitle: String { return self._s[3804]! } + public var WatchRemote_AlertText: String { return self._s[3805]! } public func Wallet_Send_ConfirmationText(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3802]!, self._r[3802]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3806]!, self._r[3806]!, [_1, _2, _3]) } - public var ChatSettings_ConnectionType_Title: String { return self._s[3806]! } - public var WebBrowser_DefaultBrowser: String { return self._s[3807]! } + public var ChatSettings_ConnectionType_Title: String { return self._s[3810]! } + public var WebBrowser_DefaultBrowser: String { return self._s[3811]! } public func Settings_CheckPhoneNumberTitle(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3808]!, self._r[3808]!, [_0]) + return formatWithArgumentRanges(self._s[3812]!, self._r[3812]!, [_0]) } - public var SettingsSearch_Synonyms_Calls_CallTab: String { return self._s[3809]! } - public var Passport_Address_CountryPlaceholder: String { return self._s[3810]! } + public var SettingsSearch_Synonyms_Calls_CallTab: String { return self._s[3813]! } + public var Passport_Address_CountryPlaceholder: String { return self._s[3814]! } public func DialogList_AwaitingEncryption(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3811]!, self._r[3811]!, [_0]) + return formatWithArgumentRanges(self._s[3815]!, self._r[3815]!, [_0]) } public func Time_PreciseDate_m6(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3812]!, self._r[3812]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3816]!, self._r[3816]!, [_1, _2, _3]) } - public var Group_AdminLog_EmptyText: String { return self._s[3813]! } - public var SettingsSearch_Synonyms_Appearance_Title: String { return self._s[3814]! } - public var Conversation_PrivateChannelTooltip: String { return self._s[3816]! } - public var Wallet_Created_ExportErrorText: String { return self._s[3817]! } - public var ChatList_UndoArchiveText1: String { return self._s[3818]! } - public var AccessDenied_VideoMicrophone: String { return self._s[3819]! } - public var Conversation_ContextMenuStickerPackAdd: String { return self._s[3820]! } - public var Cache_ClearNone: String { return self._s[3821]! } - public var SocksProxySetup_FailedToConnect: String { return self._s[3822]! } - public var Permissions_NotificationsTitle_v0: String { return self._s[3823]! } + public var Group_AdminLog_EmptyText: String { return self._s[3817]! } + public var SettingsSearch_Synonyms_Appearance_Title: String { return self._s[3818]! } + public var Conversation_PrivateChannelTooltip: String { return self._s[3820]! } + public var Wallet_Created_ExportErrorText: String { return self._s[3821]! } + public var ChatList_UndoArchiveText1: String { return self._s[3822]! } + public var AccessDenied_VideoMicrophone: String { return self._s[3823]! } + public var Conversation_ContextMenuStickerPackAdd: String { return self._s[3824]! } + public var Cache_ClearNone: String { return self._s[3825]! } + public var SocksProxySetup_FailedToConnect: String { return self._s[3826]! } + public var Permissions_NotificationsTitle_v0: String { return self._s[3827]! } public func Channel_AdminLog_MessageEdited(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3824]!, self._r[3824]!, [_0]) + return formatWithArgumentRanges(self._s[3828]!, self._r[3828]!, [_0]) } - public var Passport_Identity_Country: String { return self._s[3825]! } + public var Passport_Identity_Country: String { return self._s[3829]! } public func ChatSettings_AutoDownloadSettings_TypeFile(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3826]!, self._r[3826]!, [_0]) + return formatWithArgumentRanges(self._s[3830]!, self._r[3830]!, [_0]) } public func Notification_CreatedChat(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3827]!, self._r[3827]!, [_0]) + return formatWithArgumentRanges(self._s[3831]!, self._r[3831]!, [_0]) } - public var Exceptions_AddToExceptions: String { return self._s[3828]! } - public var AccessDenied_Settings: String { return self._s[3829]! } - public var Passport_Address_TypeUtilityBillUploadScan: String { return self._s[3830]! } - public var Month_ShortMay: String { return self._s[3831]! } - public var Compose_NewGroup: String { return self._s[3833]! } - public var Group_Setup_TypePrivate: String { return self._s[3835]! } - public var Login_PadPhoneHelpTitle: String { return self._s[3837]! } - public var Appearance_ThemeDayClassic: String { return self._s[3838]! } - public var Channel_AdminLog_MessagePreviousCaption: String { return self._s[3839]! } - public var AutoDownloadSettings_OffForAll: String { return self._s[3840]! } - public var Privacy_GroupsAndChannels_WhoCanAddMe: String { return self._s[3841]! } - public var Conversation_typing: String { return self._s[3843]! } - public var Undo_ScheduledMessagesCleared: String { return self._s[3844]! } - public var Paint_Masks: String { return self._s[3845]! } - public var Contacts_DeselectAll: String { return self._s[3846]! } + public var Exceptions_AddToExceptions: String { return self._s[3832]! } + public var AccessDenied_Settings: String { return self._s[3833]! } + public var Passport_Address_TypeUtilityBillUploadScan: String { return self._s[3834]! } + public var Month_ShortMay: String { return self._s[3835]! } + public var Compose_NewGroup: String { return self._s[3837]! } + public var Group_Setup_TypePrivate: String { return self._s[3839]! } + public var Login_PadPhoneHelpTitle: String { return self._s[3841]! } + public var Appearance_ThemeDayClassic: String { return self._s[3842]! } + public var Channel_AdminLog_MessagePreviousCaption: String { return self._s[3843]! } + public var AutoDownloadSettings_OffForAll: String { return self._s[3844]! } + public var Privacy_GroupsAndChannels_WhoCanAddMe: String { return self._s[3845]! } + public var Conversation_typing: String { return self._s[3847]! } + public var Undo_ScheduledMessagesCleared: String { return self._s[3848]! } + public var Paint_Masks: String { return self._s[3849]! } + public var Contacts_DeselectAll: String { return self._s[3850]! } public func Wallet_Updated_YesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3847]!, self._r[3847]!, [_0]) + return formatWithArgumentRanges(self._s[3851]!, self._r[3851]!, [_0]) } - public var Username_InvalidTaken: String { return self._s[3848]! } - public var Call_StatusNoAnswer: String { return self._s[3849]! } - public var TwoStepAuth_EmailAddSuccess: String { return self._s[3850]! } - public var SettingsSearch_Synonyms_Privacy_BlockedUsers: String { return self._s[3851]! } - public var Passport_Identity_Selfie: String { return self._s[3852]! } - public var Login_InfoLastNamePlaceholder: String { return self._s[3853]! } - public var Privacy_SecretChatsLinkPreviewsHelp: String { return self._s[3854]! } - public var Conversation_ClearSecretHistory: String { return self._s[3855]! } - public var PeopleNearby_Description: String { return self._s[3857]! } - public var NetworkUsageSettings_Title: String { return self._s[3858]! } - public var Your_cards_security_code_is_invalid: String { return self._s[3860]! } + public var Username_InvalidTaken: String { return self._s[3852]! } + public var Call_StatusNoAnswer: String { return self._s[3853]! } + public var TwoStepAuth_EmailAddSuccess: String { return self._s[3854]! } + public var SettingsSearch_Synonyms_Privacy_BlockedUsers: String { return self._s[3855]! } + public var Passport_Identity_Selfie: String { return self._s[3856]! } + public var Login_InfoLastNamePlaceholder: String { return self._s[3857]! } + public var Privacy_SecretChatsLinkPreviewsHelp: String { return self._s[3858]! } + public var Conversation_ClearSecretHistory: String { return self._s[3859]! } + public var PeopleNearby_Description: String { return self._s[3861]! } + public var NetworkUsageSettings_Title: String { return self._s[3862]! } + public var Your_cards_security_code_is_invalid: String { return self._s[3864]! } public func Notification_LeftChannel(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3862]!, self._r[3862]!, [_0]) + return formatWithArgumentRanges(self._s[3866]!, self._r[3866]!, [_0]) } public func Call_CallInProgressMessage(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3863]!, self._r[3863]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3867]!, self._r[3867]!, [_1, _2]) } - public var SaveIncomingPhotosSettings_From: String { return self._s[3865]! } - public var VoiceOver_Navigation_Search: String { return self._s[3866]! } - public var Map_LiveLocationTitle: String { return self._s[3867]! } - public var Login_InfoAvatarAdd: String { return self._s[3868]! } - public var Passport_Identity_FilesView: String { return self._s[3869]! } - public var UserInfo_GenericPhoneLabel: String { return self._s[3870]! } - public var Privacy_Calls_NeverAllow: String { return self._s[3871]! } - public var VoiceOver_Chat_File: String { return self._s[3872]! } - public var Wallet_Settings_DeleteWalletInfo: String { return self._s[3873]! } + public var SaveIncomingPhotosSettings_From: String { return self._s[3869]! } + public var VoiceOver_Navigation_Search: String { return self._s[3870]! } + public var Map_LiveLocationTitle: String { return self._s[3871]! } + public var Login_InfoAvatarAdd: String { return self._s[3872]! } + public var Passport_Identity_FilesView: String { return self._s[3873]! } + public var UserInfo_GenericPhoneLabel: String { return self._s[3874]! } + public var Privacy_Calls_NeverAllow: String { return self._s[3875]! } + public var VoiceOver_Chat_File: String { return self._s[3876]! } + public var Wallet_Settings_DeleteWalletInfo: String { return self._s[3877]! } public func Contacts_AddPhoneNumber(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3874]!, self._r[3874]!, [_0]) + return formatWithArgumentRanges(self._s[3878]!, self._r[3878]!, [_0]) } - public var ContactInfo_PhoneNumberHidden: String { return self._s[3875]! } - public var TwoStepAuth_ConfirmationText: String { return self._s[3876]! } - public var ChatSettings_AutomaticVideoMessageDownload: String { return self._s[3877]! } + public var ContactInfo_PhoneNumberHidden: String { return self._s[3879]! } + public var TwoStepAuth_ConfirmationText: String { return self._s[3880]! } + public var ChatSettings_AutomaticVideoMessageDownload: String { return self._s[3881]! } public func PUSH_CHAT_MESSAGE_VIDEOS(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3878]!, self._r[3878]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3882]!, self._r[3882]!, [_1, _2, _3]) } - public var Channel_AdminLogFilter_AdminsAll: String { return self._s[3879]! } - public var Wallet_Intro_CreateErrorText: String { return self._s[3880]! } - public var Tour_Title2: String { return self._s[3881]! } - public var Wallet_Sent_ViewWallet: String { return self._s[3882]! } - public var Conversation_FileOpenIn: String { return self._s[3883]! } - public var Checkout_ErrorPrecheckoutFailed: String { return self._s[3884]! } - public var Wallet_Send_ErrorInvalidAddress: String { return self._s[3885]! } - public var Wallpaper_Set: String { return self._s[3886]! } - public var Passport_Identity_Translations: String { return self._s[3888]! } + public var Channel_AdminLogFilter_AdminsAll: String { return self._s[3883]! } + public var Wallet_Intro_CreateErrorText: String { return self._s[3884]! } + public var Tour_Title2: String { return self._s[3885]! } + public var Wallet_Sent_ViewWallet: String { return self._s[3886]! } + public var Conversation_FileOpenIn: String { return self._s[3887]! } + public var Checkout_ErrorPrecheckoutFailed: String { return self._s[3888]! } + public var Wallet_Send_ErrorInvalidAddress: String { return self._s[3889]! } + public var Wallpaper_Set: String { return self._s[3890]! } + public var Passport_Identity_Translations: String { return self._s[3892]! } public func Channel_AdminLog_MessageChangedChannelAbout(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3889]!, self._r[3889]!, [_0]) + return formatWithArgumentRanges(self._s[3893]!, self._r[3893]!, [_0]) } - public var Channel_LeaveChannel: String { return self._s[3890]! } + public var Channel_LeaveChannel: String { return self._s[3894]! } public func PINNED_INVOICE(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3891]!, self._r[3891]!, [_1]) + return formatWithArgumentRanges(self._s[3895]!, self._r[3895]!, [_1]) } - public var SettingsSearch_Synonyms_Proxy_AddProxy: String { return self._s[3893]! } - public var PhotoEditor_HighlightsTint: String { return self._s[3894]! } - public var Passport_Email_Delete: String { return self._s[3895]! } - public var Conversation_Mute: String { return self._s[3897]! } - public var Channel_AddBotAsAdmin: String { return self._s[3898]! } - public var Channel_AdminLog_CanSendMessages: String { return self._s[3900]! } - public var Wallet_Configuration_BlockchainNameChangedText: String { return self._s[3901]! } - public var Channel_Management_LabelOwner: String { return self._s[3903]! } + public var SettingsSearch_Synonyms_Proxy_AddProxy: String { return self._s[3897]! } + public var PhotoEditor_HighlightsTint: String { return self._s[3898]! } + public var Passport_Email_Delete: String { return self._s[3899]! } + public var Conversation_Mute: String { return self._s[3901]! } + public var Channel_AddBotAsAdmin: String { return self._s[3902]! } + public var Channel_AdminLog_CanSendMessages: String { return self._s[3904]! } + public var Wallet_Configuration_BlockchainNameChangedText: String { return self._s[3905]! } + public var Channel_Management_LabelOwner: String { return self._s[3907]! } public func Notification_PassportValuesSentMessage(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3904]!, self._r[3904]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3908]!, self._r[3908]!, [_1, _2]) } - public var Calls_CallTabDescription: String { return self._s[3905]! } - public var Passport_Identity_NativeNameHelp: String { return self._s[3906]! } - public var Common_No: String { return self._s[3907]! } - public var Weekday_Sunday: String { return self._s[3908]! } - public var Notification_Reply: String { return self._s[3909]! } - public var Conversation_ViewMessage: String { return self._s[3910]! } + public var Calls_CallTabDescription: String { return self._s[3909]! } + public var Passport_Identity_NativeNameHelp: String { return self._s[3910]! } + public var Common_No: String { return self._s[3911]! } + public var Weekday_Sunday: String { return self._s[3912]! } + public var Notification_Reply: String { return self._s[3913]! } + public var Conversation_ViewMessage: String { return self._s[3914]! } public func Checkout_SavePasswordTimeoutAndFaceId(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3911]!, self._r[3911]!, [_0]) + return formatWithArgumentRanges(self._s[3915]!, self._r[3915]!, [_0]) } public func Map_LiveLocationPrivateDescription(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3912]!, self._r[3912]!, [_0]) + return formatWithArgumentRanges(self._s[3916]!, self._r[3916]!, [_0]) } public func Wallet_Time_PreciseDate_m7(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3913]!, self._r[3913]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3917]!, self._r[3917]!, [_1, _2, _3]) } - public var SettingsSearch_Synonyms_EditProfile_AddAccount: String { return self._s[3914]! } - public var Wallet_Send_Title: String { return self._s[3915]! } - public var Message_PinnedDocumentMessage: String { return self._s[3916]! } - public var Wallet_Info_RefreshErrorText: String { return self._s[3917]! } - public var DialogList_TabTitle: String { return self._s[3919]! } - public var ChatSettings_AutoPlayTitle: String { return self._s[3920]! } - public var Passport_FieldEmail: String { return self._s[3921]! } - public var Conversation_UnpinMessageAlert: String { return self._s[3922]! } - public var Passport_Address_TypeBankStatement: String { return self._s[3923]! } - public var Wallet_SecureStorageReset_Title: String { return self._s[3924]! } - public var Passport_Identity_ExpiryDate: String { return self._s[3925]! } - public var Privacy_Calls_P2P: String { return self._s[3926]! } + public var SettingsSearch_Synonyms_EditProfile_AddAccount: String { return self._s[3918]! } + public var Wallet_Send_Title: String { return self._s[3919]! } + public var Message_PinnedDocumentMessage: String { return self._s[3920]! } + public var Wallet_Info_RefreshErrorText: String { return self._s[3921]! } + public var DialogList_TabTitle: String { return self._s[3923]! } + public var ChatSettings_AutoPlayTitle: String { return self._s[3924]! } + public var Passport_FieldEmail: String { return self._s[3925]! } + public var Conversation_UnpinMessageAlert: String { return self._s[3926]! } + public var Passport_Address_TypeBankStatement: String { return self._s[3927]! } + public var Wallet_SecureStorageReset_Title: String { return self._s[3928]! } + public var Passport_Identity_ExpiryDate: String { return self._s[3929]! } + public var Privacy_Calls_P2P: String { return self._s[3930]! } public func CancelResetAccount_Success(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3928]!, self._r[3928]!, [_0]) + return formatWithArgumentRanges(self._s[3932]!, self._r[3932]!, [_0]) } - public var SocksProxySetup_UseForCallsHelp: String { return self._s[3929]! } + public var SocksProxySetup_UseForCallsHelp: String { return self._s[3933]! } public func PUSH_CHAT_ALBUM(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3930]!, self._r[3930]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3934]!, self._r[3934]!, [_1, _2]) } - public var Stickers_ClearRecent: String { return self._s[3931]! } - public var EnterPasscode_ChangeTitle: String { return self._s[3932]! } - public var TwoFactorSetup_Email_Title: String { return self._s[3933]! } - public var Passport_InfoText: String { return self._s[3934]! } - public var Checkout_NewCard_SaveInfoEnableHelp: String { return self._s[3935]! } + public var Stickers_ClearRecent: String { return self._s[3935]! } + public var EnterPasscode_ChangeTitle: String { return self._s[3936]! } + public var TwoFactorSetup_Email_Title: String { return self._s[3937]! } + public var Passport_InfoText: String { return self._s[3938]! } + public var Checkout_NewCard_SaveInfoEnableHelp: String { return self._s[3939]! } public func Login_InvalidPhoneEmailSubject(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3936]!, self._r[3936]!, [_0]) + return formatWithArgumentRanges(self._s[3940]!, self._r[3940]!, [_0]) } public func Time_PreciseDate_m3(_ _1: String, _ _2: String, _ _3: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3937]!, self._r[3937]!, [_1, _2, _3]) + return formatWithArgumentRanges(self._s[3941]!, self._r[3941]!, [_1, _2, _3]) } - public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChannels: String { return self._s[3938]! } - public var ScheduledMessages_PollUnavailable: String { return self._s[3939]! } - public var VoiceOver_Navigation_Compose: String { return self._s[3940]! } - public var Passport_Identity_EditDriversLicense: String { return self._s[3941]! } - public var Conversation_TapAndHoldToRecord: String { return self._s[3943]! } - public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChats: String { return self._s[3944]! } + public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChannels: String { return self._s[3942]! } + public var ScheduledMessages_PollUnavailable: String { return self._s[3943]! } + public var VoiceOver_Navigation_Compose: String { return self._s[3944]! } + public var Passport_Identity_EditDriversLicense: String { return self._s[3945]! } + public var Conversation_TapAndHoldToRecord: String { return self._s[3947]! } + public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChats: String { return self._s[3948]! } public func Notification_CallTimeFormat(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3945]!, self._r[3945]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3949]!, self._r[3949]!, [_1, _2]) } - public var Channel_EditAdmin_PermissionInviteViaLink: String { return self._s[3947]! } - public var ChatSettings_OpenLinksIn: String { return self._s[3948]! } + public var Channel_EditAdmin_PermissionInviteViaLink: String { return self._s[3951]! } + public var ChatSettings_OpenLinksIn: String { return self._s[3952]! } public func Generic_OpenHiddenLinkAlert(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3950]!, self._r[3950]!, [_0]) + return formatWithArgumentRanges(self._s[3954]!, self._r[3954]!, [_0]) } - public var DialogList_Unread: String { return self._s[3951]! } + public var DialogList_Unread: String { return self._s[3955]! } public func PUSH_CHAT_MESSAGE_GIF(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3952]!, self._r[3952]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3956]!, self._r[3956]!, [_1, _2]) } - public var User_DeletedAccount: String { return self._s[3953]! } - public var OwnershipTransfer_SetupTwoStepAuth: String { return self._s[3954]! } + public var User_DeletedAccount: String { return self._s[3957]! } + public var OwnershipTransfer_SetupTwoStepAuth: String { return self._s[3958]! } public func Watch_Time_ShortYesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3955]!, self._r[3955]!, [_0]) + return formatWithArgumentRanges(self._s[3959]!, self._r[3959]!, [_0]) } - public var UserInfo_NotificationsDefault: String { return self._s[3956]! } - public var SharedMedia_CategoryMedia: String { return self._s[3957]! } - public var SocksProxySetup_ProxyStatusUnavailable: String { return self._s[3958]! } - public var Channel_AdminLog_MessageRestrictedForever: String { return self._s[3959]! } - public var Watch_ChatList_Compose: String { return self._s[3960]! } - public var Notifications_MessageNotificationsExceptionsHelp: String { return self._s[3961]! } - public var AutoDownloadSettings_Delimeter: String { return self._s[3962]! } - public var Watch_Microphone_Access: String { return self._s[3963]! } - public var Group_Setup_HistoryHeader: String { return self._s[3964]! } - public var Map_SetThisLocation: String { return self._s[3965]! } - public var Appearance_ThemePreview_Chat_2_ReplyName: String { return self._s[3966]! } - public var Activity_UploadingPhoto: String { return self._s[3967]! } - public var Conversation_Edit: String { return self._s[3969]! } - public var Group_ErrorSendRestrictedMedia: String { return self._s[3970]! } - public var Login_TermsOfServiceDecline: String { return self._s[3971]! } - public var Message_PinnedContactMessage: String { return self._s[3972]! } + public var UserInfo_NotificationsDefault: String { return self._s[3960]! } + public var SharedMedia_CategoryMedia: String { return self._s[3961]! } + public var SocksProxySetup_ProxyStatusUnavailable: String { return self._s[3962]! } + public var Channel_AdminLog_MessageRestrictedForever: String { return self._s[3963]! } + public var Watch_ChatList_Compose: String { return self._s[3964]! } + public var Notifications_MessageNotificationsExceptionsHelp: String { return self._s[3965]! } + public var AutoDownloadSettings_Delimeter: String { return self._s[3966]! } + public var Watch_Microphone_Access: String { return self._s[3967]! } + public var Group_Setup_HistoryHeader: String { return self._s[3968]! } + public var Map_SetThisLocation: String { return self._s[3969]! } + public var Appearance_ThemePreview_Chat_2_ReplyName: String { return self._s[3970]! } + public var Activity_UploadingPhoto: String { return self._s[3971]! } + public var Conversation_Edit: String { return self._s[3973]! } + public var Group_ErrorSendRestrictedMedia: String { return self._s[3974]! } + public var Login_TermsOfServiceDecline: String { return self._s[3975]! } + public var Message_PinnedContactMessage: String { return self._s[3976]! } public func Channel_AdminLog_MessageRestrictedNameUsername(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3973]!, self._r[3973]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3977]!, self._r[3977]!, [_1, _2]) } public func Login_PhoneBannedEmailBody(_ _1: String, _ _2: String, _ _3: String, _ _4: String, _ _5: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3974]!, self._r[3974]!, [_1, _2, _3, _4, _5]) + return formatWithArgumentRanges(self._s[3978]!, self._r[3978]!, [_1, _2, _3, _4, _5]) } - public var Appearance_LargeEmoji: String { return self._s[3975]! } - public var TwoStepAuth_AdditionalPassword: String { return self._s[3977]! } - public var EditTheme_Edit_Preview_IncomingReplyText: String { return self._s[3978]! } + public var Appearance_LargeEmoji: String { return self._s[3979]! } + public var TwoStepAuth_AdditionalPassword: String { return self._s[3981]! } + public var EditTheme_Edit_Preview_IncomingReplyText: String { return self._s[3982]! } public func PUSH_CHAT_DELETE_YOU(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3979]!, self._r[3979]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3983]!, self._r[3983]!, [_1, _2]) } - public var Passport_Phone_EnterOtherNumber: String { return self._s[3980]! } - public var Message_PinnedPhotoMessage: String { return self._s[3981]! } - public var Passport_FieldPhone: String { return self._s[3982]! } - public var TwoStepAuth_RecoveryEmailAddDescription: String { return self._s[3983]! } - public var ChatSettings_AutoPlayGifs: String { return self._s[3984]! } - public var InfoPlist_NSCameraUsageDescription: String { return self._s[3986]! } - public var Conversation_Call: String { return self._s[3987]! } - public var Common_TakePhoto: String { return self._s[3989]! } - public var Group_EditAdmin_RankTitle: String { return self._s[3990]! } - public var Wallet_Receive_CommentHeader: String { return self._s[3991]! } - public var Channel_NotificationLoading: String { return self._s[3992]! } + public var Passport_Phone_EnterOtherNumber: String { return self._s[3984]! } + public var Message_PinnedPhotoMessage: String { return self._s[3985]! } + public var Passport_FieldPhone: String { return self._s[3986]! } + public var TwoStepAuth_RecoveryEmailAddDescription: String { return self._s[3987]! } + public var ChatSettings_AutoPlayGifs: String { return self._s[3988]! } + public var InfoPlist_NSCameraUsageDescription: String { return self._s[3990]! } + public var Conversation_Call: String { return self._s[3991]! } + public var Common_TakePhoto: String { return self._s[3993]! } + public var Group_EditAdmin_RankTitle: String { return self._s[3994]! } + public var Wallet_Receive_CommentHeader: String { return self._s[3995]! } + public var Channel_NotificationLoading: String { return self._s[3996]! } public func Notification_Exceptions_Sound(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3993]!, self._r[3993]!, [_0]) - } - public func ScheduledMessages_ScheduledDate(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3994]!, self._r[3994]!, [_0]) - } - public func PUSH_CHANNEL_MESSAGE_VIDEO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3995]!, self._r[3995]!, [_1]) - } - public var Permissions_SiriTitle_v0: String { return self._s[3996]! } - public func VoiceOver_Chat_VoiceMessageFrom(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3997]!, self._r[3997]!, [_0]) } - public func Login_ResetAccountProtected_Text(_ _0: String) -> (String, [(Int, NSRange)]) { + public func ScheduledMessages_ScheduledDate(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3998]!, self._r[3998]!, [_0]) } - public var Channel_MessagePhotoRemoved: String { return self._s[3999]! } - public var Wallet_Info_ReceiveGrams: String { return self._s[4000]! } - public var ClearCache_FreeSpace: String { return self._s[4001]! } - public var Common_edit: String { return self._s[4002]! } - public var PrivacySettings_AuthSessions: String { return self._s[4003]! } - public var Month_ShortJune: String { return self._s[4004]! } - public var PrivacyLastSeenSettings_AlwaysShareWith_Placeholder: String { return self._s[4005]! } - public var Call_ReportSend: String { return self._s[4006]! } - public var Watch_LastSeen_JustNow: String { return self._s[4007]! } - public var Notifications_MessageNotifications: String { return self._s[4008]! } - public var WallpaperSearch_ColorGreen: String { return self._s[4009]! } - public var BroadcastListInfo_AddRecipient: String { return self._s[4011]! } - public var Group_Status: String { return self._s[4012]! } + public func PUSH_CHANNEL_MESSAGE_VIDEO(_ _1: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3999]!, self._r[3999]!, [_1]) + } + public var Permissions_SiriTitle_v0: String { return self._s[4000]! } + public func VoiceOver_Chat_VoiceMessageFrom(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[4001]!, self._r[4001]!, [_0]) + } + public func Login_ResetAccountProtected_Text(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[4002]!, self._r[4002]!, [_0]) + } + public var Channel_MessagePhotoRemoved: String { return self._s[4003]! } + public var Wallet_Info_ReceiveGrams: String { return self._s[4004]! } + public var ClearCache_FreeSpace: String { return self._s[4005]! } + public var Common_edit: String { return self._s[4006]! } + public var PrivacySettings_AuthSessions: String { return self._s[4007]! } + public var Month_ShortJune: String { return self._s[4008]! } + public var PrivacyLastSeenSettings_AlwaysShareWith_Placeholder: String { return self._s[4009]! } + public var Call_ReportSend: String { return self._s[4010]! } + public var Watch_LastSeen_JustNow: String { return self._s[4011]! } + public var Notifications_MessageNotifications: String { return self._s[4012]! } + public var WallpaperSearch_ColorGreen: String { return self._s[4013]! } + public var BroadcastListInfo_AddRecipient: String { return self._s[4015]! } + public var Group_Status: String { return self._s[4016]! } public func AutoNightTheme_LocationHelp(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4013]!, self._r[4013]!, [_0, _1]) + return formatWithArgumentRanges(self._s[4017]!, self._r[4017]!, [_0, _1]) } - public var TextFormat_AddLinkTitle: String { return self._s[4014]! } - public var ShareMenu_ShareTo: String { return self._s[4015]! } - public var Conversation_Moderate_Ban: String { return self._s[4016]! } + public var TextFormat_AddLinkTitle: String { return self._s[4018]! } + public var ShareMenu_ShareTo: String { return self._s[4019]! } + public var Conversation_Moderate_Ban: String { return self._s[4020]! } public func Conversation_DeleteMessagesFor(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4017]!, self._r[4017]!, [_0]) + return formatWithArgumentRanges(self._s[4021]!, self._r[4021]!, [_0]) } - public var SharedMedia_ViewInChat: String { return self._s[4018]! } - public var Map_LiveLocationFor8Hours: String { return self._s[4019]! } + public var SharedMedia_ViewInChat: String { return self._s[4022]! } + public var Map_LiveLocationFor8Hours: String { return self._s[4023]! } public func PUSH_PINNED_PHOTO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4020]!, self._r[4020]!, [_1]) + return formatWithArgumentRanges(self._s[4024]!, self._r[4024]!, [_1]) } public func PUSH_PINNED_POLL(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4021]!, self._r[4021]!, [_1, _2]) + return formatWithArgumentRanges(self._s[4025]!, self._r[4025]!, [_1, _2]) } public func Map_AccurateTo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4023]!, self._r[4023]!, [_0]) + return formatWithArgumentRanges(self._s[4027]!, self._r[4027]!, [_0]) } - public var Map_OpenInHereMaps: String { return self._s[4024]! } - public var Appearance_ReduceMotion: String { return self._s[4025]! } + public var Map_OpenInHereMaps: String { return self._s[4028]! } + public var Appearance_ReduceMotion: String { return self._s[4029]! } public func PUSH_MESSAGE_TEXT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[4026]!, self._r[4026]!, [_1, _2]) + return formatWithArgumentRanges(self._s[4030]!, self._r[4030]!, [_1, _2]) } - public var Channel_Setup_TypePublicHelp: String { return self._s[4027]! } - public var Passport_Identity_EditInternalPassport: String { return self._s[4028]! } - public var PhotoEditor_Skip: String { return self._s[4029]! } - public func VoiceOver_Chat_PollOptionCount(_ value: Int32) -> String { + public var Channel_Setup_TypePublicHelp: String { return self._s[4031]! } + public var Passport_Identity_EditInternalPassport: String { return self._s[4032]! } + public var PhotoEditor_Skip: String { return self._s[4033]! } + public func Wallet_Updated_HoursAgo(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[0 * 6 + Int(form.rawValue)]!, stringValue) } - public func ForwardedFiles(_ value: Int32) -> String { + public func Wallet_Updated_MinutesAgo(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[1 * 6 + Int(form.rawValue)]!, stringValue) } - public func LiveLocation_MenuChatsCount(_ value: Int32) -> String { + public func ForwardedFiles(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[2 * 6 + Int(form.rawValue)]!, stringValue) } - public func LastSeen_HoursAgo(_ value: Int32) -> String { + public func Media_ShareItem(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[3 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[4 * 6 + Int(form.rawValue)]!, _1, _2) + public func InviteText_ContactsCountText(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[4 * 6 + Int(form.rawValue)]!, stringValue) } - public func AttachmentMenu_SendVideo(_ value: Int32) -> String { + public func MessageTimer_ShortWeeks(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[5 * 6 + Int(form.rawValue)]!, stringValue) } - public func MessageTimer_Days(_ value: Int32) -> String { + public func Theme_UsersCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[6 * 6 + Int(form.rawValue)]!, stringValue) } - public func AttachmentMenu_SendGif(_ value: Int32) -> String { + public func Watch_UserInfo_Mute(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[7 * 6 + Int(form.rawValue)]!, stringValue) } - public func Call_Minutes(_ value: Int32) -> String { + public func ForwardedGifs(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[8 * 6 + Int(form.rawValue)]!, stringValue) } - public func Notifications_ExceptionMuteExpires_Days(_ value: Int32) -> String { + public func ChatList_DeleteConfirmation(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[9 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[10 * 6 + Int(form.rawValue)]!, _1, _2) + public func AttachmentMenu_SendItem(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[10 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[11 * 6 + Int(form.rawValue)]!, _1, _2) + public func MessageTimer_Years(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[11 * 6 + Int(form.rawValue)]!, stringValue) } - public func Watch_LastSeen_MinutesAgo(_ value: Int32) -> String { + public func ForwardedVideoMessages(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[12 * 6 + Int(form.rawValue)]!, stringValue) } - public func Media_ShareItem(_ value: Int32) -> String { + public func MessageTimer_Minutes(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[13 * 6 + Int(form.rawValue)]!, stringValue) } - public func LiveLocationUpdated_MinutesAgo(_ value: Int32) -> String { + public func StickerPack_StickerCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[14 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[15 * 6 + Int(form.rawValue)]!, _1, _2) + public func Notifications_ExceptionMuteExpires_Minutes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[15 * 6 + Int(form.rawValue)]!, stringValue) } - public func Notification_GameScoreExtended(_ value: Int32) -> String { + public func Notifications_Exceptions(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[16 * 6 + Int(form.rawValue)]!, stringValue) } - public func MessageTimer_Months(_ value: Int32) -> String { + public func ServiceMessage_GameScoreExtended(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[17 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHAT_MESSAGE_ROUNDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[18 * 6 + Int(form.rawValue)]!, _2, _1, _3) + public func MuteExpires_Minutes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[18 * 6 + Int(form.rawValue)]!, stringValue) } - public func MessageTimer_ShortDays(_ value: Int32) -> String { + public func PasscodeSettings_FailedAttempts(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[19 * 6 + Int(form.rawValue)]!, stringValue) } - public func SharedMedia_Generic(_ value: Int32) -> String { + public func LastSeen_HoursAgo(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[20 * 6 + Int(form.rawValue)]!, stringValue) @@ -4673,174 +4682,170 @@ public final class PresentationStrings: Equatable { let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[21 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHANNEL_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + public func PrivacyLastSeenSettings_AddUsers(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[22 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHAT_MESSAGE_VIDEOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[22 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func SharedMedia_Link(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[23 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MuteFor_Days(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[24 * 6 + Int(form.rawValue)]!, stringValue) - } - public func GroupInfo_ShowMoreMembers(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[25 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreSelfExtended(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[26 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedGifs(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[27 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_StatusOnline(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[28 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Wallet_Updated_MinutesAgo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[29 * 6 + Int(form.rawValue)]!, stringValue) - } - public func LastSeen_MinutesAgo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[30 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notifications_Exceptions(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[31 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[32 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func ForwardedVideos(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[33 * 6 + Int(form.rawValue)]!, stringValue) - } - public func GroupInfo_ParticipantCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[34 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_AddMaskCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[35 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHANNEL_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[36 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func MessagePoll_VotedCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[37 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedStickers(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[38 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MuteExpires_Hours(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[39 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortHours(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[40 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notifications_ExceptionMuteExpires_Minutes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[41 * 6 + Int(form.rawValue)]!, stringValue) - } - public func CreatePoll_AddMoreOptions(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[42 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreSelfSimple(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[43 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Minutes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[44 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_ShortSeconds(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[45 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[23 * 6 + Int(form.rawValue)]!, _2, _1, _3) } public func Passport_Scans(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[46 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[24 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[25 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func Map_ETAHours(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[26 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Weeks(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[27 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedVideos(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[28 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_RemoveStickerCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[29 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Chat_DeleteMessagesConfirmation(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[30 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Days(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[31 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Call_ShortSeconds(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[32 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Watch_LastSeen_HoursAgo(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[33 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LiveLocation_MenuChatsCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[34 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[35 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func PUSH_CHANNEL_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[36 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func VoiceOver_Chat_PollVotes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[37 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Forward_ConfirmMultipleFiles(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[38 * 6 + Int(form.rawValue)]!, stringValue) + } + public func GroupInfo_ParticipantCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[39 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ChatList_SelectedChats(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[40 * 6 + Int(form.rawValue)]!, stringValue) + } + public func AttachmentMenu_SendGif(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[41 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LiveLocationUpdated_MinutesAgo(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[42 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notifications_ExceptionMuteExpires_Days(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[43 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedContacts(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[44 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MuteExpires_Hours(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[45 * 6 + Int(form.rawValue)]!, stringValue) } public func ForwardedPolls(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[47 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[46 * 6 + Int(form.rawValue)]!, stringValue) } - public func PasscodeSettings_FailedAttempts(_ value: Int32) -> String { + public func Conversation_LiveLocationMembersCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[48 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[47 * 6 + Int(form.rawValue)]!, stringValue) } - public func MessageTimer_ShortWeeks(_ value: Int32) -> String { + public func PUSH_CHANNEL_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[48 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func SharedMedia_Generic(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[49 * 6 + Int(form.rawValue)]!, stringValue) } - public func VoiceOver_Chat_ContactPhoneNumberCount(_ value: Int32) -> String { + public func Conversation_StatusOnline(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[50 * 6 + Int(form.rawValue)]!, stringValue) } - public func ServiceMessage_GameScoreSelfSimple(_ value: Int32) -> String { + public func SharedMedia_DeleteItemsConfirmation(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[51 * 6 + Int(form.rawValue)]!, stringValue) } - public func Media_SharePhoto(_ value: Int32) -> String { + public func SharedMedia_Photo(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[52 * 6 + Int(form.rawValue)]!, stringValue) } - public func Wallet_Updated_HoursAgo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[53 * 6 + Int(form.rawValue)]!, stringValue) + public func PUSH_CHAT_MESSAGES(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[53 * 6 + Int(form.rawValue)]!, _2, _1, _3) } - public func ForwardedMessages(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[54 * 6 + Int(form.rawValue)]!, stringValue) + public func ForwardedAuthorsOthers(_ selector: Int32, _ _0: String, _ _1: String) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[54 * 6 + Int(form.rawValue)]!, _0, _1) } - public func MessageTimer_Hours(_ value: Int32) -> String { + public func MessageTimer_ShortSeconds(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[55 * 6 + Int(form.rawValue)]!, stringValue) } - public func ForwardedVideoMessages(_ value: Int32) -> String { + public func Call_ShortMinutes(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[56 * 6 + Int(form.rawValue)]!, stringValue) @@ -4850,294 +4855,293 @@ public final class PresentationStrings: Equatable { let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[57 * 6 + Int(form.rawValue)]!, stringValue) } - public func AttachmentMenu_SendPhoto(_ value: Int32) -> String { + public func VoiceOver_Chat_ContactPhoneNumberCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[58 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHANNEL_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + public func PUSH_CHAT_MESSAGE_ROUNDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[59 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func Conversation_StatusSubscribers(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[60 * 6 + Int(form.rawValue)]!, stringValue) - } - public func VoiceOver_Chat_PollVotes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[61 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHAT_MESSAGES(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[62 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func QuickSend_Photos(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[63 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ChatList_DeleteConfirmation(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[64 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Contacts_ImportersCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[65 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ChatList_SelectedChats(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[66 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreSimple(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[67 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_Photo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[68 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_StickerCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[69 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreSelfExtended(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[70 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Wallpaper_DeleteConfirmation(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[71 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_RemoveMaskCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[72 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHANNEL_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[73 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func PUSH_CHANNEL_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[74 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func StickerPack_AddStickerCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[75 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Map_ETAMinutes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[76 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Forward_ConfirmMultipleFiles(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[77 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Weeks(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[78 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_SelectedMessages(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[79 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[59 * 6 + Int(form.rawValue)]!, _2, _1, _3) } public func Notification_GameScoreSimple(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[80 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[60 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHAT_MESSAGE_FWDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[81 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func PUSH_CHAT_MESSAGE_PHOTOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[82 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func ForwardedAuthorsOthers(_ selector: Int32, _ _0: String, _ _1: String) -> String { - let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[83 * 6 + Int(form.rawValue)]!, _0, _1) - } - public func StickerPack_RemoveStickerCount(_ value: Int32) -> String { + public func Wallpaper_DeleteConfirmation(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[84 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[61 * 6 + Int(form.rawValue)]!, stringValue) } - public func Conversation_StatusMembers(_ value: Int32) -> String { + public func MessageTimer_Months(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[85 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Invitation_Members(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[86 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedContacts(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[87 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Years(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[88 * 6 + Int(form.rawValue)]!, stringValue) - } - public func UserCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[89 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_Seconds(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[90 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Media_ShareVideo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[91 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Chat_DeleteMessagesConfirmation(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[92 * 6 + Int(form.rawValue)]!, stringValue) - } - public func InviteText_ContactsCountText(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[93 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortMinutes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[94 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_DeleteItemsConfirmation(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[95 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MuteExpires_Days(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[96 * 6 + Int(form.rawValue)]!, stringValue) - } - public func AttachmentMenu_SendItem(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[97 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Theme_UsersCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[98 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreExtended(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[99 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortSeconds(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[100 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ChatList_DeletedChats(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[101 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_LiveLocationMembersCount(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[102 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PrivacyLastSeenSettings_AddUsers(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[103 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Map_ETAHours(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[104 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Watch_LastSeen_HoursAgo(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[105 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_Video(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[106 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_ShortMinutes(_ value: Int32) -> String { - let form = getPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[107 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[62 * 6 + Int(form.rawValue)]!, stringValue) } public func DialogList_LiveLocationChatsCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[108 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[63 * 6 + Int(form.rawValue)]!, stringValue) } - public func ForwardedLocations(_ value: Int32) -> String { + public func SharedMedia_Link(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[109 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[64 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Call_Minutes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[65 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_AddMaskCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[66 * 6 + Int(form.rawValue)]!, stringValue) } public func Notifications_ExceptionMuteExpires_Hours(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[110 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[67 * 6 + Int(form.rawValue)]!, stringValue) } - public func Watch_UserInfo_Mute(_ value: Int32) -> String { + public func UserCount(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[111 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[68 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHAT_MESSAGE_VIDEOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + public func ChatList_DeletedChats(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[69 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { let form = getPluralizationForm(self.lc, selector) - return String(format: self._ps[112 * 6 + Int(form.rawValue)]!, _2, _1, _3) + return String(format: self._ps[70 * 6 + Int(form.rawValue)]!, _1, _2) } - public func MuteFor_Hours(_ value: Int32) -> String { + public func ServiceMessage_GameScoreSelfExtended(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[113 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[71 * 6 + Int(form.rawValue)]!, stringValue) } - public func ForwardedAudios(_ value: Int32) -> String { + public func AttachmentMenu_SendVideo(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[114 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[72 * 6 + Int(form.rawValue)]!, stringValue) } - public func MuteExpires_Minutes(_ value: Int32) -> String { + public func ServiceMessage_GameScoreSelfSimple(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[115 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[73 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedMessages(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[74 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_RemoveMaskCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[75 * 6 + Int(form.rawValue)]!, stringValue) + } + public func GroupInfo_ShowMoreMembers(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[76 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ServiceMessage_GameScoreSimple(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[77 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Media_ShareVideo(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[78 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[79 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func SharedMedia_Video(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[80 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedPhotos(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[81 * 6 + Int(form.rawValue)]!, stringValue) + } + public func QuickSend_Photos(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[82 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortDays(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[83 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortMinutes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[84 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Map_ETAMinutes(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[85 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MuteExpires_Days(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[86 * 6 + Int(form.rawValue)]!, stringValue) } public func SharedMedia_File(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[87 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortHours(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[88 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedLocations(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[89 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHAT_MESSAGE_FWDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[90 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func MessageTimer_Hours(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[91 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHAT_MESSAGE_PHOTOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[92 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func Notification_GameScoreExtended(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[93 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedAudios(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[94 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Watch_LastSeen_MinutesAgo(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[95 * 6 + Int(form.rawValue)]!, stringValue) + } + public func VoiceOver_Chat_PollOptionCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[96 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreSelfExtended(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[97 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[98 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func CreatePoll_AddMoreOptions(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[99 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[100 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func AttachmentMenu_SendPhoto(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[101 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_AddStickerCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[102 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Call_Seconds(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[103 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[104 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func MuteFor_Days(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[105 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = getPluralizationForm(self.lc, selector) + return String(format: self._ps[106 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func MessagePoll_VotedCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[107 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedStickers(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[108 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreSelfSimple(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[109 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MuteFor_Hours(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[110 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_StatusMembers(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[111 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LastSeen_MinutesAgo(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[112 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_StatusSubscribers(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[113 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_SelectedMessages(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[114 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Contacts_ImportersCount(_ value: Int32) -> String { + let form = getPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[115 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Invitation_Members(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[116 * 6 + Int(form.rawValue)]!, stringValue) } - public func ForwardedPhotos(_ value: Int32) -> String { + public func Media_SharePhoto(_ value: Int32) -> String { let form = getPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[117 * 6 + Int(form.rawValue)]!, stringValue) diff --git a/submodules/TelegramPresentationData/Sources/PresentationTheme.swift b/submodules/TelegramPresentationData/Sources/PresentationTheme.swift index 002f0da66f..be11cef8ed 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationTheme.swift @@ -1006,6 +1006,10 @@ public final class PresentationTheme: Equatable { return self.resourceCache.image(key, self, generate) } + public func image(_ key: PresentationResourceParameterKey, _ generate: (PresentationTheme) -> UIImage?) -> UIImage? { + return self.resourceCache.parameterImage(key, self, generate) + } + public func object(_ key: Int32, _ generate: (PresentationTheme) -> AnyObject?) -> AnyObject? { return self.resourceCache.object(key, self, generate) } diff --git a/submodules/TelegramPresentationData/Sources/PresentationThemeEssentialGraphics.swift b/submodules/TelegramPresentationData/Sources/PresentationThemeEssentialGraphics.swift index 491b01285e..149f95ed03 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationThemeEssentialGraphics.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationThemeEssentialGraphics.swift @@ -7,9 +7,12 @@ import SyncCore import TelegramUIPreferences import AppBundle -private func generateCheckImage(partial: Bool, color: UIColor) -> UIImage? { - return generateImage(CGSize(width: 11.0, height: 9.0), rotatedContext: { size, context in +func generateCheckImage(partial: Bool, color: UIColor, width: CGFloat) -> UIImage? { + return generateImage(CGSize(width: width, height: floor(width * 9.0 / 11.0)), rotatedContext: { size, context in context.clear(CGRect(origin: CGPoint(), size: size)) + + context.scaleBy(x: width / 11.0, y: width / 11.0) + context.translateBy(x: 1.0, y: 1.0) context.setStrokeColor(color.cgColor) context.setLineWidth(0.99) @@ -206,8 +209,8 @@ public final class PrincipalThemeEssentialGraphics { self.chatMessageBackgroundIncomingImage = messageBubbleImage(incoming: true, fillColor: incoming.fill, strokeColor: incoming.stroke, neighbors: .none, theme: theme, wallpaper: wallpaper, knockout: incomingKnockout) self.chatMessageBackgroundOutgoingMaskImage = messageBubbleImage(incoming: false, fillColor: .black, strokeColor: .clear, neighbors: .none, theme: theme, wallpaper: .color(0xffffff), knockout: true, mask: true, extendedEdges: true) self.chatMessageBackgroundOutgoingImage = messageBubbleImage(incoming: false, fillColor: outgoing.fill, strokeColor: outgoing.stroke, neighbors: .none, theme: theme, wallpaper: wallpaper, knockout: outgoingKnockout) - self.checkBubbleFullImage = generateCheckImage(partial: false, color: theme.message.outgoingCheckColor)! - self.checkBubblePartialImage = generateCheckImage(partial: true, color: theme.message.outgoingCheckColor)! + self.checkBubbleFullImage = generateCheckImage(partial: false, color: theme.message.outgoingCheckColor, width: 11.0)! + self.checkBubblePartialImage = generateCheckImage(partial: true, color: theme.message.outgoingCheckColor, width: 11.0)! self.chatMessageBackgroundIncomingHighlightedImage = emptyImage self.chatMessageBackgroundIncomingMergedTopMaskImage = emptyImage self.chatMessageBackgroundIncomingMergedTopImage = messageBubbleImage(incoming: true, fillColor: incoming.fill, strokeColor: incoming.stroke, neighbors: .top(side: false), theme: theme, wallpaper: wallpaper, knockout: incomingKnockout) @@ -300,14 +303,14 @@ public final class PrincipalThemeEssentialGraphics { self.chatMessageBackgroundIncomingMergedSideHighlightedImage = messageBubbleImage(incoming: true, fillColor: incoming.highlightedFill, strokeColor: incoming.stroke, neighbors: .side, theme: theme, wallpaper: wallpaper, knockout: outgoingKnockout) self.chatMessageBackgroundOutgoingMergedSideHighlightedImage = messageBubbleImage(incoming: false, fillColor: outgoing.highlightedFill, strokeColor: outgoing.stroke, neighbors: .side, theme: theme, wallpaper: wallpaper, knockout: outgoingKnockout) - self.checkBubbleFullImage = generateCheckImage(partial: false, color: theme.message.outgoingCheckColor)! - self.checkBubblePartialImage = generateCheckImage(partial: true, color: theme.message.outgoingCheckColor)! + self.checkBubbleFullImage = generateCheckImage(partial: false, color: theme.message.outgoingCheckColor, width: 11.0)! + self.checkBubblePartialImage = generateCheckImage(partial: true, color: theme.message.outgoingCheckColor, width: 11.0)! - self.checkMediaFullImage = generateCheckImage(partial: false, color: .white)! - self.checkMediaPartialImage = generateCheckImage(partial: true, color: .white)! + self.checkMediaFullImage = generateCheckImage(partial: false, color: .white, width: 11.0)! + self.checkMediaPartialImage = generateCheckImage(partial: true, color: .white, width: 11.0)! - self.checkFreeFullImage = generateCheckImage(partial: false, color: serviceColor.primaryText)! - self.checkFreePartialImage = generateCheckImage(partial: true, color: serviceColor.primaryText)! + self.checkFreeFullImage = generateCheckImage(partial: false, color: serviceColor.primaryText, width: 11.0)! + self.checkFreePartialImage = generateCheckImage(partial: true, color: serviceColor.primaryText, width: 11.0)! self.clockBubbleIncomingFrameImage = generateClockFrameImage(color: theme.message.incoming.pendingActivityColor)! self.clockBubbleIncomingMinImage = generateClockMinImage(color: theme.message.incoming.pendingActivityColor)! diff --git a/submodules/TelegramPresentationData/Sources/PresentationsResourceCache.swift b/submodules/TelegramPresentationData/Sources/PresentationsResourceCache.swift index 601f095294..a241cbfa43 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationsResourceCache.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationsResourceCache.swift @@ -4,6 +4,7 @@ import SwiftSignalKit private final class PresentationsResourceCacheHolder { var images: [Int32: UIImage] = [:] + var parameterImages: [PresentationResourceParameterKey: UIImage] = [:] } private final class PresentationsResourceAnyCacheHolder { @@ -32,6 +33,24 @@ public final class PresentationsResourceCache { } } + public func parameterImage(_ key: PresentationResourceParameterKey, _ theme: PresentationTheme, _ generate: (PresentationTheme) -> UIImage?) -> UIImage? { + let result = self.imageCache.with { holder -> UIImage? in + return holder.parameterImages[key] + } + if let result = result { + return result + } else { + if let image = generate(theme) { + self.imageCache.with { holder -> Void in + holder.parameterImages[key] = image + } + return image + } else { + return nil + } + } + } + public func object(_ key: Int32, _ theme: PresentationTheme, _ generate: (PresentationTheme) -> AnyObject?) -> AnyObject? { let result = self.objectCache.with { holder -> AnyObject? in return holder.objects[key] diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift index 6897c6f360..1566f1a1a8 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift @@ -1,4 +1,5 @@ import Foundation +import UIKit public struct PresentationResources { } @@ -219,3 +220,12 @@ public enum PresentationResourceKey: Int32 { case emptyChatListCheckIcon } + +public enum PresentationResourceParameterKey: Hashable { + case chatOutgoingFullCheck(CGFloat) + case chatOutgoingPartialCheck(CGFloat) + case chatMediaFullCheck(CGFloat) + case chatMediaPartialCheck(CGFloat) + case chatFreeFullCheck(CGFloat) + case chatFreePartialCheck(CGFloat) +} diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift index 26efdc0eb4..57ecc171c1 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift @@ -912,4 +912,40 @@ public struct PresentationResourcesChat { return UIImage(bundleImageName: "Chat/Info/GroupMembersIcon")?.precomposed() }) } + + public static func chatOutgoingFullCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatOutgoingFullCheck(size), { _ in + return generateCheckImage(partial: false, color: theme.chat.message.outgoingCheckColor, width: size) + }) + } + + public static func chatOutgoingPartialCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatOutgoingPartialCheck(size), { _ in + return generateCheckImage(partial: true, color: theme.chat.message.outgoingCheckColor, width: size) + }) + } + + public static func chatMediaFullCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatMediaFullCheck(size), { _ in + return generateCheckImage(partial: false, color: .white, width: size) + }) + } + + public static func chatMediaPartialCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatMediaPartialCheck(size), { _ in + return generateCheckImage(partial: true, color: .white, width: size) + }) + } + + public static func chatFreeFullCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatFreeFullCheck(size), { _ in + return generateCheckImage(partial: false, color: theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText, width: size) + }) + } + + public static func chatFreePartialCheck(_ theme: PresentationTheme, size: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.chatFreePartialCheck(size), { _ in + return generateCheckImage(partial: true, color: theme.chat.serviceMessage.components.withDefaultWallpaper.primaryText, width: size) + }) + } } diff --git a/submodules/TelegramUI/TelegramUI/AppDelegate.swift b/submodules/TelegramUI/TelegramUI/AppDelegate.swift index 444072d94a..3a7cc6978a 100644 --- a/submodules/TelegramUI/TelegramUI/AppDelegate.swift +++ b/submodules/TelegramUI/TelegramUI/AppDelegate.swift @@ -182,6 +182,7 @@ final class SharedApplicationContext { private let logoutDisposable = MetaDisposable() + private let openNotificationSettingsWhenReadyDisposable = MetaDisposable() private let openChatWhenReadyDisposable = MetaDisposable() private let openUrlWhenReadyDisposable = MetaDisposable() @@ -1292,7 +1293,7 @@ final class SharedApplicationContext { } if let sharedContext = strongSelf.contextValue?.context.sharedContext { let presentationData = sharedContext.currentPresentationData.with { $0 } - strongSelf.mainWindow.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: alert.title, text: alert.message ?? "", actions: actions), on: .root) + strongSelf.mainWindow.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: alert.title, text: alert.message ?? "", actions: actions), on: .root) } } }) @@ -1673,11 +1674,11 @@ final class SharedApplicationContext { if let proxyData = parseProxyUrl(url) { authContext.rootController.view.endEditing(true) let presentationData = authContext.sharedContext.currentPresentationData.with { $0 } - let controller = ProxyServerActionSheetController(theme: presentationData.theme, strings: presentationData.strings, accountManager: authContext.sharedContext.accountManager, postbox: authContext.account.postbox, network: authContext.account.network, server: proxyData, presentationData: nil) + let controller = ProxyServerActionSheetController(presentationData: presentationData, accountManager: authContext.sharedContext.accountManager, postbox: authContext.account.postbox, network: authContext.account.network, server: proxyData, updatedPresentationData: nil) authContext.rootController.currentWindow?.present(controller, on: PresentationSurfaceLevel.root, blockInteraction: false, completion: {}) } else if let secureIdData = parseSecureIdUrl(url) { let presentationData = authContext.sharedContext.currentPresentationData.with { $0 } - authContext.rootController.currentWindow?.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: nil, text: presentationData.strings.Passport_NotLoggedInMessage, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Calls_NotNow, action: { + authContext.rootController.currentWindow?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: presentationData.strings.Passport_NotLoggedInMessage, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Calls_NotNow, action: { if let callbackUrl = URL(string: secureIdCallbackUrl(with: secureIdData.callbackUrl, peerId: secureIdData.peerId, result: .cancel, parameters: [:])) { UIApplication.shared.openURL(callbackUrl) } @@ -1686,7 +1687,7 @@ final class SharedApplicationContext { authContext.rootController.applyConfirmationCode(confirmationCode) } else if let _ = parseWalletUrl(url) { let presentationData = authContext.sharedContext.currentPresentationData.with { $0 } - authContext.rootController.currentWindow?.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: nil, text: "Please log in to your account to use Gram Wallet.", actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), on: .root, blockInteraction: false, completion: {}) + authContext.rootController.currentWindow?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: "Please log in to your account to use Gram Wallet.", actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), on: .root, blockInteraction: false, completion: {}) } } }) @@ -1824,6 +1825,14 @@ final class SharedApplicationContext { }) } + private func openNotificationSettingsWhenReady() { + let signal = (self.authorizedContext() + |> take(1) + |> deliverOnMainQueue).start(next: { context in + context.openNotificationSettings() + }) + } + private func openChatWhenReady(accountId: AccountRecordId?, peerId: PeerId, messageId: MessageId? = nil, activateInput: Bool = false) { let signal = self.sharedContextPromise.get() |> take(1) @@ -2081,7 +2090,7 @@ final class SharedApplicationContext { @available(iOS 12.0, *) func userNotificationCenter(_ center: UNUserNotificationCenter, openSettingsFor notification: UNNotification?) { - + self.openNotificationSettingsWhenReady() } func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) { diff --git a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift index 9635c3ef80..c8ccde227a 100644 --- a/submodules/TelegramUI/TelegramUI/ApplicationContext.swift +++ b/submodules/TelegramUI/TelegramUI/ApplicationContext.swift @@ -40,7 +40,7 @@ final class UnauthorizedApplicationContext { var authorizationCompleted: (() -> Void)? - self.rootController = AuthorizationSequenceController(sharedContext: sharedContext, account: account, otherAccountPhoneNumbers: otherAccountPhoneNumbers, strings: presentationData.strings, theme: presentationData.theme, openUrl: sharedContext.applicationBindings.openUrl, apiId: apiId, apiHash: apiHash, authorizationCompleted: { + self.rootController = AuthorizationSequenceController(sharedContext: sharedContext, account: account, otherAccountPhoneNumbers: otherAccountPhoneNumbers, presentationData: presentationData, openUrl: sharedContext.applicationBindings.openUrl, apiId: apiId, apiHash: apiHash, authorizationCompleted: { authorizationCompleted?() }) @@ -70,6 +70,7 @@ final class AuthorizedApplicationContext { let rootController: TelegramRootController let notificationController: NotificationContainerController + private var scheduledOpenNotificationSettings: Bool = false private var scheduledOperChatWithPeerId: (PeerId, MessageId?, Bool)? private var scheduledOpenExternalUrl: URL? @@ -357,7 +358,7 @@ final class AuthorizedApplicationContext { let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 } var acceptImpl: ((String?) -> Void)? var declineImpl: (() -> Void)? - let controller = TermsOfServiceController(theme: TermsOfServiceControllerTheme(presentationTheme: presentationData.theme), strings: presentationData.strings, text: termsOfServiceUpdate.text, entities: termsOfServiceUpdate.entities, ageConfirmation: termsOfServiceUpdate.ageConfirmation, signingUp: false, accept: { proccedBot in + let controller = TermsOfServiceController(presentationData: presentationData, text: termsOfServiceUpdate.text, entities: termsOfServiceUpdate.entities, ageConfirmation: termsOfServiceUpdate.ageConfirmation, signingUp: false, accept: { proccedBot in acceptImpl?(proccedBot) }, decline: { declineImpl?() @@ -707,6 +708,14 @@ final class AuthorizedApplicationContext { self.permissionsDisposable.dispose() } + func openNotificationSettings() { + if self.rootController.rootTabController != nil { + self.rootController.pushViewController(notificationsAndSoundsController(context: self.context, exceptionsList: nil)) + } else { + self.scheduledOpenNotificationSettings = true + } + } + func openChatWithPeerId(peerId: PeerId, messageId: MessageId? = nil, activateInput: Bool = false) { var visiblePeerId: PeerId? if let controller = self.rootController.topViewController as? ChatControllerImpl, case let .peer(peerId) = controller.chatLocation { diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift index c830768a85..8841d92eb3 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceCodeEntryController.swift @@ -37,9 +37,9 @@ final class AuthorizationSequenceCodeEntryController: ViewController { } } - init(strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) { - self.strings = strings - self.theme = theme + init(presentationData: PresentationData, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) { + self.strings = presentationData.strings + self.theme = presentationData.theme self.openUrl = openUrl super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(theme), strings: NavigationBarStrings(presentationStrings: strings))) @@ -56,8 +56,8 @@ final class AuthorizationSequenceCodeEntryController: ViewController { return false } self.navigationBar?.backPressed = { [weak self] in - self?.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: theme), title: nil, text: strings.Login_CancelPhoneVerification, actions: [TextAlertAction(type: .genericAction, title: strings.Login_CancelPhoneVerificationContinue, action: { - }), TextAlertAction(type: .defaultAction, title: strings.Login_CancelPhoneVerificationStop, action: { + self?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: presentationData.strings.Login_CancelPhoneVerification, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Login_CancelPhoneVerificationContinue, action: { + }), TextAlertAction(type: .defaultAction, title: presentationData.strings.Login_CancelPhoneVerificationStop, action: { back() })]), in: .window(.root)) } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift index 6ff0635478..86b5a570ec 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceController.swift @@ -35,8 +35,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail private let otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]) private let apiId: Int32 private let apiHash: String - private var strings: PresentationStrings - public let theme: PresentationTheme + public var presentationData: PresentationData private let openUrl: (String) -> Void private let authorizationCompleted: () -> Void @@ -51,26 +50,25 @@ public final class AuthorizationSequenceController: NavigationController, MFMail } private var didSetReady = false - public init(sharedContext: SharedAccountContext, account: UnauthorizedAccount, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, apiId: Int32, apiHash: String, authorizationCompleted: @escaping () -> Void) { + public init(sharedContext: SharedAccountContext, account: UnauthorizedAccount, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), presentationData: PresentationData, openUrl: @escaping (String) -> Void, apiId: Int32, apiHash: String, authorizationCompleted: @escaping () -> Void) { self.sharedContext = sharedContext self.account = account self.otherAccountPhoneNumbers = otherAccountPhoneNumbers self.apiId = apiId self.apiHash = apiHash - self.strings = strings - self.theme = theme + self.presentationData = presentationData self.openUrl = openUrl self.authorizationCompleted = authorizationCompleted let navigationStatusBar: NavigationStatusBarStyle - switch theme.rootController.statusBarStyle { + switch presentationData.theme.rootController.statusBarStyle { case .black: navigationStatusBar = .black case .white: navigationStatusBar = .white } - super.init(mode: .single, theme: NavigationControllerTheme(statusBar: navigationStatusBar, navigationBar: AuthorizationSequenceController.navigationBarTheme(theme), emptyAreaColor: .black)) + super.init(mode: .single, theme: NavigationControllerTheme(statusBar: navigationStatusBar, navigationBar: AuthorizationSequenceController.navigationBarTheme(presentationData.theme), emptyAreaColor: .black)) self.stateDisposable = (account.postbox.stateView() |> map { view -> InnerState in @@ -99,7 +97,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail override public func loadView() { super.loadView() - self.view.backgroundColor = self.theme.list.plainBackgroundColor + self.view.backgroundColor = self.presentationData.theme.list.plainBackgroundColor } private func splashController() -> AuthorizationSequenceSplashController { @@ -114,11 +112,11 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequenceSplashController(accountManager: self.sharedContext.accountManager, postbox: self.account.postbox, network: self.account.network, theme: self.theme) + controller = AuthorizationSequenceSplashController(accountManager: self.sharedContext.accountManager, postbox: self.account.postbox, network: self.account.network, theme: self.presentationData.theme) controller.nextPressed = { [weak self] strings in if let strongSelf = self { if let strings = strings { - strongSelf.strings = strings + strongSelf.presentationData = strongSelf.presentationData.withStrings(strings) } let masterDatacenterId = strongSelf.account.masterDatacenterId let isTestingEnvironment = strongSelf.account.testingEnvironment @@ -146,7 +144,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequencePhoneEntryController(sharedContext: self.sharedContext, isTestingEnvironment: self.account.testingEnvironment, otherAccountPhoneNumbers: self.otherAccountPhoneNumbers, network: self.account.network, strings: self.strings, theme: self.theme, openUrl: { [weak self] url in + controller = AuthorizationSequencePhoneEntryController(sharedContext: self.sharedContext, isTestingEnvironment: self.account.testingEnvironment, otherAccountPhoneNumbers: self.otherAccountPhoneNumbers, network: self.account.network, presentationData: self.presentationData, openUrl: { [weak self] url in self?.openUrl(url) }, back: { [weak self] in guard let strongSelf = self else { @@ -176,14 +174,14 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String var actions: [TextAlertAction] = [ - TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {}) + TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {}) ] switch error { case .limitExceeded: - text = strongSelf.strings.Login_CodeFloodError + text = strongSelf.presentationData.strings.Login_CodeFloodError case .invalidPhoneNumber: - text = strongSelf.strings.Login_InvalidPhoneError - actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.strings.Login_PhoneNumberHelp, action: { [weak controller] in + text = strongSelf.presentationData.strings.Login_InvalidPhoneError + actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Login_PhoneNumberHelp, action: { [weak controller] in guard let strongSelf = self, let controller = controller else { return } @@ -194,13 +192,13 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let carrier = CTCarrier() let mnc = carrier.mobileNetworkCode ?? "none" - strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.strings.Login_InvalidPhoneEmailSubject(formattedNumber).0, body: strongSelf.strings.Login_InvalidPhoneEmailBody(formattedNumber, appVersion, systemVersion, locale, mnc).0, from: controller) + strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.presentationData.strings.Login_InvalidPhoneEmailSubject(formattedNumber).0, body: strongSelf.presentationData.strings.Login_InvalidPhoneEmailBody(formattedNumber, appVersion, systemVersion, locale, mnc).0, from: controller) })) case .phoneLimitExceeded: - text = strongSelf.strings.Login_PhoneFloodError + text = strongSelf.presentationData.strings.Login_PhoneFloodError case .phoneBanned: - text = strongSelf.strings.Login_PhoneBannedError - actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.strings.Login_PhoneNumberHelp, action: { [weak controller] in + text = strongSelf.presentationData.strings.Login_PhoneBannedError + actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Login_PhoneNumberHelp, action: { [weak controller] in guard let strongSelf = self, let controller = controller else { return } @@ -211,11 +209,11 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let carrier = CTCarrier() let mnc = carrier.mobileNetworkCode ?? "none" - strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.strings.Login_PhoneBannedEmailSubject(formattedNumber).0, body: strongSelf.strings.Login_PhoneBannedEmailBody(formattedNumber, appVersion, systemVersion, locale, mnc).0, from: controller) + strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.presentationData.strings.Login_PhoneBannedEmailSubject(formattedNumber).0, body: strongSelf.presentationData.strings.Login_PhoneBannedEmailBody(formattedNumber, appVersion, systemVersion, locale, mnc).0, from: controller) })) case let .generic(info): - text = strongSelf.strings.Login_UnknownError - actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.strings.Login_PhoneNumberHelp, action: { [weak controller] in + text = strongSelf.presentationData.strings.Login_UnknownError + actions.append(TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Login_PhoneNumberHelp, action: { [weak controller] in guard let strongSelf = self, let controller = controller else { return } @@ -232,18 +230,18 @@ public final class AuthorizationSequenceController: NavigationController, MFMail errorString = "unknown" } - strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.strings.Login_PhoneGenericEmailSubject(formattedNumber).0, body: strongSelf.strings.Login_PhoneGenericEmailBody(formattedNumber, errorString, appVersion, systemVersion, locale, mnc).0, from: controller) + strongSelf.presentEmailComposeController(address: "login@stel.com", subject: strongSelf.presentationData.strings.Login_PhoneGenericEmailSubject(formattedNumber).0, body: strongSelf.presentationData.strings.Login_PhoneGenericEmailBody(formattedNumber, errorString, appVersion, systemVersion, locale, mnc).0, from: controller) })) case .timeout: - text = strongSelf.strings.Login_NetworkError - actions.append(TextAlertAction(type: .genericAction, title: strongSelf.strings.ChatSettings_ConnectionType_UseProxy, action: { [weak controller] in + text = strongSelf.presentationData.strings.Login_NetworkError + actions.append(TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.ChatSettings_ConnectionType_UseProxy, action: { [weak controller] in guard let strongSelf = self, let controller = controller else { return } - controller.present(proxySettingsController(accountManager: strongSelf.sharedContext.accountManager, postbox: strongSelf.account.postbox, network: strongSelf.account.network, mode: .modal, theme: defaultPresentationTheme, strings: strongSelf.strings, updatedPresentationData: .single((defaultPresentationTheme, strongSelf.strings))), in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) + controller.present(proxySettingsController(accountManager: strongSelf.sharedContext.accountManager, postbox: strongSelf.account.postbox, network: strongSelf.account.network, mode: .modal, presentationData: strongSelf.sharedContext.currentPresentationData.with { $0 }, updatedPresentationData: strongSelf.sharedContext.presentationData), in: .window(.root), with: ViewControllerPresentationArguments(presentationAnimation: .modalSheet)) })) } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: actions), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: actions), in: .window(.root)) } })) } @@ -267,7 +265,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequenceCodeEntryController(strings: self.strings, theme: self.theme, openUrl: { [weak self] url in + controller = AuthorizationSequenceCodeEntryController(presentationData: self.presentationData, openUrl: { [weak self] url in self?.openUrl(url) }, back: { [weak self] in guard let strongSelf = self else { @@ -298,23 +296,23 @@ public final class AuthorizationSequenceController: NavigationController, MFMail return } var dismissImpl: (() -> Void)? - let alertTheme = AlertControllerTheme(presentationTheme: strongSelf.theme) + let alertTheme = AlertControllerTheme(presentationData: strongSelf.presentationData) let attributedText = stringWithAppliedEntities(termsOfService.text, entities: termsOfService.entities, baseColor: alertTheme.primaryColor, linkColor: alertTheme.accentColor, baseFont: Font.regular(13.0), linkFont: Font.regular(13.0), boldFont: Font.semibold(13.0), italicFont: Font.italic(13.0), boldItalicFont: Font.semiboldItalic(13.0), fixedFont: Font.regular(13.0), blockQuoteFont: Font.regular(13.0)) - let contentNode = TextAlertContentNode(theme: alertTheme, title: NSAttributedString(string: strongSelf.strings.Login_TermsOfServiceHeader, font: Font.medium(17.0), textColor: alertTheme.primaryColor, paragraphAlignment: .center), text: attributedText, actions: [ - TextAlertAction(type: .defaultAction, title: strongSelf.strings.Login_TermsOfServiceAgree, action: { + let contentNode = TextAlertContentNode(theme: alertTheme, title: NSAttributedString(string: strongSelf.presentationData.strings.Login_TermsOfServiceHeader, font: Font.medium(17.0), textColor: alertTheme.primaryColor, paragraphAlignment: .center), text: attributedText, actions: [ + TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Login_TermsOfServiceAgree, action: { dismissImpl?() guard let strongSelf = self else { return } let _ = beginSignUp(account: strongSelf.account, data: data).start() - }), TextAlertAction(type: .genericAction, title: strongSelf.strings.Login_TermsOfServiceDecline, action: { + }), TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Login_TermsOfServiceDecline, action: { dismissImpl?() guard let strongSelf = self else { return } - strongSelf.currentWindow?.present(standardTextAlertController(theme: alertTheme, title: strongSelf.strings.Login_TermsOfServiceDecline, text: strongSelf.strings.Login_TermsOfServiceSignupDecline, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_Cancel, action: { + strongSelf.currentWindow?.present(standardTextAlertController(theme: alertTheme, title: strongSelf.presentationData.strings.Login_TermsOfServiceDecline, text: strongSelf.presentationData.strings.Login_TermsOfServiceSignupDecline, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { presentAlertAgainImpl?() - }), TextAlertAction(type: .genericAction, title: strongSelf.strings.Login_TermsOfServiceDecline, action: { + }), TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Login_TermsOfServiceDecline, action: { guard let strongSelf = self else { return } @@ -355,20 +353,20 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .limitExceeded: - text = strongSelf.strings.Login_CodeFloodError + text = strongSelf.presentationData.strings.Login_CodeFloodError case .invalidCode: - text = strongSelf.strings.Login_InvalidCodeError + text = strongSelf.presentationData.strings.Login_InvalidCodeError case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError case .codeExpired: - text = strongSelf.strings.Login_CodeExpired + text = strongSelf.presentationData.strings.Login_CodeExpired let account = strongSelf.account let _ = (strongSelf.account.postbox.transaction { transaction -> Void in transaction.setState(UnauthorizedAccountState(isTestingEnvironment: account.testingEnvironment, masterDatacenterId: account.masterDatacenterId, contents: .empty)) }).start() } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } } })) @@ -380,9 +378,9 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if nextType == nil { if MFMailComposeViewController.canSendMail(), let controller = controller { let formattedNumber = formatPhoneNumber(number) - strongSelf.presentEmailComposeController(address: "sms@stel.com", subject: strongSelf.strings.Login_EmailCodeSubject(formattedNumber).0, body: strongSelf.strings.Login_EmailCodeBody(formattedNumber).0, from: controller) + strongSelf.presentEmailComposeController(address: "sms@stel.com", subject: strongSelf.presentationData.strings.Login_EmailCodeSubject(formattedNumber).0, body: strongSelf.presentationData.strings.Login_EmailCodeBody(formattedNumber).0, from: controller) } else { - controller?.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: strongSelf.strings.Login_EmailNotConfiguredError, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.Login_EmailNotConfiguredError, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } } else { controller?.inProgress = true @@ -396,20 +394,20 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .limitExceeded: - text = strongSelf.strings.Login_CodeFloodError + text = strongSelf.presentationData.strings.Login_CodeFloodError case .invalidPhoneNumber: - text = strongSelf.strings.Login_InvalidPhoneError + text = strongSelf.presentationData.strings.Login_InvalidPhoneError case .phoneLimitExceeded: - text = strongSelf.strings.Login_PhoneFloodError + text = strongSelf.presentationData.strings.Login_PhoneFloodError case .phoneBanned: - text = strongSelf.strings.Login_PhoneBannedError + text = strongSelf.presentationData.strings.Login_PhoneBannedError case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError case .timeout: - text = strongSelf.strings.Login_NetworkError + text = strongSelf.presentationData.strings.Login_NetworkError } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } })) } @@ -439,7 +437,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequencePasswordEntryController(strings: self.strings, theme: self.theme, back: { [weak self] in + controller = AuthorizationSequencePasswordEntryController(presentationData: self.presentationData, back: { [weak self] in guard let strongSelf = self else { return } @@ -461,14 +459,14 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .limitExceeded: - text = strongSelf.strings.LoginPassword_FloodError + text = strongSelf.presentationData.strings.LoginPassword_FloodError case .invalidPassword: - text = strongSelf.strings.LoginPassword_InvalidPasswordError + text = strongSelf.presentationData.strings.LoginPassword_InvalidPasswordError case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) controller.passwordIsInvalid() } } @@ -491,7 +489,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail } }).start() case .none: - strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: strongSelf.strings.TwoStepAuth_RecoveryUnavailable, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.TwoStepAuth_RecoveryUnavailable, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) strongController.didForgotWithNoRecovery = true } } @@ -504,9 +502,9 @@ public final class AuthorizationSequenceController: NavigationController, MFMail } controller.reset = { [weak self, weak controller] in if let strongSelf = self, let strongController = controller { - strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: suggestReset ? strongSelf.strings.TwoStepAuth_RecoveryFailed : strongSelf.strings.TwoStepAuth_RecoveryUnavailable, actions: [ - TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_Cancel, action: {}), - TextAlertAction(type: .destructiveAction, title: strongSelf.strings.Login_ResetAccountProtected_Reset, action: { + strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: suggestReset ? strongSelf.presentationData.strings.TwoStepAuth_RecoveryFailed : strongSelf.presentationData.strings.TwoStepAuth_RecoveryUnavailable, actions: [ + TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {}), + TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.Login_ResetAccountProtected_Reset, action: { if let strongSelf = self, let strongController = controller { strongController.inProgress = true strongSelf.actionDisposable.set((performAccountReset(account: strongSelf.account) @@ -520,11 +518,11 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError case .limitExceeded: - text = strongSelf.strings.Login_ResetAccountProtected_LimitExceeded + text = strongSelf.presentationData.strings.Login_ResetAccountProtected_LimitExceeded } - strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } })) } @@ -547,7 +545,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequencePasswordRecoveryController(strings: self.strings, theme: self.theme, back: { [weak self] in + controller = AuthorizationSequencePasswordRecoveryController(strings: self.presentationData.strings, theme: self.presentationData.theme, back: { [weak self] in guard let strongSelf = self else { return } @@ -569,14 +567,14 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .limitExceeded: - text = strongSelf.strings.LoginPassword_FloodError + text = strongSelf.presentationData.strings.LoginPassword_FloodError case .invalidCode: - text = strongSelf.strings.Login_InvalidCodeError + text = strongSelf.presentationData.strings.Login_InvalidCodeError case .expired: - text = strongSelf.strings.Login_CodeExpiredError + text = strongSelf.presentationData.strings.Login_CodeExpiredError } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } } })) @@ -584,7 +582,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail } controller.noAccess = { [weak self, weak controller] in if let strongSelf = self, let controller = controller { - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: strongSelf.strings.TwoStepAuth_RecoveryFailed, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.TwoStepAuth_RecoveryFailed, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) let account = strongSelf.account let _ = (strongSelf.account.postbox.transaction { transaction -> Void in if let state = transaction.getState() as? UnauthorizedAccountState, case let .passwordRecovery(hint, number, code, _, syncContacts) = state.contents { @@ -610,7 +608,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequenceAwaitingAccountResetController(strings: self.strings, theme: self.theme, back: { [weak self] in + controller = AuthorizationSequenceAwaitingAccountResetController(strings: self.presentationData.strings, theme: self.presentationData.theme, back: { [weak self] in guard let strongSelf = self else { return } @@ -622,9 +620,9 @@ public final class AuthorizationSequenceController: NavigationController, MFMail }) controller.reset = { [weak self, weak controller] in if let strongSelf = self, let strongController = controller { - strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: strongSelf.strings.TwoStepAuth_ResetAccountConfirmation, actions: [ - TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_Cancel, action: {}), - TextAlertAction(type: .destructiveAction, title: strongSelf.strings.Login_ResetAccountProtected_Reset, action: { + strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.TwoStepAuth_ResetAccountConfirmation, actions: [ + TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_Cancel, action: {}), + TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.Login_ResetAccountProtected_Reset, action: { if let strongSelf = self, let strongController = controller { strongController.inProgress = true strongSelf.actionDisposable.set((performAccountReset(account: strongSelf.account) @@ -638,11 +636,11 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError case .limitExceeded: - text = strongSelf.strings.Login_ResetAccountProtected_LimitExceeded + text = strongSelf.presentationData.strings.Login_ResetAccountProtected_LimitExceeded } - strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + strongController.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } })) } @@ -674,7 +672,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail if let currentController = currentController { controller = currentController } else { - controller = AuthorizationSequenceSignUpController(strings: self.strings, theme: self.theme, back: { [weak self] in + controller = AuthorizationSequenceSignUpController(presentationData: self.presentationData, back: { [weak self] in guard let strongSelf = self else { return } @@ -697,18 +695,18 @@ public final class AuthorizationSequenceController: NavigationController, MFMail let text: String switch error { case .limitExceeded: - text = strongSelf.strings.Login_CodeFloodError + text = strongSelf.presentationData.strings.Login_CodeFloodError case .codeExpired: - text = strongSelf.strings.Login_CodeExpiredError + text = strongSelf.presentationData.strings.Login_CodeExpiredError case .invalidFirstName: - text = strongSelf.strings.Login_InvalidFirstNameError + text = strongSelf.presentationData.strings.Login_InvalidFirstNameError case .invalidLastName: - text = strongSelf.strings.Login_InvalidLastNameError + text = strongSelf.presentationData.strings.Login_InvalidLastNameError case .generic: - text = strongSelf.strings.Login_UnknownError + text = strongSelf.presentationData.strings.Login_UnknownError } - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } } })) @@ -814,7 +812,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail controller.view.window?.rootViewController?.present(composeController, animated: true, completion: nil) } else { - controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.theme), title: nil, text: self.strings.Login_EmailNotConfiguredError, actions: [TextAlertAction(type: .defaultAction, title: self.strings.Common_OK, action: {})]), in: .window(.root)) + controller.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.Login_EmailNotConfiguredError, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift index 8c744c5e3b..1f40397b78 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePasswordEntryController.swift @@ -10,8 +10,7 @@ final class AuthorizationSequencePasswordEntryController: ViewController { return self.displayNode as! AuthorizationSequencePasswordEntryControllerNode } - private let strings: PresentationStrings - private let theme: PresentationTheme + private let presentationData: PresentationData var loginWithPassword: ((String) -> Void)? var forgot: (() -> Void)? @@ -35,26 +34,25 @@ final class AuthorizationSequencePasswordEntryController: ViewController { var inProgress: Bool = false { didSet { if self.inProgress { - let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.theme.rootController.navigationBar.accentTextColor)) + let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.presentationData.theme.rootController.navigationBar.accentTextColor)) self.navigationItem.rightBarButtonItem = item } else { - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) } self.controllerNode.inProgress = self.inProgress } } - init(strings: PresentationStrings, theme: PresentationTheme, back: @escaping () -> Void) { - self.strings = strings - self.theme = theme + init(presentationData: PresentationData, back: @escaping () -> Void) { + self.presentationData = presentationData - super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(theme), strings: NavigationBarStrings(presentationStrings: strings))) + super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(presentationData.theme), strings: NavigationBarStrings(presentationStrings: presentationData.strings))) self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait) self.hasActiveInput = true - self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style + self.statusBar.statusBarStyle = presentationData.theme.intro.statusBarStyle.style self.attemptNavigation = { _ in return false @@ -63,7 +61,7 @@ final class AuthorizationSequencePasswordEntryController: ViewController { back() } - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) } required init(coder aDecoder: NSCoder) { @@ -71,7 +69,7 @@ final class AuthorizationSequencePasswordEntryController: ViewController { } override public func loadDisplayNode() { - self.displayNode = AuthorizationSequencePasswordEntryControllerNode(strings: self.strings, theme: self.theme) + self.displayNode = AuthorizationSequencePasswordEntryControllerNode(strings: self.presentationData.strings, theme: self.presentationData.theme) self.displayNodeDidLoad() self.controllerNode.view.disableAutomaticKeyboardHandling = [.forward, .backward] @@ -132,9 +130,9 @@ final class AuthorizationSequencePasswordEntryController: ViewController { func forgotPressed() { if self.suggestReset { - self.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.theme), title: nil, text: self.strings.TwoStepAuth_RecoveryFailed, actions: [TextAlertAction(type: .defaultAction, title: self.strings.Common_OK, action: {})]), in: .window(.root)) + self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.TwoStepAuth_RecoveryFailed, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } else if self.didForgotWithNoRecovery { - self.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.theme), title: nil, text: self.strings.TwoStepAuth_RecoveryUnavailable, actions: [TextAlertAction(type: .defaultAction, title: self.strings.Common_OK, action: {})]), in: .window(.root)) + self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.TwoStepAuth_RecoveryUnavailable, actions: [TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } else { self.forgot?() } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift index 4cdfacc1a9..c232bc8e2a 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryController.swift @@ -22,8 +22,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController { private let isTestingEnvironment: Bool private let otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]) private let network: Network - private let strings: PresentationStrings - private let theme: PresentationTheme + private let presentationData: PresentationData private let openUrl: (String) -> Void private let back: () -> Void @@ -33,10 +32,10 @@ final class AuthorizationSequencePhoneEntryController: ViewController { var inProgress: Bool = false { didSet { if self.inProgress { - let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.theme.rootController.navigationBar.accentTextColor)) + let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.presentationData.theme.rootController.navigationBar.accentTextColor)) self.navigationItem.rightBarButtonItem = item } else { - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) } self.controllerNode.inProgress = self.inProgress } @@ -47,23 +46,22 @@ final class AuthorizationSequencePhoneEntryController: ViewController { private let hapticFeedback = HapticFeedback() - init(sharedContext: SharedAccountContext, isTestingEnvironment: Bool, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), network: Network, strings: PresentationStrings, theme: PresentationTheme, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) { + init(sharedContext: SharedAccountContext, isTestingEnvironment: Bool, otherAccountPhoneNumbers: ((String, AccountRecordId, Bool)?, [(String, AccountRecordId, Bool)]), network: Network, presentationData: PresentationData, openUrl: @escaping (String) -> Void, back: @escaping () -> Void) { self.sharedContext = sharedContext self.isTestingEnvironment = isTestingEnvironment self.otherAccountPhoneNumbers = otherAccountPhoneNumbers self.network = network - self.strings = strings - self.theme = theme + self.presentationData = presentationData self.openUrl = openUrl self.back = back - super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(theme), strings: NavigationBarStrings(presentationStrings: strings))) + super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(presentationData.theme), strings: NavigationBarStrings(presentationStrings: presentationData.strings))) self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait) self.hasActiveInput = true - self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style + self.statusBar.statusBarStyle = presentationData.theme.intro.statusBarStyle.style self.attemptNavigation = { _ in return false } @@ -72,9 +70,9 @@ final class AuthorizationSequencePhoneEntryController: ViewController { } if !otherAccountPhoneNumbers.1.isEmpty { - self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) + self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) } - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) } required init(coder aDecoder: NSCoder) { @@ -97,7 +95,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController { } override public func loadDisplayNode() { - self.displayNode = AuthorizationSequencePhoneEntryControllerNode(strings: self.strings, theme: self.theme, debugAction: { [weak self] in + self.displayNode = AuthorizationSequencePhoneEntryControllerNode(strings: self.presentationData.strings, theme: self.presentationData.theme, debugAction: { [weak self] in guard let strongSelf = self else { return } @@ -113,7 +111,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController { self.controllerNode.selectCountryCode = { [weak self] in if let strongSelf = self { - let controller = AuthorizationSequenceCountrySelectionController(strings: strongSelf.strings, theme: strongSelf.theme) + let controller = AuthorizationSequenceCountrySelectionController(strings: strongSelf.presentationData.strings, theme: strongSelf.presentationData.theme) controller.completeWithCountryCode = { code, name in if let strongSelf = self, let currentData = strongSelf.currentData { strongSelf.updateData(countryCode: Int32(code), countryName: name, number: currentData.2) @@ -163,13 +161,13 @@ final class AuthorizationSequencePhoneEntryController: ViewController { if let (_, id) = existing { var actions: [TextAlertAction] = [] if let (current, _, _) = self.otherAccountPhoneNumbers.0, logInNumber != formatPhoneNumber(current) { - actions.append(TextAlertAction(type: .genericAction, title: self.strings.Login_PhoneNumberAlreadyAuthorizedSwitch, action: { [weak self] in + actions.append(TextAlertAction(type: .genericAction, title: self.presentationData.strings.Login_PhoneNumberAlreadyAuthorizedSwitch, action: { [weak self] in self?.sharedContext.switchToAccount(id: id, fromSettingsController: nil, withChatListController: nil) self?.back() })) } - actions.append(TextAlertAction(type: .defaultAction, title: self.strings.Common_OK, action: {})) - self.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.theme), title: nil, text: self.strings.Login_PhoneNumberAlreadyAuthorized, actions: actions), in: .window(.root)) + actions.append(TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Common_OK, action: {})) + self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.Login_PhoneNumberAlreadyAuthorized, actions: actions), in: .window(.root)) } else { self.loginWithNumber?(self.controllerNode.currentNumber, self.controllerNode.syncContacts) } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift index fa85d1cd79..04373b2de0 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpController.swift @@ -16,8 +16,7 @@ final class AuthorizationSequenceSignUpController: ViewController { return self.displayNode as! AuthorizationSequenceSignUpControllerNode } - private let strings: PresentationStrings - private let theme: PresentationTheme + private let presentationData: PresentationData private let back: () -> Void var initialName: (String, String) = ("", "") @@ -30,27 +29,26 @@ final class AuthorizationSequenceSignUpController: ViewController { var inProgress: Bool = false { didSet { if self.inProgress { - let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.theme.rootController.navigationBar.accentTextColor)) + let item = UIBarButtonItem(customDisplayNode: ProgressNavigationButtonNode(color: self.presentationData.theme.rootController.navigationBar.accentTextColor)) self.navigationItem.rightBarButtonItem = item } else { - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) } self.controllerNode.inProgress = self.inProgress } } - init(strings: PresentationStrings, theme: PresentationTheme, back: @escaping () -> Void, displayCancel: Bool) { - self.strings = strings - self.theme = theme + init(presentationData: PresentationData, back: @escaping () -> Void, displayCancel: Bool) { + self.presentationData = presentationData self.back = back - super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(theme), strings: NavigationBarStrings(presentationStrings: strings))) + super.init(navigationBarPresentationData: NavigationBarPresentationData(theme: AuthorizationSequenceController.navigationBarTheme(presentationData.theme), strings: NavigationBarStrings(presentationStrings: presentationData.strings))) self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait) - self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style + self.statusBar.statusBarStyle = presentationData.theme.intro.statusBarStyle.style - self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) + self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.presentationData.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed)) self.attemptNavigation = { _ in return false @@ -59,14 +57,14 @@ final class AuthorizationSequenceSignUpController: ViewController { guard let strongSelf = self else { return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: theme), title: nil, text: strings.Login_CancelSignUpConfirmation, actions: [TextAlertAction(type: .genericAction, title: strings.Login_CancelPhoneVerificationContinue, action: { - }), TextAlertAction(type: .defaultAction, title: strings.Login_CancelPhoneVerificationStop, action: { + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: presentationData.strings.Login_CancelSignUpConfirmation, actions: [TextAlertAction(type: .genericAction, title: presentationData.strings.Login_CancelPhoneVerificationContinue, action: { + }), TextAlertAction(type: .defaultAction, title: presentationData.strings.Login_CancelPhoneVerificationStop, action: { back() })]), in: .window(.root)) } if displayCancel { - self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) + self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)) } } @@ -75,8 +73,8 @@ final class AuthorizationSequenceSignUpController: ViewController { } @objc private func cancelPressed() { - self.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: self.theme), title: nil, text: self.strings.Login_CancelSignUpConfirmation, actions: [TextAlertAction(type: .genericAction, title: self.strings.Login_CancelPhoneVerificationContinue, action: { - }), TextAlertAction(type: .defaultAction, title: self.strings.Login_CancelPhoneVerificationStop, action: { [weak self] in + self.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: self.presentationData), title: nil, text: self.presentationData.strings.Login_CancelSignUpConfirmation, actions: [TextAlertAction(type: .genericAction, title: self.presentationData.strings.Login_CancelPhoneVerificationContinue, action: { + }), TextAlertAction(type: .defaultAction, title: self.presentationData.strings.Login_CancelPhoneVerificationStop, action: { [weak self] in self?.back() })]), in: .window(.root)) } @@ -84,7 +82,7 @@ final class AuthorizationSequenceSignUpController: ViewController { override public func loadDisplayNode() { let currentAvatarMixin = Atomic(value: nil) - self.displayNode = AuthorizationSequenceSignUpControllerNode(theme: self.theme, strings: self.strings, addPhoto: { [weak self] in + self.displayNode = AuthorizationSequenceSignUpControllerNode(theme: self.presentationData.theme, strings: self.presentationData.strings, addPhoto: { [weak self] in presentLegacyAvatarPicker(holder: currentAvatarMixin, signup: true, theme: defaultPresentationTheme, present: { c, a in self?.view.endEditing(true) self?.present(c, in: .window(.root), with: a) @@ -104,7 +102,7 @@ final class AuthorizationSequenceSignUpController: ViewController { return } strongSelf.view.endEditing(true) - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: defaultPresentationTheme), title: strongSelf.strings.Login_TermsOfServiceHeader, text: termsOfService.text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.Login_TermsOfServiceHeader, text: termsOfService.text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } self.controllerNode.updateData(firstName: self.initialName.0, lastName: self.initialName.1, hasTermsOfService: self.termsOfService != nil) diff --git a/submodules/TelegramUI/TelegramUI/ChatController.swift b/submodules/TelegramUI/TelegramUI/ChatController.swift index 58697a68bd..f024923958 100644 --- a/submodules/TelegramUI/TelegramUI/ChatController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatController.swift @@ -1954,9 +1954,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G var contactStatus: ChatContactStatus? if let peer = peerView.peers[peerView.peerId] { if let cachedData = peerView.cachedData as? CachedUserData { - if !peer.isDeleted { - contactStatus = ChatContactStatus(canAddContact: !peerView.peerIsContact, canReportIrrelevantLocation: false, peerStatusSettings: cachedData.peerStatusSettings) - } + contactStatus = ChatContactStatus(canAddContact: !peerView.peerIsContact, canReportIrrelevantLocation: false, peerStatusSettings: cachedData.peerStatusSettings) } else if let cachedData = peerView.cachedData as? CachedGroupData { contactStatus = ChatContactStatus(canAddContact: false, canReportIrrelevantLocation: false, peerStatusSettings: cachedData.peerStatusSettings) } else if let cachedData = peerView.cachedData as? CachedChannelData { @@ -2807,7 +2805,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } if let errorText = errorText { - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: errorText, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: errorText, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) return } } @@ -5076,7 +5074,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationAction, action: { @@ -5093,7 +5091,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.ChatList_DeleteForEveryoneConfirmationAction, action: { @@ -5114,7 +5112,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationTitle, text: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationText, actions: [ TextAlertAction(type: .genericAction, title: strongSelf.presentationData.strings.Common_Cancel, action: { }), TextAlertAction(type: .destructiveAction, title: strongSelf.presentationData.strings.ChatList_DeleteSavedMessagesConfirmationAction, action: { @@ -5553,12 +5551,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } else { text = strongSelf.presentationData.strings.Chat_AttachmentLimitReached } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) }, presentCantSendMultipleFiles: { guard let strongSelf = self else { return } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: strongSelf.presentationData.strings.Chat_AttachmentMultipleFilesDisabled, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: strongSelf.presentationData.strings.Chat_AttachmentMultipleFilesDisabled, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) }, presentSchedulePicker: { [weak self] done in guard let strongSelf = self, let peer = strongSelf.presentationInterfaceState.renderedPeer?.peer else { return @@ -5758,7 +5756,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G text = strongSelf.presentationData.strings.Chat_AttachmentLimitReached } - strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: strongSelf.presentationData.theme), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + strongSelf.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: strongSelf.presentationData), title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) }, presentSchedulePicker: { [weak self] done in guard let strongSelf = self, let peer = strongSelf.presentationInterfaceState.renderedPeer?.peer else { return diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift b/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift index 7d6c017dbb..a3bf69bcfb 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageActionUrlAuthController.swift @@ -318,8 +318,8 @@ func chatMessageActionUrlAuthController(context: AccountContext, defaultUrl: Str open(contentNode.authorize, contentNode.allowWriteAccess) } })] - contentNode = ChatMessageActionUrlAuthAlertContentNode(theme: AlertControllerTheme(presentationTheme: theme), ptheme: theme, strings: strings, nameDisplayOrder: presentationData.nameDisplayOrder, defaultUrl: defaultUrl, domain: domain, bot: bot, requestWriteAccess: requestWriteAccess, displayName: displayName, actions: actions) - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: theme), contentNode: contentNode!) + contentNode = ChatMessageActionUrlAuthAlertContentNode(theme: AlertControllerTheme(presentationData: presentationData), ptheme: theme, strings: strings, nameDisplayOrder: presentationData.nameDisplayOrder, defaultUrl: defaultUrl, domain: domain, bot: bot, requestWriteAccess: requestWriteAccess, displayName: displayName, actions: actions) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode!) dismissImpl = { [weak controller] animated in if animated { controller?.dismissAnimated() diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift index 7c88fabd6c..74175a44ff 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageAttachedContentNode.swift @@ -14,13 +14,6 @@ import AccountContext import UrlEscaping import PhotoResources -private let titleFont = Font.semibold(15.0) -private let textFont = Font.regular(15.0) -private let textBoldFont = Font.semibold(15.0) -private let textItalicFont = Font.italic(15.0) -private let textBoldItalicFont = Font.semiboldItalic(15.0) -private let textFixedFont = Font.regular(15.0) -private let textBlockQuoteFont = Font.regular(15.0) private let buttonFont = Font.semibold(13.0) enum ChatMessageAttachedContentActionIcon { @@ -289,6 +282,16 @@ final class ChatMessageAttachedContentNode: ASDisplayNode { let currentAdditionalImageBadgeNode = self.additionalImageBadgeNode return { presentationData, automaticDownloadSettings, associatedData, context, controllerInteraction, message, messageRead, title, subtitle, text, entities, mediaAndFlags, mediaBadge, actionIcon, actionTitle, displayLine, layoutConstants, constrainedSize in + let fontSize: CGFloat = floor(presentationData.fontSize.baseDisplaySize * 15.0 / 17.0) + + let titleFont = Font.semibold(fontSize) + let textFont = Font.regular(fontSize) + let textBoldFont = Font.semibold(fontSize) + let textItalicFont = Font.italic(fontSize) + let textBoldItalicFont = Font.semiboldItalic(fontSize) + let textFixedFont = Font.regular(fontSize) + let textBlockQuoteFont = Font.regular(fontSize) + let incoming = message.effectivelyIncoming(context.account.peerId) var horizontalInsets = UIEdgeInsets(top: 0.0, left: 12.0, bottom: 0.0, right: 12.0) @@ -375,6 +378,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode { let updatedSubtitle = NSMutableAttributedString() updatedSubtitle.append(subtitle) updatedSubtitle.addAttribute(.foregroundColor, value: messageTheme.primaryTextColor, range: NSMakeRange(0, subtitle.length)) + updatedSubtitle.addAttribute(.font, value: titleFont, range: NSMakeRange(0, subtitle.length)) string.append(updatedSubtitle) notEmpty = true } diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift index 74e96dd184..982e67c939 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift @@ -123,11 +123,6 @@ private func contentNodeMessagesAndClassesForItem(_ item: ChatMessageItem) -> [( return result } -private let nameFont = Font.medium(14.0) - -private let inlineBotPrefixFont = Font.regular(14.0) -private let inlineBotNameFont = nameFont - private let chatMessagePeerIdColors: [UIColor] = [ UIColor(rgb: 0xfc5c51), UIColor(rgb: 0xfa790f), @@ -624,6 +619,12 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePrevewItemNode ) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) { let accessibilityData = ChatMessageAccessibilityData(item: item, isSelected: isSelected) + let fontSize = floor(item.presentationData.fontSize.baseDisplaySize * 14.0 / 17.0) + let nameFont = Font.medium(fontSize) + + let inlineBotPrefixFont = Font.regular(fontSize) + let inlineBotNameFont = nameFont + let baseWidth = params.width - params.leftInset - params.rightInset let content = item.content diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift index 0197d27ab1..febd3e143a 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageDateAndStatusNode.swift @@ -9,8 +9,7 @@ import SwiftSignalKit import TelegramPresentationData import AccountContext -private let dateFont = UIFont.italicSystemFont(ofSize: 11.0) -private let reactionCountFont = Font.semiboldItalic(11.0) +private let reactionCountFont = Font.semibold(11.0) private func maybeAddRotationAnimation(_ layer: CALayer, duration: Double) { if let _ = layer.animation(forKey: "clockFrameAnimation") { @@ -32,29 +31,6 @@ enum ChatMessageDateAndStatusOutgoingType: Equatable { case Sent(read: Bool) case Sending case Failed - - static func ==(lhs: ChatMessageDateAndStatusOutgoingType, rhs: ChatMessageDateAndStatusOutgoingType) -> Bool { - switch lhs { - case let .Sent(read): - if case .Sent(read) = rhs { - return true - } else { - return false - } - case .Sending: - if case .Sending = rhs { - return true - } else { - return false - } - case .Failed: - if case .Failed = rhs { - return true - } else { - return false - } - } - } } enum ChatMessageDateAndStatusType: Equatable { @@ -149,12 +125,14 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { let graphics = PresentationResourcesChat.principalGraphics(mediaBox: context.account.postbox.mediaBox, knockoutWallpaper: context.sharedContext.immediateExperimentalUISettings.knockoutWallpaper, theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper) let offset: CGFloat = -UIScreenPixel + let checkSize: CGFloat = floor(floor(presentationData.fontSize.baseDisplaySize * 11.0 / 17.0)) + switch type { case .BubbleIncoming: dateColor = presentationData.theme.theme.chat.message.incoming.secondaryTextColor leftInset = 10.0 - loadedCheckFullImage = graphics.checkBubbleFullImage - loadedCheckPartialImage = graphics.checkBubblePartialImage + loadedCheckFullImage = PresentationResourcesChat.chatOutgoingFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatOutgoingPartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockBubbleIncomingFrameImage clockMinImage = graphics.clockBubbleIncomingMinImage if impressionCount != nil { @@ -164,8 +142,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { dateColor = presentationData.theme.theme.chat.message.outgoing.secondaryTextColor outgoingStatus = status leftInset = 10.0 - loadedCheckFullImage = graphics.checkBubbleFullImage - loadedCheckPartialImage = graphics.checkBubblePartialImage + loadedCheckFullImage = PresentationResourcesChat.chatOutgoingFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatOutgoingPartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockBubbleOutgoingFrameImage clockMinImage = graphics.clockBubbleOutgoingMinImage if impressionCount != nil { @@ -175,8 +153,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { dateColor = presentationData.theme.theme.chat.message.mediaDateAndStatusTextColor backgroundImage = graphics.dateAndStatusMediaBackground leftInset = 0.0 - loadedCheckFullImage = graphics.checkMediaFullImage - loadedCheckPartialImage = graphics.checkMediaPartialImage + loadedCheckFullImage = PresentationResourcesChat.chatMediaFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatMediaPartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockMediaFrameImage clockMinImage = graphics.clockMediaMinImage if impressionCount != nil { @@ -187,8 +165,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { outgoingStatus = status backgroundImage = graphics.dateAndStatusMediaBackground leftInset = 0.0 - loadedCheckFullImage = graphics.checkMediaFullImage - loadedCheckPartialImage = graphics.checkMediaPartialImage + loadedCheckFullImage = PresentationResourcesChat.chatMediaFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatMediaPartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockMediaFrameImage clockMinImage = graphics.clockMediaMinImage if impressionCount != nil { @@ -199,8 +177,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { dateColor = serviceColor.primaryText backgroundImage = graphics.dateAndStatusFreeBackground leftInset = 0.0 - loadedCheckFullImage = graphics.checkFreeFullImage - loadedCheckPartialImage = graphics.checkFreePartialImage + loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockFreeFrameImage clockMinImage = graphics.clockFreeMinImage if impressionCount != nil { @@ -212,8 +190,8 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { outgoingStatus = status backgroundImage = graphics.dateAndStatusFreeBackground leftInset = 0.0 - loadedCheckFullImage = graphics.checkFreeFullImage - loadedCheckPartialImage = graphics.checkFreePartialImage + loadedCheckFullImage = PresentationResourcesChat.chatFreeFullCheck(presentationData.theme.theme, size: checkSize) + loadedCheckPartialImage = PresentationResourcesChat.chatFreePartialCheck(presentationData.theme.theme, size: checkSize) clockFrameImage = graphics.clockFreeFrameImage clockMinImage = graphics.clockFreeMinImage if impressionCount != nil { @@ -229,8 +207,11 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { updatedDateText = compactNumericCountString(impressionCount, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator) + " " + updatedDateText } + let dateFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 11.0 / 17.0)) let (date, dateApply) = dateLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: updatedDateText, font: dateFont, textColor: dateColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .middle, constrainedSize: constrainedSize, alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + let checkOffset = floor(presentationData.fontSize.baseDisplaySize * 6.0 / 17.0) + let statusWidth: CGFloat var checkSentFrame: CGRect? @@ -306,7 +287,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { clockFrameNode = nil clockMinNode = nil } else { - statusWidth = 13.0 + statusWidth = floor(floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0)) if checkReadNode == nil { checkReadNode = ASImageNode() @@ -330,7 +311,7 @@ class ChatMessageDateAndStatusNode: ASDisplayNode { if read { checkReadFrame = CGRect(origin: CGPoint(x: leftInset + impressionWidth + date.size.width + 5.0 + statusWidth - checkSize.width, y: 3.0 + offset), size: checkSize) } - checkSentFrame = CGRect(origin: CGPoint(x: leftInset + impressionWidth + date.size.width + 5.0 + statusWidth - checkSize.width - 6.0, y: 3.0 + offset), size: checkSize) + checkSentFrame = CGRect(origin: CGPoint(x: leftInset + impressionWidth + date.size.width + 5.0 + statusWidth - checkSize.width - checkOffset, y: 3.0 + offset), size: checkSize) } case .Failed: statusWidth = 0.0 diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageForwardInfoNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageForwardInfoNode.swift index ad44989da9..0239c5e24c 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageForwardInfoNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageForwardInfoNode.swift @@ -8,9 +8,6 @@ import SyncCore import TelegramPresentationData import LocalizedPeerData -private let prefixFont = Font.regular(13.0) -private let peerFont = Font.medium(13.0) - enum ChatMessageForwardInfoType { case bubble(incoming: Bool) case standalone @@ -28,6 +25,10 @@ class ChatMessageForwardInfoNode: ASDisplayNode { let textNodeLayout = TextNode.asyncLayout(maybeNode?.textNode) return { presentationData, strings, type, peer, authorName, constrainedSize in + let fontSize = floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0) + let prefixFont = Font.regular(fontSize) + let peerFont = Font.medium(fontSize) + let peerString: String if let peer = peer { if let authorName = authorName { diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift index cca54e885a..1fc51fde50 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageInteractiveFileNode.swift @@ -19,10 +19,6 @@ private struct FetchControls { let cancel: () -> Void } -private let titleFont = Font.regular(16.0) -private let descriptionFont = Font.regular(13.0) -private let durationFont = Font.regular(11.0) - final class ChatMessageInteractiveFileNode: ASDisplayNode { private let titleNode: TextNode private let descriptionNode: TextNode @@ -68,7 +64,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { private var context: AccountContext? private var message: Message? - private var themeAndStrings: (ChatPresentationThemeData, PresentationStrings, String)? + private var presentationData: ChatPresentationData? private var file: TelegramMediaFile? private var progressFrame: CGRect? private var streamingCacheStatusFrame: CGRect? @@ -202,6 +198,10 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { return { context, presentationData, message, file, automaticDownload, incoming, isRecentActions, forcedResourceStatus, dateAndStatusType, constrainedSize in return (CGFloat.greatestFiniteMagnitude, { constrainedSize in + let titleFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 16.0 / 17.0)) + let descriptionFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0)) + let durationFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 11.0 / 17.0)) + var updateImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>? var updatedStatusSignal: Signal<(FileMediaResourceStatus, MediaResourceStatus?), NoError>? var updatedPlaybackStatusSignal: Signal? @@ -494,8 +494,8 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { } if let statusFrameValue = statusFrame, descriptionFrame.intersects(statusFrameValue) { - fittedLayoutSize.height += 10.0 - statusFrame = statusFrameValue.offsetBy(dx: 0.0, dy: 10.0) + fittedLayoutSize.height += statusFrameValue.height + statusFrame = statusFrameValue.offsetBy(dx: 0.0, dy: statusFrameValue.height) } if let statusFrameValue = statusFrame, let iconFrame = iconFrame, iconFrame.intersects(statusFrameValue) { fittedLayoutSize.height += 15.0 @@ -515,7 +515,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { return (fittedLayoutSize, { [weak self] synchronousLoads in if let strongSelf = self { strongSelf.context = context - strongSelf.themeAndStrings = (presentationData.theme, presentationData.strings, presentationData.dateTimeFormat.decimalSeparator) + strongSelf.presentationData = presentationData strongSelf.message = message strongSelf.file = file @@ -663,7 +663,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { guard let context = self.context else { return } - guard let (presentationData, _, decimalSeparator) = self.themeAndStrings else { + guard let presentationData = self.presentationData else { return } guard let progressFrame = self.progressFrame, let streamingCacheStatusFrame = self.streamingCacheStatusFrame else { @@ -673,7 +673,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { return } let incoming = message.effectivelyIncoming(context.account.peerId) - let messageTheme = incoming ? presentationData.theme.chat.message.incoming : presentationData.theme.chat.message.outgoing + let messageTheme = incoming ? presentationData.theme.theme.chat.message.incoming : presentationData.theme.theme.chat.message.outgoing var isAudio = false var isVoice = false @@ -708,8 +708,9 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { switch fetchStatus { case let .Fetching(_, progress): if let size = file.size { - let compactString = dataSizeString(Int(Float(size) * progress), forceDecimal: true, decimalSeparator: decimalSeparator) - downloadingStrings = ("\(compactString) / \(dataSizeString(size, forceDecimal: true, decimalSeparator: decimalSeparator))", compactString, descriptionFont) + let compactString = dataSizeString(Int(Float(size) * progress), forceDecimal: true, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator) + let descriptionFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0)) + downloadingStrings = ("\(compactString) / \(dataSizeString(size, forceDecimal: true, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator))", compactString, descriptionFont) } default: break @@ -727,6 +728,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { playerDuration = Int32(playerStatus.duration) let durationString = stringForDuration(playerDuration > 0 ? playerDuration : (audioDuration ?? 0), position: playerPosition) + let durationFont = Font.regular(floor(presentationData.fontSize.baseDisplaySize * 11.0 / 17.0)) downloadingStrings = (durationString, durationString, durationFont) } } @@ -757,9 +759,9 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { let statusForegroundColor: UIColor if self.iconNode != nil { - statusForegroundColor = presentationData.theme.chat.message.mediaOverlayControlColors.foregroundColor + statusForegroundColor = presentationData.theme.theme.chat.message.mediaOverlayControlColors.foregroundColor } else { - statusForegroundColor = incoming ? presentationData.theme.chat.message.incoming.mediaControlInnerBackgroundColor : presentationData.theme.chat.message.outgoing.mediaControlInnerBackgroundColor + statusForegroundColor = incoming ? presentationData.theme.theme.chat.message.incoming.mediaControlInnerBackgroundColor : presentationData.theme.theme.chat.message.outgoing.mediaControlInnerBackgroundColor } switch resourceStatus.mediaStatus { case var .fetchStatus(fetchStatus): @@ -798,7 +800,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { let backgroundNodeColor: UIColor if self.iconNode != nil { - backgroundNodeColor = presentationData.theme.chat.message.mediaOverlayControlColors.fillColor + backgroundNodeColor = presentationData.theme.theme.chat.message.mediaOverlayControlColors.fillColor } else { backgroundNodeColor = messageTheme.mediaActiveControlColor } @@ -823,7 +825,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode { if state == .none { self.statusNode = nil } - statusNode.transitionToState(state, animated: animated, synchronous: presentationData.theme.preview, completion: { [weak statusNode] in + statusNode.transitionToState(state, animated: animated, synchronous: presentationData.theme.theme.preview, completion: { [weak statusNode] in if state == .none { statusNode?.removeFromSupernode() } diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift index 4dc9f3022f..d7c1303b7f 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageReplyInfoNode.swift @@ -12,9 +12,6 @@ import LocalizedPeerData import PhotoResources import TelegramStringFormatting -private let titleFont = Font.medium(14.0) -private let textFont = Font.regular(14.0) - enum ChatMessageReplyInfoType { case bubble(incoming: Bool) case standalone @@ -54,6 +51,10 @@ class ChatMessageReplyInfoNode: ASDisplayNode { let previousMediaReference = maybeNode?.previousMediaReference return { presentationData, strings, context, type, message, constrainedSize in + let fontSize = floor(presentationData.fontSize.baseDisplaySize * 14.0 / 17.0) + let titleFont = Font.medium(fontSize) + let textFont = Font.regular(fontSize) + let titleString = message.effectiveAuthor?.displayTitle(strings: strings, displayOrder: presentationData.nameDisplayOrder) ?? strings.User_DeletedAccount let (textString, isMedia) = descriptionStringForMessage(message, strings: strings, nameDisplayOrder: presentationData.nameDisplayOrder, accountPeerId: context.account.peerId) diff --git a/submodules/TelegramUI/TelegramUI/ChatPresentationData.swift b/submodules/TelegramUI/TelegramUI/ChatPresentationData.swift index 6d601590aa..0927b45710 100644 --- a/submodules/TelegramUI/TelegramUI/ChatPresentationData.swift +++ b/submodules/TelegramUI/TelegramUI/ChatPresentationData.swift @@ -6,27 +6,6 @@ import SyncCore import TelegramPresentationData import TelegramUIPreferences -extension PresentationFontSize { - var baseDisplaySize: CGFloat { - switch self { - case .extraSmall: - return 14.0 - case .small: - return 15.0 - case .medium: - return 16.0 - case .regular: - return 17.0 - case .large: - return 19.0 - case .extraLarge: - return 23.0 - case .extraLargeX2: - return 26.0 - } - } -} - public final class ChatPresentationThemeData: Equatable { public let theme: PresentationTheme public let wallpaper: TelegramWallpaper diff --git a/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift b/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift index f3b8b97688..940365d4b1 100644 --- a/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatRecentActionsFilterController.swift @@ -206,23 +206,23 @@ private enum ChatRecentActionsFilterEntry: ItemListNodeEntry { } } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! ChatRecentActionsFilterControllerArguments switch self { case let .actionsTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .allActions(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleAllActions(value) }) case let .actionItem(theme, _, events, text, value): - return ItemListCheckboxItem(theme: theme, title: text, style: .right, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { + return ItemListCheckboxItem(presentationData: presentationData, title: text, style: .right, checked: value, zeroSeparatorInsets: false, sectionId: self.section, action: { arguments.toggleAction(events) }) case let .adminsTitle(theme, text): - return ItemListSectionHeaderItem(theme: theme, text: text, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) case let .allAdmins(theme, text, value): - return ItemListSwitchItem(theme: theme, title: text, value: value, enabled: true, sectionId: self.section, style: .blocks, updated: { value in + return ItemListSwitchItem(presentationData: presentationData, title: text, value: value, enabled: true, sectionId: self.section, style: .blocks, updated: { value in arguments.toggleAllAdmins(value) }) case let .adminPeerItem(theme, strings, dateTimeFormat, nameDisplayOrder, _, participant, checked): @@ -233,7 +233,7 @@ private enum ChatRecentActionsFilterEntry: ItemListNodeEntry { case .member: peerText = strings.ChatAdmins_AdminLabel.capitalized } - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: .text(peerText), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: ItemListPeerItemSwitch(value: checked, style: .check), enabled: true, selectable: true, sectionId: self.section, action: { + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: participant.peer, presence: nil, text: .text(peerText), label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: ItemListPeerItemSwitch(value: checked, style: .check), enabled: true, selectable: true, sectionId: self.section, action: { arguments.toggleAdmin(participant.peer.id) }, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }) @@ -486,8 +486,8 @@ public func channelRecentActionsFilterController(context: AccountContext, peer: let previous = previousPeers previousPeers = sortedAdmins - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.ChatAdmins_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) - let listState = ItemListNodeState(entries: channelRecentActionsFilterControllerEntries(presentationData: presentationData, accountPeerId: context.account.peerId, peer: peer, state: state, participants: sortedAdmins), style: .blocks, animateChanges: previous != nil && admins != nil && previous!.count >= sortedAdmins!.count) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.ChatAdmins_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelRecentActionsFilterControllerEntries(presentationData: presentationData, accountPeerId: context.account.peerId, peer: peer, state: state, participants: sortedAdmins), style: .blocks, animateChanges: previous != nil && admins != nil && previous!.count >= sortedAdmins!.count) return (controllerState, (listState, arguments)) } diff --git a/submodules/TelegramUI/TelegramUI/ChatSearchResultsContollerNode.swift b/submodules/TelegramUI/TelegramUI/ChatSearchResultsContollerNode.swift index b5f82bd021..0bea41fe5d 100644 --- a/submodules/TelegramUI/TelegramUI/ChatSearchResultsContollerNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatSearchResultsContollerNode.swift @@ -136,7 +136,7 @@ class ChatSearchResultsControllerNode: ViewControllerTracingNode, UIScrollViewDe self.searchResult = searchResult self.searchState = searchState self.presentationData = context.sharedContext.currentPresentationData.with { $0 } - self.presentationDataPromise = Promise(ChatListPresentationData(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations)) + self.presentationDataPromise = Promise(ChatListPresentationData(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations)) self.listNode = ListView() self.listNode.verticalScrollIndicatorColor = self.presentationData.theme.list.scrollIndicatorColor @@ -273,7 +273,7 @@ class ChatSearchResultsControllerNode: ViewControllerTracingNode, UIScrollViewDe func updatePresentationData(_ presentationData: PresentationData) { let previousTheme = self.presentationData.theme self.presentationData = presentationData - self.presentationDataPromise.set(.single(ChatListPresentationData(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations))) + self.presentationDataPromise.set(.single(ChatListPresentationData(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations))) } private func enqueueTransition(_ transition: ChatListSearchContainerTransition, firstTime: Bool) { diff --git a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift index cb22e5ca92..0a10a4e024 100644 --- a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift @@ -398,7 +398,7 @@ func chatTextLinkEditController(sharedContext: SharedAccountContext, account: Ac applyImpl?() })] - let contentNode = ChatTextLinkEditAlertContentNode(theme: AlertControllerTheme(presentationTheme: presentationData.theme), ptheme: presentationData.theme, strings: presentationData.strings, actions: actions, text: text, link: link) + let contentNode = ChatTextLinkEditAlertContentNode(theme: AlertControllerTheme(presentationData: presentationData), ptheme: presentationData.theme, strings: presentationData.strings, actions: actions, text: text, link: link) contentNode.complete = { applyImpl?() } @@ -415,9 +415,9 @@ func chatTextLinkEditController(sharedContext: SharedAccountContext, account: Ac } } - let controller = AlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), contentNode: contentNode) + let controller = AlertController(theme: AlertControllerTheme(presentationData: presentationData), contentNode: contentNode) let presentationDataDisposable = sharedContext.presentationData.start(next: { [weak controller, weak contentNode] presentationData in - controller?.theme = AlertControllerTheme(presentationTheme: presentationData.theme) + controller?.theme = AlertControllerTheme(presentationData: presentationData) contentNode?.inputFieldNode.updateTheme(presentationData.theme) }) controller.dismissed = { diff --git a/submodules/TelegramUI/TelegramUI/CreateChannelController.swift b/submodules/TelegramUI/TelegramUI/CreateChannelController.swift index dab232f8c5..c7d1b3dccb 100644 --- a/submodules/TelegramUI/TelegramUI/CreateChannelController.swift +++ b/submodules/TelegramUI/TelegramUI/CreateChannelController.swift @@ -135,24 +135,24 @@ private enum CreateChannelEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! CreateChannelArguments switch self { case let .channelInfo(theme, strings, dateTimeFormat, peer, state, avatar): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: nil, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .generic, peer: peer, presence: nil, cachedData: nil, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { }, updatingImage: avatar, tag: CreateChannelEntryTag.info) case let .setProfilePhoto(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.changeProfilePhoto() }) case let .descriptionSetup(theme, text, value): - return ItemListMultilineInputItem(theme: theme, text: value, placeholder: text, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in + return ItemListMultilineInputItem(presentationData: presentationData, text: value, placeholder: text, maxLength: ItemListMultilineInputItemTextLimit(value: 255, display: true), sectionId: self.section, style: .blocks, textUpdated: { updatedText in arguments.updateEditingDescriptionText(updatedText) }) case let .descriptionInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) } } } @@ -372,8 +372,8 @@ public func createChannelController(context: AccountContext) -> ViewController { }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.ChannelIntro_CreateChannel), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: CreateChannelEntries(presentationData: presentationData, state: state), style: .blocks, focusItemTag: CreateChannelEntryTag.info) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.ChannelIntro_CreateChannel), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: CreateChannelEntries(presentationData: presentationData, state: state), style: .blocks, focusItemTag: CreateChannelEntryTag.info) return (controllerState, (listState, arguments)) } |> afterDisposed { diff --git a/submodules/TelegramUI/TelegramUI/CreateGroupController.swift b/submodules/TelegramUI/TelegramUI/CreateGroupController.swift index 05bef848e0..2a34d42964 100644 --- a/submodules/TelegramUI/TelegramUI/CreateGroupController.swift +++ b/submodules/TelegramUI/TelegramUI/CreateGroupController.swift @@ -229,34 +229,34 @@ private enum CreateGroupEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! CreateGroupArguments switch self { case let .groupInfo(theme, strings, dateTimeFormat, peer, state, avatar): - return ItemListAvatarAndNameInfoItem(account: arguments.account, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, mode: .editSettings, peer: peer, presence: nil, cachedData: nil, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in + return ItemListAvatarAndNameInfoItem(account: arguments.account, presentationData: presentationData, dateTimeFormat: dateTimeFormat, mode: .editSettings, peer: peer, presence: nil, cachedData: nil, state: state, sectionId: ItemListSectionId(self.section), style: .blocks(withTopInset: false, withExtendedBottomInset: false), editingNameUpdated: { editingName in arguments.updateEditingName(editingName) }, avatarTapped: { arguments.changeProfilePhoto() }, updatingImage: avatar, tag: CreateGroupEntryTag.info) case let .setProfilePhoto(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.changeProfilePhoto() }) case let .member(_, theme, strings, dateTimeFormat, nameDisplayOrder, peer, presence): - return ItemListPeerItem(theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: presence, text: .presence, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: nil, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }) + return ItemListPeerItem(presentationData: presentationData, dateTimeFormat: dateTimeFormat, nameDisplayOrder: nameDisplayOrder, account: arguments.account, peer: peer, presence: presence, text: .presence, label: .none, editing: ItemListPeerItemEditing(editable: false, editing: false, revealed: false), switchValue: nil, enabled: true, selectable: true, sectionId: self.section, action: nil, setPeerIdWithRevealedOptions: { _, _ in }, removePeer: { _ in }) case let .locationHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .location(theme, location): let imageSignal = chatMapSnapshotImage(account: arguments.account, resource: MapSnapshotMediaResource(latitude: location.latitude, longitude: location.longitude, width: 90, height: 90)) return ItemListAddressItem(theme: theme, label: "", text: location.address.replacingOccurrences(of: ", ", with: "\n"), imageSignal: imageSignal, selected: nil, sectionId: self.section, style: .blocks, action: nil) case let .changeLocation(theme, text): - return ItemListActionItem(theme: theme, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: text, kind: .generic, alignment: .natural, sectionId: ItemListSectionId(self.section), style: .blocks, action: { arguments.changeLocation() }, clearHighlightAutomatically: false) case let .locationInfo(theme, text): - return ItemListTextItem(theme: theme, text: .plain(text), sectionId: self.section) + return ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: self.section) case let .venueHeader(theme, title): - return ItemListSectionHeaderItem(theme: theme, text: title, sectionId: self.section) + return ItemListSectionHeaderItem(presentationData: presentationData, text: title, sectionId: self.section) case let .venue(_, theme, venue): return ItemListVenueItem(theme: theme, account: arguments.account, venue: venue, sectionId: self.section, action: { arguments.updateWithVenue(venue) @@ -705,8 +705,8 @@ public func createGroupControllerImpl(context: AccountContext, peerIds: [PeerId] }) } - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Compose_NewGroupTitle), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: createGroupEntries(presentationData: presentationData, state: state, peerIds: peerIds, view: view, venues: venues), style: .blocks, focusItemTag: CreateGroupEntryTag.info) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Compose_NewGroupTitle), leftNavigationButton: nil, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: createGroupEntries(presentationData: presentationData, state: state, peerIds: peerIds, view: view, venues: venues), style: .blocks, focusItemTag: CreateGroupEntryTag.info) return (controllerState, (listState, arguments)) } diff --git a/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift b/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift index 2ce3de8038..6bd2dc85e8 100644 --- a/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift +++ b/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift @@ -46,7 +46,7 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur present(textAlertController(context: context, title: nil, text: presentationData.strings.Resolve_ErrorNotFound, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) } case .inaccessiblePeer: - present(standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: nil, text: presentationData.strings.Conversation_ErrorInaccessibleMessage, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) + present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: presentationData.strings.Conversation_ErrorInaccessibleMessage, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) case let .botStart(peerId, payload): openPeer(peerId, .withBotStartPayload(ChatControllerInitialBotStart(payload: payload, behavior: .interactive))) case let .groupBotStart(botPeerId, payload): diff --git a/submodules/TelegramUI/TelegramUI/PeerSelectionControllerNode.swift b/submodules/TelegramUI/TelegramUI/PeerSelectionControllerNode.swift index a8236e890c..61ee08616b 100644 --- a/submodules/TelegramUI/TelegramUI/PeerSelectionControllerNode.swift +++ b/submodules/TelegramUI/TelegramUI/PeerSelectionControllerNode.swift @@ -85,7 +85,7 @@ final class PeerSelectionControllerNode: ASDisplayNode { } - self.chatListNode = ChatListNode(context: context, groupId: .root, controlsHistoryPreload: false, mode: .peers(filter: filter), theme: presentationData.theme, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations) + self.chatListNode = ChatListNode(context: context, groupId: .root, controlsHistoryPreload: false, mode: .peers(filter: filter), theme: presentationData.theme, fontSize: presentationData.fontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameSortOrder: presentationData.nameSortOrder, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: presentationData.disableAnimations) super.init() @@ -145,7 +145,7 @@ final class PeerSelectionControllerNode: ASDisplayNode { private func updateThemeAndStrings() { self.backgroundColor = self.presentationData.theme.chatList.backgroundColor self.searchDisplayController?.updatePresentationData(self.presentationData) - self.chatListNode.updateThemeAndStrings(theme: self.presentationData.theme, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) + self.chatListNode.updateThemeAndStrings(theme: self.presentationData.theme, fontSize: self.presentationData.fontSize, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, nameSortOrder: self.presentationData.nameSortOrder, nameDisplayOrder: self.presentationData.nameDisplayOrder, disableAnimations: self.presentationData.disableAnimations) self.toolbarBackgroundNode?.backgroundColor = self.presentationData.theme.rootController.navigationBar.backgroundColor self.toolbarSeparatorNode?.backgroundColor = self.presentationData.theme.rootController.navigationBar.separatorColor diff --git a/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping b/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping index a66ee473aa..a6b2ce5e18 100644 Binary files a/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping and b/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping differ diff --git a/submodules/TelegramUI/TelegramUI/ShareExtensionContext.swift b/submodules/TelegramUI/TelegramUI/ShareExtensionContext.swift index a75d65678b..f667a98f59 100644 --- a/submodules/TelegramUI/TelegramUI/ShareExtensionContext.swift +++ b/submodules/TelegramUI/TelegramUI/ShareExtensionContext.swift @@ -388,7 +388,7 @@ public class ShareRootControllerImpl { return } let presentationData = internalContext.sharedContext.currentPresentationData.with { $0 } - let controller = standardTextAlertController(theme: AlertControllerTheme(presentationTheme: presentationData.theme), title: presentationData.strings.Share_AuthTitle, text: presentationData.strings.Share_AuthDescription, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { + let controller = standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: presentationData.strings.Share_AuthTitle, text: presentationData.strings.Share_AuthDescription, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: { self?.getExtensionContext()?.completeRequest(returningItems: nil, completionHandler: nil) })]) strongSelf.mainWindow?.present(controller, on: .root) diff --git a/submodules/TelegramUI/TelegramUI/ThemeUpdateManager.swift b/submodules/TelegramUI/TelegramUI/ThemeUpdateManager.swift index 10e531c358..0453138234 100644 --- a/submodules/TelegramUI/TelegramUI/ThemeUpdateManager.swift +++ b/submodules/TelegramUI/TelegramUI/ThemeUpdateManager.swift @@ -139,7 +139,7 @@ final class ThemeUpdateManagerImpl: ThemeUpdateManager { theme = updatedTheme } - return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: current.themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }) }).start() } diff --git a/submodules/TelegramUI/TelegramUI/WalletContextImpl.swift b/submodules/TelegramUI/TelegramUI/WalletContextImpl.swift index bc76fed87d..b57bb672ca 100644 --- a/submodules/TelegramUI/TelegramUI/WalletContextImpl.swift +++ b/submodules/TelegramUI/TelegramUI/WalletContextImpl.swift @@ -199,7 +199,7 @@ final class WalletContextImpl: WalletContext { statusBarStyle: theme.rootController.statusBarStyle.style, navigationBar: navigationBarData.theme, keyboardAppearance: theme.rootController.keyboardColor.keyboardAppearance, - alert: AlertControllerTheme(presentationTheme: theme), + alert: AlertControllerTheme(presentationData: presentationData), actionSheet: ActionSheetControllerTheme(presentationTheme: theme) ), strings: WalletStrings( primaryComponent: WalletStringsComponent( diff --git a/submodules/TelegramUI/TelegramUI/WallpaperUploadManager.swift b/submodules/TelegramUI/TelegramUI/WallpaperUploadManager.swift index 24147f13b1..1d7c5af56d 100644 --- a/submodules/TelegramUI/TelegramUI/WallpaperUploadManager.swift +++ b/submodules/TelegramUI/TelegramUI/WallpaperUploadManager.swift @@ -127,7 +127,7 @@ final class WallpaperUploadManagerImpl: WallpaperUploadManager { var themeSpecificChatWallpapers = current.themeSpecificChatWallpapers themeSpecificChatWallpapers[current.theme.index] = updatedWallpaper - return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) + return PresentationThemeSettings(theme: current.theme, themeSpecificAccentColors: current.themeSpecificAccentColors, themeSpecificBubbleColors: current.themeSpecificBubbleColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, useSystemFont: current.useSystemFont, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) })).start() } } diff --git a/submodules/TelegramUIPreferences/Sources/PresentationThemeSettings.swift b/submodules/TelegramUIPreferences/Sources/PresentationThemeSettings.swift index 9bfb92500d..48389bc35e 100644 --- a/submodules/TelegramUIPreferences/Sources/PresentationThemeSettings.swift +++ b/submodules/TelegramUIPreferences/Sources/PresentationThemeSettings.swift @@ -196,7 +196,7 @@ public enum PresentationThemeReference: PostboxCoding, Equatable { } } -public enum PresentationFontSize: Int32 { +public enum PresentationFontSize: Int32, CaseIterable { case extraSmall = 0 case small = 1 case regular = 2 @@ -424,6 +424,7 @@ public struct PresentationThemeSettings: PreferencesEntry { public var themeSpecificAccentColors: [Int64: PresentationThemeAccentColor] public var themeSpecificBubbleColors: [Int64: PresentationThemeColorPair] public var themeSpecificChatWallpapers: [Int64: TelegramWallpaper] + public var useSystemFont: Bool public var fontSize: PresentationFontSize public var automaticThemeSwitchSetting: AutomaticThemeSwitchSetting public var largeEmoji: Bool @@ -465,14 +466,15 @@ public struct PresentationThemeSettings: PreferencesEntry { } public static var defaultSettings: PresentationThemeSettings { - return PresentationThemeSettings(theme: .builtin(.dayClassic), themeSpecificAccentColors: [:], themeSpecificBubbleColors: [:], themeSpecificChatWallpapers: [:], fontSize: .regular, automaticThemeSwitchSetting: AutomaticThemeSwitchSetting(trigger: .system, theme: .builtin(.night)), largeEmoji: true, disableAnimations: true) + return PresentationThemeSettings(theme: .builtin(.dayClassic), themeSpecificAccentColors: [:], themeSpecificBubbleColors: [:], themeSpecificChatWallpapers: [:], useSystemFont: true, fontSize: .regular, automaticThemeSwitchSetting: AutomaticThemeSwitchSetting(trigger: .system, theme: .builtin(.night)), largeEmoji: true, disableAnimations: true) } - public init(theme: PresentationThemeReference, themeSpecificAccentColors: [Int64: PresentationThemeAccentColor], themeSpecificBubbleColors: [Int64: PresentationThemeColorPair], themeSpecificChatWallpapers: [Int64: TelegramWallpaper], fontSize: PresentationFontSize, automaticThemeSwitchSetting: AutomaticThemeSwitchSetting, largeEmoji: Bool, disableAnimations: Bool) { + public init(theme: PresentationThemeReference, themeSpecificAccentColors: [Int64: PresentationThemeAccentColor], themeSpecificBubbleColors: [Int64: PresentationThemeColorPair], themeSpecificChatWallpapers: [Int64: TelegramWallpaper], useSystemFont: Bool, fontSize: PresentationFontSize, automaticThemeSwitchSetting: AutomaticThemeSwitchSetting, largeEmoji: Bool, disableAnimations: Bool) { self.theme = theme self.themeSpecificAccentColors = themeSpecificAccentColors self.themeSpecificBubbleColors = themeSpecificBubbleColors self.themeSpecificChatWallpapers = themeSpecificChatWallpapers + self.useSystemFont = useSystemFont self.fontSize = fontSize self.automaticThemeSwitchSetting = automaticThemeSwitchSetting self.largeEmoji = largeEmoji @@ -500,6 +502,7 @@ public struct PresentationThemeSettings: PreferencesEntry { return PresentationThemeColorPair(decoder: decoder) }) + self.useSystemFont = decoder.decodeInt32ForKey("useSystemFont", orElse: 1) != 0 self.fontSize = PresentationFontSize(rawValue: decoder.decodeInt32ForKey("f", orElse: PresentationFontSize.regular.rawValue)) ?? .regular self.automaticThemeSwitchSetting = (decoder.decodeObjectForKey("automaticThemeSwitchSetting", decoder: { AutomaticThemeSwitchSetting(decoder: $0) }) as? AutomaticThemeSwitchSetting) ?? AutomaticThemeSwitchSetting(trigger: .system, theme: .builtin(.night)) self.largeEmoji = decoder.decodeBoolForKey("largeEmoji", orElse: true) @@ -517,6 +520,7 @@ public struct PresentationThemeSettings: PreferencesEntry { encoder.encodeObjectDictionary(self.themeSpecificChatWallpapers, forKey: "themeSpecificChatWallpapers", keyEncoder: { key, encoder in encoder.encodeInt64(key, forKey: "k") }) + encoder.encodeInt32(self.useSystemFont ? 1 : 0, forKey: "useSystemFont") encoder.encodeInt32(self.fontSize.rawValue, forKey: "f") encoder.encodeObject(self.automaticThemeSwitchSetting, forKey: "automaticThemeSwitchSetting") encoder.encodeBool(self.largeEmoji, forKey: "largeEmoji") @@ -532,7 +536,7 @@ public struct PresentationThemeSettings: PreferencesEntry { } public static func ==(lhs: PresentationThemeSettings, rhs: PresentationThemeSettings) -> Bool { - return lhs.theme == rhs.theme && lhs.themeSpecificAccentColors == rhs.themeSpecificAccentColors && lhs.themeSpecificBubbleColors == rhs.themeSpecificBubbleColors && lhs.themeSpecificChatWallpapers == rhs.themeSpecificChatWallpapers && lhs.fontSize == rhs.fontSize && lhs.automaticThemeSwitchSetting == rhs.automaticThemeSwitchSetting && lhs.largeEmoji == rhs.largeEmoji && lhs.disableAnimations == rhs.disableAnimations + return lhs.theme == rhs.theme && lhs.themeSpecificAccentColors == rhs.themeSpecificAccentColors && lhs.themeSpecificBubbleColors == rhs.themeSpecificBubbleColors && lhs.themeSpecificChatWallpapers == rhs.themeSpecificChatWallpapers && lhs.useSystemFont == rhs.useSystemFont && lhs.fontSize == rhs.fontSize && lhs.automaticThemeSwitchSetting == rhs.automaticThemeSwitchSetting && lhs.largeEmoji == rhs.largeEmoji && lhs.disableAnimations == rhs.disableAnimations } } diff --git a/submodules/TelegramUpdateUI/Sources/UpdateInfoController.swift b/submodules/TelegramUpdateUI/Sources/UpdateInfoController.swift index 4ffa10b036..ebf7e3e051 100644 --- a/submodules/TelegramUpdateUI/Sources/UpdateInfoController.swift +++ b/submodules/TelegramUpdateUI/Sources/UpdateInfoController.swift @@ -68,7 +68,7 @@ private enum UpdateInfoControllerEntry: ItemListNodeEntry { return lhs.stableId < rhs.stableId } - func item(_ arguments: Any) -> ListViewItem { + func item(presentationData: ItemListPresentationData, arguments: Any) -> ListViewItem { let arguments = arguments as! UpdateInfoControllerArguments switch self { case let .info(theme, icon, title, text, entities): @@ -76,7 +76,7 @@ private enum UpdateInfoControllerEntry: ItemListNodeEntry { arguments.linkAction(action, itemLink) }) case let .update(theme, title): - return ItemListActionItem(theme: theme, title: title, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { + return ItemListActionItem(presentationData: presentationData, title: title, kind: .generic, alignment: .center, sectionId: self.section, style: .blocks, action: { arguments.openAppStorePage() }) } @@ -121,8 +121,8 @@ public func updateInfoController(context: AccountContext, appUpdateInfo: AppUpda let leftNavigationButton = appUpdateInfo.blocking ? nil : ItemListNavigationButton(content: .text(presentationData.strings.Update_Skip), style: .regular, enabled: true, action: { dismissImpl?() }) - let controllerState = ItemListControllerState(theme: presentationData.theme, title: .text(presentationData.strings.Update_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) - let listState = ItemListNodeState(entries: updateInfoControllerEntries(theme: presentationData.theme, strings: presentationData.strings, appIcon: appIcon, appUpdateInfo: appUpdateInfo), style: .blocks, animateChanges: false) + let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text(presentationData.strings.Update_Title), leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) + let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: updateInfoControllerEntries(theme: presentationData.theme, strings: presentationData.strings, appIcon: appIcon, appUpdateInfo: appUpdateInfo), style: .blocks, animateChanges: false) return (controllerState, (listState, arguments)) }