mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various improvements
This commit is contained in:
parent
75dbdec6f6
commit
ac2733985a
@ -11683,7 +11683,10 @@ Sorry for the inconvenience.";
|
||||
"Monetization.AdRevenueTitle" = "AD REVENUE";
|
||||
"Monetization.OverviewTitle" = "PROCEEDS OVERVIEW";
|
||||
"Monetization.BalanceTitle" = "AVAILABLE BALANCE";
|
||||
"Monetization.BalanceInfo" = "You will be able to collect rewards using Fragment, a third-party platform used by advertisers to pay for ads. [Learn More >]()";
|
||||
"Monetization.Balance.ZeroInfo" = "You will be able to collect rewards using Fragment, a third-party platform used by advertisers to pay for ads. [Learn More >]()";
|
||||
"Monetization.Balance.AvailableInfo" = "You can collect your reward using Fragment, a third-party platform used by advertisers to pay for ads. [Learn More >]()";
|
||||
"Monetization.Balance.ComingLaterInfo" = "By the end of May, you will be able to collect rewards using Fragment, a third-party platform used by advertisers to pay for ads. [Learn More >]()";
|
||||
|
||||
"Monetization.BalanceInfo_URL" = "https://telegram.org";
|
||||
"Monetization.BalanceWithdraw" = "Withdraw via Fragment";
|
||||
"Monetization.TransactionsTitle" = "TRANSACTION HISTORY";
|
||||
|
@ -1008,7 +1008,7 @@ public protocol SharedAccountContext: AnyObject {
|
||||
func makePremiumPrivacyControllerController(context: AccountContext, subject: PremiumPrivacySubject, peerId: EnginePeer.Id) -> ViewController
|
||||
func makePremiumBoostLevelsController(context: AccountContext, peerId: EnginePeer.Id, subject: BoostSubject, boostStatus: ChannelBoostStatus, myBoostStatus: MyBoostStatus, forceDark: Bool, openStats: (() -> Void)?) -> ViewController
|
||||
|
||||
func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], isEditing: Bool, parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?) -> ViewController
|
||||
func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], isEditing: Bool, expandIfNeeded: Bool, parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?) -> ViewController
|
||||
|
||||
func makeMediaPickerScreen(context: AccountContext, hasSearch: Bool, completion: @escaping (Any) -> Void) -> ViewController
|
||||
|
||||
|
@ -429,7 +429,7 @@ final class PeekControllerNode: ViewControllerTracingNode {
|
||||
|
||||
let previousBlurAlpha = self.blurView.alpha
|
||||
self.blurView.alpha = 1.0
|
||||
self.blurView.layer.animateAlpha(from: previousBlurAlpha, to: self.blurView.alpha, duration: 0.3)
|
||||
self.blurView.layer.animateAlpha(from: previousBlurAlpha, to: self.blurView.alpha, duration: 0.25)
|
||||
|
||||
let previousDarkDimAlpha = self.darkDimNode.alpha
|
||||
self.darkDimNode.alpha = 1.0
|
||||
@ -450,7 +450,7 @@ final class PeekControllerNode: ViewControllerTracingNode {
|
||||
if immediately {
|
||||
animateIn()
|
||||
} else {
|
||||
Queue.mainQueue().after(0.15, animateIn)
|
||||
Queue.mainQueue().after(0.02, animateIn)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3270,7 +3270,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
||||
if let emojiFile = state?.emojiFile, let controller = environment?.controller() as? PremiumIntroScreen, let navigationController = controller.navigationController as? NavigationController {
|
||||
for attribute in emojiFile.attributes {
|
||||
if case let .CustomEmoji(_, _, _, packReference) = attribute, let packReference = packReference {
|
||||
let controller = accountContext.sharedContext.makeStickerPackScreen(context: accountContext, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: loadedEmojiPack.flatMap { [$0] } ?? [], isEditing: false, parentNavigationController: navigationController, sendSticker: { _, _, _ in
|
||||
let controller = accountContext.sharedContext.makeStickerPackScreen(context: accountContext, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: loadedEmojiPack.flatMap { [$0] } ?? [], isEditing: false, expandIfNeeded: false, parentNavigationController: navigationController, sendSticker: { _, _, _ in
|
||||
return false
|
||||
})
|
||||
presentController(controller)
|
||||
|
@ -225,7 +225,7 @@ private enum StatsEntry: ItemListNodeEntry {
|
||||
case adsProceedsOverview(PresentationTheme, RevenueStats, TelegramMediaFile?)
|
||||
|
||||
case adsBalanceTitle(PresentationTheme, String)
|
||||
case adsBalance(PresentationTheme, RevenueStats, Bool, TelegramMediaFile?)
|
||||
case adsBalance(PresentationTheme, RevenueStats, Bool, Bool, TelegramMediaFile?)
|
||||
case adsBalanceInfo(PresentationTheme, String)
|
||||
|
||||
case adsTransactionsTitle(PresentationTheme, String)
|
||||
@ -739,8 +739,8 @@ private enum StatsEntry: ItemListNodeEntry {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case let .adsBalance(lhsTheme, lhsStats, lhsCanWithdraw, lhsAnimatedEmoji):
|
||||
if case let .adsBalance(rhsTheme, rhsStats, rhsCanWithdraw, rhsAnimatedEmoji) = rhs, lhsTheme === rhsTheme, lhsStats == rhsStats, lhsCanWithdraw == rhsCanWithdraw, lhsAnimatedEmoji == rhsAnimatedEmoji {
|
||||
case let .adsBalance(lhsTheme, lhsStats, lhsCanWithdraw, lhsIsEnabled, lhsAnimatedEmoji):
|
||||
if case let .adsBalance(rhsTheme, rhsStats, rhsCanWithdraw, rhsIsEnabled, rhsAnimatedEmoji) = rhs, lhsTheme === rhsTheme, lhsStats == rhsStats, lhsCanWithdraw == rhsCanWithdraw, lhsIsEnabled == rhsIsEnabled, lhsAnimatedEmoji == rhsAnimatedEmoji {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
@ -961,13 +961,14 @@ private enum StatsEntry: ItemListNodeEntry {
|
||||
})
|
||||
case let .adsProceedsOverview(_, stats, animatedEmoji):
|
||||
return StatsOverviewItem(context: arguments.context, presentationData: presentationData, isGroup: false, stats: stats, animatedEmoji: animatedEmoji, sectionId: self.section, style: .blocks)
|
||||
case let .adsBalance(_, stats, canWithdraw, animatedEmoji):
|
||||
case let .adsBalance(_, stats, canWithdraw, isEnabled, animatedEmoji):
|
||||
return MonetizationBalanceItem(
|
||||
context: arguments.context,
|
||||
presentationData: presentationData,
|
||||
stats: stats,
|
||||
animatedEmoji: animatedEmoji,
|
||||
canWithdraw: canWithdraw,
|
||||
isEnabled: isEnabled,
|
||||
withdrawAction: {
|
||||
arguments.requestWithdraw()
|
||||
},
|
||||
@ -1110,7 +1111,7 @@ private struct ChannelStatsControllerState: Equatable {
|
||||
}
|
||||
|
||||
func withUpdatedTransactionsExpanded(_ transactionsExpanded: Bool) -> ChannelStatsControllerState {
|
||||
return ChannelStatsControllerState(section: self.section, boostersExpanded: self.boostersExpanded, moreBoostersDisplayed: self.moreBoostersDisplayed, giftsSelected: self.giftsSelected, transactionsExpanded: self.transactionsExpanded, moreTransactionsDisplayed: self.moreTransactionsDisplayed)
|
||||
return ChannelStatsControllerState(section: self.section, boostersExpanded: self.boostersExpanded, moreBoostersDisplayed: self.moreBoostersDisplayed, giftsSelected: self.giftsSelected, transactionsExpanded: transactionsExpanded, moreTransactionsDisplayed: self.moreTransactionsDisplayed)
|
||||
}
|
||||
|
||||
func withUpdatedMoreTransactionsDisplayed(_ moreTransactionsDisplayed: Int32) -> ChannelStatsControllerState {
|
||||
@ -1363,7 +1364,8 @@ private func monetizationEntries(
|
||||
transactionsInfo: RevenueStatsTransactionsContext.State,
|
||||
adsRestricted: Bool,
|
||||
animatedEmojis: [String: [StickerPackItem]],
|
||||
premiumConfiguration: PremiumConfiguration
|
||||
premiumConfiguration: PremiumConfiguration,
|
||||
monetizationConfiguration: MonetizationConfiguration
|
||||
) -> [StatsEntry] {
|
||||
let diamond = animatedEmojis["💎"]?.first?.file
|
||||
|
||||
@ -1383,15 +1385,25 @@ private func monetizationEntries(
|
||||
entries.append(.adsProceedsTitle(presentationData.theme, presentationData.strings.Monetization_OverviewTitle))
|
||||
entries.append(.adsProceedsOverview(presentationData.theme, data, diamond))
|
||||
|
||||
|
||||
var withdrawalAvailable = false
|
||||
if let peer, case let .channel(channel) = peer, channel.flags.contains(.isCreator) && data.availableBalance > 0 {
|
||||
if let peer, case let .channel(channel) = peer, channel.flags.contains(.isCreator) {
|
||||
withdrawalAvailable = true
|
||||
}
|
||||
entries.append(.adsBalanceTitle(presentationData.theme, presentationData.strings.Monetization_BalanceTitle))
|
||||
entries.append(.adsBalance(presentationData.theme, data, withdrawalAvailable, diamond))
|
||||
entries.append(.adsBalanceInfo(presentationData.theme, presentationData.strings.Monetization_BalanceInfo))
|
||||
|
||||
entries.append(.adsBalance(presentationData.theme, data, withdrawalAvailable && data.availableBalance > 0, monetizationConfiguration.withdrawalAvailable, diamond))
|
||||
|
||||
if withdrawalAvailable {
|
||||
let withdrawalInfoText: String
|
||||
if data.availableBalance == 0 {
|
||||
withdrawalInfoText = presentationData.strings.Monetization_Balance_ZeroInfo
|
||||
} else if monetizationConfiguration.withdrawalAvailable {
|
||||
withdrawalInfoText = presentationData.strings.Monetization_Balance_AvailableInfo
|
||||
} else {
|
||||
withdrawalInfoText = presentationData.strings.Monetization_Balance_ComingLaterInfo
|
||||
}
|
||||
entries.append(.adsBalanceInfo(presentationData.theme, withdrawalInfoText))
|
||||
}
|
||||
|
||||
if !transactionsInfo.transactions.isEmpty {
|
||||
entries.append(.adsTransactionsTitle(presentationData.theme, presentationData.strings.Monetization_TransactionsTitle))
|
||||
|
||||
@ -1450,7 +1462,8 @@ private func channelStatsControllerEntries(
|
||||
revenueState: RevenueStats?,
|
||||
revenueTransactions: RevenueStatsTransactionsContext.State,
|
||||
adsRestricted: Bool,
|
||||
premiumConfiguration: PremiumConfiguration
|
||||
premiumConfiguration: PremiumConfiguration,
|
||||
monetizationConfiguration: MonetizationConfiguration
|
||||
) -> [StatsEntry] {
|
||||
switch state.section {
|
||||
case .stats:
|
||||
@ -1488,7 +1501,8 @@ private func channelStatsControllerEntries(
|
||||
transactionsInfo: revenueTransactions,
|
||||
adsRestricted: adsRestricted,
|
||||
animatedEmojis: animatedEmojis,
|
||||
premiumConfiguration: premiumConfiguration
|
||||
premiumConfiguration: premiumConfiguration,
|
||||
monetizationConfiguration: monetizationConfiguration
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -1503,6 +1517,7 @@ public func channelStatsController(context: AccountContext, updatedPresentationD
|
||||
}
|
||||
|
||||
let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 })
|
||||
let monetizationConfiguration = MonetizationConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 })
|
||||
|
||||
var openPostStatsImpl: ((EnginePeer, StatsPostItem) -> Void)?
|
||||
var openStoryImpl: ((EngineStoryItem, UIView) -> Void)?
|
||||
@ -1869,7 +1884,7 @@ public func channelStatsController(context: AccountContext, updatedPresentationD
|
||||
}
|
||||
|
||||
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: title, leftNavigationButton: leftNavigationButton, rightNavigationButton: nil, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back), animateChanges: true)
|
||||
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelStatsControllerEntries(presentationData: presentationData, state: state, peer: peer, data: data, messages: messages, stories: stories, interactions: interactions, boostData: boostData, boostersState: boostersState, giftsState: giftsState, giveawayAvailable: premiumConfiguration.giveawayGiftsPurchaseAvailable, isGroup: isGroup, boostsOnly: boostsOnly, animatedEmojis: animatedEmojiStickers, revenueState: revenueState?.stats, revenueTransactions: revenueTransactions, adsRestricted: adsRestricted, premiumConfiguration: premiumConfiguration), style: .blocks, emptyStateItem: emptyStateItem, headerItem: headerItem, crossfadeState: previous == nil, animateChanges: false)
|
||||
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: channelStatsControllerEntries(presentationData: presentationData, state: state, peer: peer, data: data, messages: messages, stories: stories, interactions: interactions, boostData: boostData, boostersState: boostersState, giftsState: giftsState, giveawayAvailable: premiumConfiguration.giveawayGiftsPurchaseAvailable, isGroup: isGroup, boostsOnly: boostsOnly, animatedEmojis: animatedEmojiStickers, revenueState: revenueState?.stats, revenueTransactions: revenueTransactions, adsRestricted: adsRestricted, premiumConfiguration: premiumConfiguration, monetizationConfiguration: monetizationConfiguration), style: .blocks, emptyStateItem: emptyStateItem, headerItem: headerItem, crossfadeState: previous == nil, animateChanges: false)
|
||||
|
||||
return (controllerState, (listState, arguments))
|
||||
}
|
||||
@ -2143,3 +2158,23 @@ final class ChannelStatsContextExtractedContentSource: ContextExtractedContentSo
|
||||
return ContextControllerPutBackViewInfo(contentAreaInScreenSpace: UIScreen.main.bounds)
|
||||
}
|
||||
}
|
||||
|
||||
private struct MonetizationConfiguration {
|
||||
static var defaultValue: MonetizationConfiguration {
|
||||
return MonetizationConfiguration(withdrawalAvailable: false)
|
||||
}
|
||||
|
||||
public let withdrawalAvailable: Bool
|
||||
|
||||
fileprivate init(withdrawalAvailable: Bool) {
|
||||
self.withdrawalAvailable = withdrawalAvailable
|
||||
}
|
||||
|
||||
static func with(appConfiguration: AppConfiguration) -> MonetizationConfiguration {
|
||||
if let data = appConfiguration.data, let withdrawalAvailable = data["channel_revenue_withdrawal_enabled"] as? Bool {
|
||||
return MonetizationConfiguration(withdrawalAvailable: withdrawalAvailable)
|
||||
} else {
|
||||
return .defaultValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ final class MonetizationBalanceItem: ListViewItem, ItemListItem {
|
||||
let stats: RevenueStats
|
||||
let animatedEmoji: TelegramMediaFile?
|
||||
let canWithdraw: Bool
|
||||
let isEnabled: Bool
|
||||
let withdrawAction: () -> Void
|
||||
let sectionId: ItemListSectionId
|
||||
let style: ItemListStyle
|
||||
@ -27,6 +28,7 @@ final class MonetizationBalanceItem: ListViewItem, ItemListItem {
|
||||
stats: RevenueStats,
|
||||
animatedEmoji: TelegramMediaFile?,
|
||||
canWithdraw: Bool,
|
||||
isEnabled: Bool,
|
||||
withdrawAction: @escaping () -> Void,
|
||||
sectionId: ItemListSectionId,
|
||||
style: ItemListStyle
|
||||
@ -36,6 +38,7 @@ final class MonetizationBalanceItem: ListViewItem, ItemListItem {
|
||||
self.stats = stats
|
||||
self.animatedEmoji = animatedEmoji
|
||||
self.canWithdraw = canWithdraw
|
||||
self.isEnabled = isEnabled
|
||||
self.withdrawAction = withdrawAction
|
||||
self.sectionId = sectionId
|
||||
self.style = style
|
||||
@ -304,7 +307,7 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode {
|
||||
buttonTheme = buttonTheme.withUpdated(disabledBackgroundColor: buttonTheme.backgroundColor, disabledForegroundColor: buttonTheme.foregroundColor.withAlphaComponent(0.6))
|
||||
withdrawButtonNode = SolidRoundedButtonNode(theme: buttonTheme, height: buttonHeight, cornerRadius: 11.0)
|
||||
withdrawButtonNode.pressed = { [weak self] in
|
||||
if let self, let item = self.item {
|
||||
if let self, let item = self.item, item.isEnabled {
|
||||
item.withdrawAction()
|
||||
}
|
||||
}
|
||||
@ -312,6 +315,7 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode {
|
||||
strongSelf.withdrawButtonNode = withdrawButtonNode
|
||||
}
|
||||
withdrawButtonNode.title = item.presentationData.strings.Monetization_BalanceWithdraw
|
||||
withdrawButtonNode.isEnabled = item.isEnabled
|
||||
|
||||
let buttonWidth = contentSize.width - leftInset - rightInset
|
||||
let _ = withdrawButtonNode.updateLayout(width: buttonWidth, transition: .immediate)
|
||||
|
@ -2001,6 +2001,11 @@ private final class StickerPackContainer: ASDisplayNode {
|
||||
return
|
||||
}
|
||||
|
||||
if self.skipNextGridLayoutUpdate {
|
||||
self.skipNextGridLayoutUpdate = false
|
||||
return
|
||||
}
|
||||
|
||||
let minBackgroundY = gridFrame.minY - titleAreaInset
|
||||
let unclippedBackgroundY = gridFrame.minY - presentationLayout.contentOffset.y - titleAreaInset
|
||||
|
||||
@ -2066,13 +2071,25 @@ private final class StickerPackContainer: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
private var didAutomaticExpansion = false
|
||||
private var skipNextGridLayoutUpdate = true
|
||||
private func dequeueTransaction() {
|
||||
if self.enqueuedTransactions.isEmpty {
|
||||
return
|
||||
}
|
||||
let transaction = self.enqueuedTransactions.removeFirst()
|
||||
|
||||
self.gridNode.transaction(GridNodeTransaction(deleteItems: transaction.deletions, insertItems: transaction.insertions, updateItems: transaction.updates, scrollToItem: transaction.scrollToItem, updateLayout: nil, itemTransition: .immediate, stationaryItems: .none, updateFirstIndexInSectionOffset: nil), completion: { _ in })
|
||||
self.gridNode.transaction(GridNodeTransaction(deleteItems: transaction.deletions, insertItems: transaction.insertions, updateItems: transaction.updates, scrollToItem: transaction.scrollToItem, updateLayout: nil, itemTransition: .immediate, stationaryItems: .none, updateFirstIndexInSectionOffset: nil), completion: { [weak self] _ in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
|
||||
if self.currentEntries.count >= 15, self.controller?.expandIfNeeded == true, !self.didAutomaticExpansion {
|
||||
self.didAutomaticExpansion = true
|
||||
self.gridNode.autoscroll(toOffset: CGPoint(x: 0.0, y: max(0.0, self.gridNode.scrollView.contentSize.height - self.gridNode.scrollView.contentInset.top - self.gridNode.scrollView.bounds.height)), duration: 0.4)
|
||||
self.skipNextGridLayoutUpdate = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
@ -2575,6 +2592,7 @@ public final class StickerPackScreenImpl: ViewController, StickerPackScreen {
|
||||
private var alreadyDidAppear: Bool = false
|
||||
private var animatedIn: Bool = false
|
||||
fileprivate var initialIsEditing: Bool = false
|
||||
fileprivate var expandIfNeeded: Bool = false
|
||||
|
||||
let animationCache: AnimationCache
|
||||
let animationRenderer: MultiAnimationRenderer
|
||||
@ -2591,6 +2609,7 @@ public final class StickerPackScreenImpl: ViewController, StickerPackScreen {
|
||||
mainActionTitle: String? = nil,
|
||||
actionTitle: String? = nil,
|
||||
isEditing: Bool = false,
|
||||
expandIfNeeded: Bool = false,
|
||||
parentNavigationController: NavigationController? = nil,
|
||||
sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)? = nil,
|
||||
sendEmoji: ((String, ChatTextInputTextCustomEmojiAttribute) -> Void)?,
|
||||
@ -2605,6 +2624,7 @@ public final class StickerPackScreenImpl: ViewController, StickerPackScreen {
|
||||
self.mainActionTitle = mainActionTitle
|
||||
self.actionTitle = actionTitle
|
||||
self.initialIsEditing = isEditing
|
||||
self.expandIfNeeded = expandIfNeeded
|
||||
self.parentNavigationController = parentNavigationController
|
||||
self.sendSticker = sendSticker
|
||||
self.sendEmoji = sendEmoji
|
||||
@ -2838,6 +2858,7 @@ public func StickerPackScreen(
|
||||
mainActionTitle: String? = nil,
|
||||
actionTitle: String? = nil,
|
||||
isEditing: Bool = false,
|
||||
expandIfNeeded: Bool = false,
|
||||
parentNavigationController: NavigationController? = nil,
|
||||
sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)? = nil,
|
||||
sendEmoji: ((String, ChatTextInputTextCustomEmojiAttribute) -> Void)? = nil,
|
||||
@ -2854,6 +2875,7 @@ public func StickerPackScreen(
|
||||
mainActionTitle: mainActionTitle,
|
||||
actionTitle: actionTitle,
|
||||
isEditing: isEditing,
|
||||
expandIfNeeded: expandIfNeeded,
|
||||
parentNavigationController: parentNavigationController,
|
||||
sendSticker: sendSticker,
|
||||
sendEmoji: sendEmoji,
|
||||
|
@ -1337,6 +1337,7 @@ public final class ChatEntityKeyboardInputNode: ChatInputNode {
|
||||
stickerPacks: [packReference],
|
||||
loadedStickerPacks: [],
|
||||
isEditing: true,
|
||||
expandIfNeeded: false,
|
||||
parentNavigationController: interaction.getNavigationController(),
|
||||
sendSticker: { [weak interaction] fileReference, sourceView, sourceRect in
|
||||
return interaction?.sendSticker(fileReference, false, false, nil, false, sourceView, sourceRect, nil, []) ?? false
|
||||
@ -2820,7 +2821,7 @@ public final class EmojiContentPeekBehaviorImpl: EmojiContentPeekBehavior {
|
||||
return
|
||||
}
|
||||
|
||||
let controller = strongSelf.context.sharedContext.makeStickerPackScreen(context: context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [], isEditing: false, parentNavigationController: interaction.navigationController(), sendSticker: { file, sourceView, sourceRect in
|
||||
let controller = strongSelf.context.sharedContext.makeStickerPackScreen(context: context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [], isEditing: false, expandIfNeeded: false, parentNavigationController: interaction.navigationController(), sendSticker: { file, sourceView, sourceRect in
|
||||
sendSticker(file, false, false, nil, false, sourceView, sourceRect, nil)
|
||||
return true
|
||||
})
|
||||
|
@ -6000,7 +6000,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
if let navigationController {
|
||||
Queue.mainQueue().after(0.2) {
|
||||
let packReference: StickerPackReference = .id(id: info.id.id, accessHash: info.accessHash)
|
||||
let controller = self.context.sharedContext.makeStickerPackScreen(context: self.context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [.result(info: info, items: items, installed: true)], isEditing: false, parentNavigationController: navigationController, sendSticker: nil)
|
||||
let controller = self.context.sharedContext.makeStickerPackScreen(context: self.context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [.result(info: info, items: items, installed: true)], isEditing: false, expandIfNeeded: true, parentNavigationController: navigationController, sendSticker: nil)
|
||||
(navigationController.viewControllers.last as? ViewController)?.present(controller, in: .window(.root))
|
||||
}
|
||||
}
|
||||
@ -6181,7 +6181,7 @@ public final class MediaEditorScreen: ViewController, UIDropInteractionDelegate
|
||||
let navigationController = self.navigationController as? NavigationController
|
||||
if let navigationController {
|
||||
Queue.mainQueue().after(0.2) {
|
||||
let controller = self.context.sharedContext.makeStickerPackScreen(context: self.context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [], isEditing: false, parentNavigationController: navigationController, sendSticker: nil)
|
||||
let controller = self.context.sharedContext.makeStickerPackScreen(context: self.context, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [], isEditing: false, expandIfNeeded: true, parentNavigationController: navigationController, sendSticker: nil)
|
||||
(navigationController.viewControllers.last as? ViewController)?.present(controller, in: .window(.root))
|
||||
|
||||
Queue.mainQueue().after(0.1) {
|
||||
|
@ -40,10 +40,6 @@ struct VideoConversionConfiguration {
|
||||
}
|
||||
|
||||
static func with(appConfiguration: AppConfiguration) -> VideoConversionConfiguration {
|
||||
// #if DEBUG
|
||||
// return VideoConversionConfiguration(remuxToFMp4: true)
|
||||
// #endif
|
||||
|
||||
if let data = appConfiguration.data, let conversion = data["video_conversion"] as? [String: Any] {
|
||||
let remuxToFMp4 = conversion["remux_fmp4"] as? Bool ?? VideoConversionConfiguration.defaultValue.remuxToFMp4
|
||||
return VideoConversionConfiguration(remuxToFMp4: remuxToFMp4)
|
||||
|
@ -2359,8 +2359,8 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
||||
return controller
|
||||
}
|
||||
|
||||
public func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], isEditing: Bool, parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?) -> ViewController {
|
||||
return StickerPackScreen(context: context, updatedPresentationData: updatedPresentationData, mainStickerPack: mainStickerPack, stickerPacks: stickerPacks, loadedStickerPacks: loadedStickerPacks, isEditing: isEditing, parentNavigationController: parentNavigationController, sendSticker: sendSticker)
|
||||
public func makeStickerPackScreen(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal<PresentationData, NoError>)?, mainStickerPack: StickerPackReference, stickerPacks: [StickerPackReference], loadedStickerPacks: [LoadedStickerPack], isEditing: Bool, expandIfNeeded: Bool, parentNavigationController: NavigationController?, sendSticker: ((FileMediaReference, UIView, CGRect) -> Bool)?) -> ViewController {
|
||||
return StickerPackScreen(context: context, updatedPresentationData: updatedPresentationData, mainStickerPack: mainStickerPack, stickerPacks: stickerPacks, loadedStickerPacks: loadedStickerPacks, isEditing: isEditing, expandIfNeeded: expandIfNeeded, parentNavigationController: parentNavigationController, sendSticker: sendSticker)
|
||||
}
|
||||
|
||||
public func makeStickerEditorScreen(context: AccountContext, source: Any?, transitionArguments: (UIView, CGRect, UIImage?)?, completion: @escaping (TelegramMediaFile, @escaping () -> Void) -> Void) -> ViewController {
|
||||
|
Loading…
x
Reference in New Issue
Block a user