mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Video editor fixes
This commit is contained in:
parent
b38b88ae25
commit
b4deaf2e4f
@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
@protocol TGPhotoPaintStickerRenderView <NSObject>
|
@protocol TGPhotoPaintStickerRenderView <NSObject>
|
||||||
|
|
||||||
|
- (void)setIsVisible:(bool)isVisible;
|
||||||
- (int64_t)documentId;
|
- (int64_t)documentId;
|
||||||
- (UIImage *)image;
|
- (UIImage *)image;
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
@property (nonatomic, copy) void (^entitySelected)(TGPhotoPaintEntityView *);
|
@property (nonatomic, copy) void (^entitySelected)(TGPhotoPaintEntityView *);
|
||||||
@property (nonatomic, copy) void (^entityRemoved)(TGPhotoPaintEntityView *);
|
@property (nonatomic, copy) void (^entityRemoved)(TGPhotoPaintEntityView *);
|
||||||
|
|
||||||
|
- (void)updateVisibility:(bool)visible;
|
||||||
|
|
||||||
- (void)setupWithPaintingData:(TGPaintingData *)paintingData;
|
- (void)setupWithPaintingData:(TGPaintingData *)paintingData;
|
||||||
- (TGPhotoPaintEntityView *)createEntityViewWithEntity:(TGPhotoPaintEntity *)entity;
|
- (TGPhotoPaintEntityView *)createEntityViewWithEntity:(TGPhotoPaintEntity *)entity;
|
||||||
|
|
||||||
|
@ -27,6 +27,19 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)updateVisibility:(bool)visible
|
||||||
|
{
|
||||||
|
for (TGPhotoPaintEntityView *view in self.subviews)
|
||||||
|
{
|
||||||
|
if (![view isKindOfClass:[TGPhotoPaintEntityView class]])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ([view isKindOfClass:[TGPhotoStickerEntityView class]]) {
|
||||||
|
[(TGPhotoStickerEntityView *)view updateVisibility:visible];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)__unused gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)__unused otherGestureRecognizer
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)__unused gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)__unused otherGestureRecognizer
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -1019,12 +1019,14 @@ const CGFloat TGPhotoPaintStickerKeyboardSize = 260.0f;
|
|||||||
__strong TGPhotoPaintController *strongSelf = weakSelf;
|
__strong TGPhotoPaintController *strongSelf = weakSelf;
|
||||||
if (strongSelf != nil) {
|
if (strongSelf != nil) {
|
||||||
strongSelf.controlVideoPlayback(false);
|
strongSelf.controlVideoPlayback(false);
|
||||||
|
[strongSelf->_entitiesContainerView updateVisibility:false];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
_stickersScreen.screenWillDisappear = ^{
|
_stickersScreen.screenWillDisappear = ^{
|
||||||
__strong TGPhotoPaintController *strongSelf = weakSelf;
|
__strong TGPhotoPaintController *strongSelf = weakSelf;
|
||||||
if (strongSelf != nil) {
|
if (strongSelf != nil) {
|
||||||
strongSelf.controlVideoPlayback(true);
|
strongSelf.controlVideoPlayback(true);
|
||||||
|
[strongSelf->_entitiesContainerView updateVisibility:true];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
- (void)mirror;
|
- (void)mirror;
|
||||||
- (UIImage *)image;
|
- (UIImage *)image;
|
||||||
|
|
||||||
|
- (void)updateVisibility:(bool)visible;
|
||||||
|
|
||||||
- (CGRect)realBounds;
|
- (CGRect)realBounds;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -170,6 +170,10 @@ const CGFloat TGPhotoStickerSelectionViewHandleSide = 30.0f;
|
|||||||
return CGRectMake((self.bounds.size.width - side) / 2.0f, (self.bounds.size.height - side) / 2.0f, side, side);
|
return CGRectMake((self.bounds.size.width - side) / 2.0f, (self.bounds.size.height - side) / 2.0f, side, side);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)updateVisibility:(bool)visible {
|
||||||
|
[_stickerView setIsVisible:visible];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,16 +86,27 @@ class LegacyPaintStickerView: UIView, TGPhotoPaintStickerRenderView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateVisibility() {
|
var isVisible: Bool = true
|
||||||
if !self.didSetUpAnimationNode {
|
func setIsVisible(_ visible: Bool) {
|
||||||
self.didSetUpAnimationNode = true
|
self.isVisible = visible
|
||||||
|
updateVisibility()
|
||||||
|
}
|
||||||
|
|
||||||
self.animationNode?.visibility = true
|
var isPlaying = false
|
||||||
|
func updateVisibility() {
|
||||||
|
let isPlaying = self.isVisible
|
||||||
|
if self.isPlaying != isPlaying {
|
||||||
|
self.isPlaying = isPlaying
|
||||||
|
|
||||||
|
self.animationNode?.visibility = isPlaying
|
||||||
|
if isPlaying && !self.didSetUpAnimationNode {
|
||||||
|
self.didSetUpAnimationNode = true
|
||||||
let dimensions = self.file.dimensions ?? PixelDimensions(width: 512, height: 512)
|
let dimensions = self.file.dimensions ?? PixelDimensions(width: 512, height: 512)
|
||||||
let fittedDimensions = dimensions.cgSize.aspectFitted(CGSize(width: 512.0, height: 512.0))
|
let fittedDimensions = dimensions.cgSize.aspectFitted(CGSize(width: 512.0, height: 512.0))
|
||||||
self.animationNode?.setup(source: AnimatedStickerResourceSource(account: self.context.account, resource: self.file.resource), width: Int(fittedDimensions.width), height: Int(fittedDimensions.height), mode: .cached)
|
self.animationNode?.setup(source: AnimatedStickerResourceSource(account: self.context.account, resource: self.file.resource), width: Int(fittedDimensions.width), height: Int(fittedDimensions.height), mode: .cached)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override func layoutSubviews() {
|
override func layoutSubviews() {
|
||||||
super.layoutSubviews()
|
super.layoutSubviews()
|
||||||
|
@ -87,7 +87,7 @@ enum ChatMediaInputGridEntryIndex: Equatable, Comparable {
|
|||||||
enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
||||||
case search(theme: PresentationTheme, strings: PresentationStrings)
|
case search(theme: PresentationTheme, strings: PresentationStrings)
|
||||||
case peerSpecificSetup(theme: PresentationTheme, strings: PresentationStrings, dismissed: Bool)
|
case peerSpecificSetup(theme: PresentationTheme, strings: PresentationStrings, dismissed: Bool)
|
||||||
case sticker(index: ItemCollectionViewEntryIndex, stickerItem: StickerPackItem, stickerPackInfo: StickerPackCollectionInfo?, canManagePeerSpecificPack: Bool?, theme: PresentationTheme)
|
case sticker(index: ItemCollectionViewEntryIndex, stickerItem: StickerPackItem, stickerPackInfo: StickerPackCollectionInfo?, canManagePeerSpecificPack: Bool?, maybeManageable: Bool, theme: PresentationTheme)
|
||||||
case trending(TrendingPanePackEntry)
|
case trending(TrendingPanePackEntry)
|
||||||
|
|
||||||
var index: ChatMediaInputGridEntryIndex {
|
var index: ChatMediaInputGridEntryIndex {
|
||||||
@ -96,7 +96,7 @@ enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
|||||||
return .search
|
return .search
|
||||||
case let .peerSpecificSetup(_, _, dismissed):
|
case let .peerSpecificSetup(_, _, dismissed):
|
||||||
return .peerSpecificSetup(dismissed: dismissed)
|
return .peerSpecificSetup(dismissed: dismissed)
|
||||||
case let .sticker(index, _, _, _, _):
|
case let .sticker(index, _, _, _, _, _):
|
||||||
return .collectionIndex(index)
|
return .collectionIndex(index)
|
||||||
case let .trending(entry):
|
case let .trending(entry):
|
||||||
return .trending(entry.info.id, entry.index)
|
return .trending(entry.info.id, entry.index)
|
||||||
@ -127,8 +127,8 @@ enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
|||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
case let .sticker(lhsIndex, lhsStickerItem, lhsStickerPackInfo, lhsCanManagePeerSpecificPack, lhsTheme):
|
case let .sticker(lhsIndex, lhsStickerItem, lhsStickerPackInfo, lhsCanManagePeerSpecificPack, lhsMaybeManageable, lhsTheme):
|
||||||
if case let .sticker(rhsIndex, rhsStickerItem, rhsStickerPackInfo, rhsCanManagePeerSpecificPack, rhsTheme) = rhs {
|
if case let .sticker(rhsIndex, rhsStickerItem, rhsStickerPackInfo, rhsCanManagePeerSpecificPack, rhsMaybeManageable, rhsTheme) = rhs {
|
||||||
if lhsIndex != rhsIndex {
|
if lhsIndex != rhsIndex {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -141,6 +141,9 @@ enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
|||||||
if lhsCanManagePeerSpecificPack != rhsCanManagePeerSpecificPack {
|
if lhsCanManagePeerSpecificPack != rhsCanManagePeerSpecificPack {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if lhsMaybeManageable != rhsMaybeManageable {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if lhsTheme !== rhsTheme {
|
if lhsTheme !== rhsTheme {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -173,8 +176,8 @@ enum ChatMediaInputGridEntry: Equatable, Comparable, Identifiable {
|
|||||||
}, dismiss: dismissed ? nil : {
|
}, dismiss: dismissed ? nil : {
|
||||||
inputNodeInteraction.dismissPeerSpecificSettings()
|
inputNodeInteraction.dismissPeerSpecificSettings()
|
||||||
})
|
})
|
||||||
case let .sticker(index, stickerItem, stickerPackInfo, canManagePeerSpecificPack, theme):
|
case let .sticker(index, stickerItem, stickerPackInfo, canManagePeerSpecificPack, maybeManageable, theme):
|
||||||
return ChatMediaInputStickerGridItem(account: account, collectionId: index.collectionId, stickerPackInfo: stickerPackInfo, index: index, stickerItem: stickerItem, canManagePeerSpecificPack: canManagePeerSpecificPack, interfaceInteraction: interfaceInteraction, inputNodeInteraction: inputNodeInteraction, theme: theme, selected: { })
|
return ChatMediaInputStickerGridItem(account: account, collectionId: index.collectionId, stickerPackInfo: stickerPackInfo, index: index, stickerItem: stickerItem, canManagePeerSpecificPack: canManagePeerSpecificPack, interfaceInteraction: interfaceInteraction, inputNodeInteraction: inputNodeInteraction, hasAccessory: maybeManageable, theme: theme, selected: { })
|
||||||
case let .trending(entry):
|
case let .trending(entry):
|
||||||
return entry.item(account: account, interaction: trendingInteraction, grid: false)
|
return entry.item(account: account, interaction: trendingInteraction, grid: false)
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ func preparedChatMediaInputGridEntryTransition(account: Account, view: ItemColle
|
|||||||
return ChatMediaInputGridTransition(deletions: deletions, insertions: insertions, updates: updates, updateFirstIndexInSectionOffset: firstIndexInSectionOffset, stationaryItems: stationaryItems, scrollToItem: scrollToItem, updateOpaqueState: opaqueState, animated: animated)
|
return ChatMediaInputGridTransition(deletions: deletions, insertions: insertions, updates: updates, updateFirstIndexInSectionOffset: firstIndexInSectionOffset, stationaryItems: stationaryItems, scrollToItem: scrollToItem, updateOpaqueState: opaqueState, animated: animated)
|
||||||
}
|
}
|
||||||
|
|
||||||
func chatMediaInputPanelEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, hasUnreadTrending: Bool?, theme: PresentationTheme, hasGifs: Bool = true) -> [ChatMediaInputPanelEntry] {
|
func chatMediaInputPanelEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, hasUnreadTrending: Bool?, theme: PresentationTheme, hasGifs: Bool = true, hasSettings: Bool = true) -> [ChatMediaInputPanelEntry] {
|
||||||
var entries: [ChatMediaInputPanelEntry] = []
|
var entries: [ChatMediaInputPanelEntry] = []
|
||||||
if hasGifs {
|
if hasGifs {
|
||||||
entries.append(.recentGifs(theme))
|
entries.append(.recentGifs(theme))
|
||||||
@ -213,7 +213,9 @@ func chatMediaInputPanelEntries(view: ItemCollectionsView, savedStickers: Ordere
|
|||||||
entries.append(.peerSpecific(theme: theme, peer: peer))
|
entries.append(.peerSpecific(theme: theme, peer: peer))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hasSettings {
|
||||||
entries.append(.settings(theme))
|
entries.append(.settings(theme))
|
||||||
|
}
|
||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +232,7 @@ func chatMediaInputPanelGifModeEntries(theme: PresentationTheme, reactions: [Str
|
|||||||
return entries
|
return entries
|
||||||
}
|
}
|
||||||
|
|
||||||
func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, hasSearch: Bool = true, strings: PresentationStrings, theme: PresentationTheme) -> [ChatMediaInputGridEntry] {
|
func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: OrderedItemListView?, recentStickers: OrderedItemListView?, peerSpecificPack: PeerSpecificPackData?, canInstallPeerSpecificPack: CanInstallPeerSpecificPack, hasSearch: Bool = true, hasAccessories: Bool = true, strings: PresentationStrings, theme: PresentationTheme) -> [ChatMediaInputGridEntry] {
|
||||||
var entries: [ChatMediaInputGridEntry] = []
|
var entries: [ChatMediaInputGridEntry] = []
|
||||||
|
|
||||||
if hasSearch && view.lower == nil {
|
if hasSearch && view.lower == nil {
|
||||||
@ -253,7 +255,7 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
|||||||
savedStickerIds.insert(item.file.fileId.id)
|
savedStickerIds.insert(item.file.fileId.id)
|
||||||
let index = ItemCollectionItemIndex(index: Int32(i), id: item.file.fileId.id)
|
let index = ItemCollectionItemIndex(index: Int32(i), id: item.file.fileId.id)
|
||||||
let stickerItem = StickerPackItem(index: index, file: item.file, indexKeys: [])
|
let stickerItem = StickerPackItem(index: index, file: item.file, indexKeys: [])
|
||||||
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -3, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: nil, theme: theme))
|
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -3, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: nil, maybeManageable: hasAccessories, theme: theme))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -269,7 +271,7 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
|||||||
if !savedStickerIds.contains(mediaId.id) {
|
if !savedStickerIds.contains(mediaId.id) {
|
||||||
let index = ItemCollectionItemIndex(index: Int32(i), id: mediaId.id)
|
let index = ItemCollectionItemIndex(index: Int32(i), id: mediaId.id)
|
||||||
let stickerItem = StickerPackItem(index: index, file: file, indexKeys: [])
|
let stickerItem = StickerPackItem(index: index, file: file, indexKeys: [])
|
||||||
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -2, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: nil, theme: theme))
|
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -2, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: nil, maybeManageable: hasAccessories, theme: theme))
|
||||||
addedCount += 1
|
addedCount += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,7 +294,7 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
|||||||
if let item = peerSpecificPack.items[i] as? StickerPackItem {
|
if let item = peerSpecificPack.items[i] as? StickerPackItem {
|
||||||
let index = ItemCollectionItemIndex(index: Int32(i), id: item.file.fileId.id)
|
let index = ItemCollectionItemIndex(index: Int32(i), id: item.file.fileId.id)
|
||||||
let stickerItem = StickerPackItem(index: index, file: item.file, indexKeys: [])
|
let stickerItem = StickerPackItem(index: index, file: item.file, indexKeys: [])
|
||||||
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -1, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: canManagePeerSpecificPack, theme: theme))
|
entries.append(.sticker(index: ItemCollectionViewEntryIndex(collectionIndex: -1, collectionId: packInfo.id, itemIndex: index), stickerItem: stickerItem, stickerPackInfo: packInfo, canManagePeerSpecificPack: canManagePeerSpecificPack, maybeManageable: hasAccessories, theme: theme))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -300,7 +302,7 @@ func chatMediaInputGridEntries(view: ItemCollectionsView, savedStickers: Ordered
|
|||||||
|
|
||||||
for entry in view.entries {
|
for entry in view.entries {
|
||||||
if let item = entry.item as? StickerPackItem {
|
if let item = entry.item as? StickerPackItem {
|
||||||
entries.append(.sticker(index: entry.index, stickerItem: item, stickerPackInfo: stickerPackInfos[entry.index.collectionId], canManagePeerSpecificPack: false, theme: theme))
|
entries.append(.sticker(index: entry.index, stickerItem: item, stickerPackInfo: stickerPackInfos[entry.index.collectionId], canManagePeerSpecificPack: false, maybeManageable: hasAccessories, theme: theme))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,6 +369,7 @@ final class ChatMediaInputNodeInteraction {
|
|||||||
var previewedStickerPackItem: StickerPreviewPeekItem?
|
var previewedStickerPackItem: StickerPreviewPeekItem?
|
||||||
var appearanceTransition: CGFloat = 1.0
|
var appearanceTransition: CGFloat = 1.0
|
||||||
var displayStickerPlaceholder = true
|
var displayStickerPlaceholder = true
|
||||||
|
var displayStickerPackManageControls = true
|
||||||
|
|
||||||
init(navigateToCollectionId: @escaping (ItemCollectionId) -> Void, navigateBackToStickers: @escaping () -> Void, setGifMode: @escaping (ChatMediaInputGifMode) -> Void, openSettings: @escaping () -> Void, toggleSearch: @escaping (Bool, ChatMediaInputSearchMode?, String) -> Void, openPeerSpecificSettings: @escaping () -> Void, dismissPeerSpecificSettings: @escaping () -> Void, clearRecentlyUsedStickers: @escaping () -> Void) {
|
init(navigateToCollectionId: @escaping (ItemCollectionId) -> Void, navigateBackToStickers: @escaping () -> Void, setGifMode: @escaping (ChatMediaInputGifMode) -> Void, openSettings: @escaping () -> Void, toggleSearch: @escaping (Bool, ChatMediaInputSearchMode?, String) -> Void, openPeerSpecificSettings: @escaping () -> Void, dismissPeerSpecificSettings: @escaping () -> Void, clearRecentlyUsedStickers: @escaping () -> Void) {
|
||||||
self.navigateToCollectionId = navigateToCollectionId
|
self.navigateToCollectionId = navigateToCollectionId
|
||||||
|
@ -126,7 +126,7 @@ final class ChatMediaInputStickerGridItem: GridItem {
|
|||||||
|
|
||||||
let section: GridSection?
|
let section: GridSection?
|
||||||
|
|
||||||
init(account: Account, collectionId: ItemCollectionId, stickerPackInfo: StickerPackCollectionInfo?, index: ItemCollectionViewEntryIndex, stickerItem: StickerPackItem, canManagePeerSpecificPack: Bool?, interfaceInteraction: ChatControllerInteraction?, inputNodeInteraction: ChatMediaInputNodeInteraction, theme: PresentationTheme, selected: @escaping () -> Void) {
|
init(account: Account, collectionId: ItemCollectionId, stickerPackInfo: StickerPackCollectionInfo?, index: ItemCollectionViewEntryIndex, stickerItem: StickerPackItem, canManagePeerSpecificPack: Bool?, interfaceInteraction: ChatControllerInteraction?, inputNodeInteraction: ChatMediaInputNodeInteraction, hasAccessory: Bool, theme: PresentationTheme, selected: @escaping () -> Void) {
|
||||||
self.account = account
|
self.account = account
|
||||||
self.index = index
|
self.index = index
|
||||||
self.stickerItem = stickerItem
|
self.stickerItem = stickerItem
|
||||||
@ -138,9 +138,9 @@ final class ChatMediaInputStickerGridItem: GridItem {
|
|||||||
self.section = nil
|
self.section = nil
|
||||||
} else {
|
} else {
|
||||||
let accessory: ChatMediaInputStickerGridSectionAccessory
|
let accessory: ChatMediaInputStickerGridSectionAccessory
|
||||||
if stickerPackInfo?.id.namespace == ChatMediaInputPanelAuxiliaryNamespace.peerSpecific.rawValue, let canManage = canManagePeerSpecificPack, canManage {
|
if hasAccessory && stickerPackInfo?.id.namespace == ChatMediaInputPanelAuxiliaryNamespace.peerSpecific.rawValue, let canManage = canManagePeerSpecificPack, canManage {
|
||||||
accessory = .setup
|
accessory = .setup
|
||||||
} else if stickerPackInfo?.id.namespace == ChatMediaInputPanelAuxiliaryNamespace.recentStickers.rawValue {
|
} else if hasAccessory && stickerPackInfo?.id.namespace == ChatMediaInputPanelAuxiliaryNamespace.recentStickers.rawValue {
|
||||||
accessory = .clear
|
accessory = .clear
|
||||||
} else {
|
} else {
|
||||||
accessory = .none
|
accessory = .none
|
||||||
|
@ -585,8 +585,8 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasUnreadTrending: nil, theme: theme, hasGifs: false)
|
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasUnreadTrending: nil, theme: theme, hasGifs: false, hasSettings: false)
|
||||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasSearch: false, strings: strings, theme: theme)
|
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: savedStickers, recentStickers: recentStickers, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||||
|
|
||||||
// if view.higher == nil {
|
// if view.higher == nil {
|
||||||
// var hasTopSeparator = true
|
// var hasTopSeparator = true
|
||||||
@ -636,8 +636,8 @@ private final class DrawingStickersScreenNode: ViewControllerTracingNode {
|
|||||||
installedPacks.insert(info.0)
|
installedPacks.insert(info.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasUnreadTrending: nil, theme: theme, hasGifs: false)
|
let panelEntries = chatMediaInputPanelEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasUnreadTrending: nil, theme: theme, hasGifs: false, hasSettings: false)
|
||||||
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasSearch: false, strings: strings, theme: theme)
|
let gridEntries = chatMediaInputGridEntries(view: view, savedStickers: nil, recentStickers: nil, peerSpecificPack: nil, canInstallPeerSpecificPack: .none, hasSearch: false, hasAccessories: false, strings: strings, theme: theme)
|
||||||
|
|
||||||
let (previousPanelEntries, previousGridEntries) = previousMaskEntries.swap((panelEntries, gridEntries))
|
let (previousPanelEntries, previousGridEntries) = previousMaskEntries.swap((panelEntries, gridEntries))
|
||||||
return (view, preparedChatMediaInputPanelEntryTransition(context: context, from: previousPanelEntries, to: panelEntries, inputNodeInteraction: masksInputNodeInteraction), previousPanelEntries.isEmpty, preparedChatMediaInputGridEntryTransition(account: context.account, view: view, from: previousGridEntries, to: gridEntries, update: update, interfaceInteraction: controllerInteraction, inputNodeInteraction: masksInputNodeInteraction, trendingInteraction: trendingInteraction), previousGridEntries.isEmpty)
|
return (view, preparedChatMediaInputPanelEntryTransition(context: context, from: previousPanelEntries, to: panelEntries, inputNodeInteraction: masksInputNodeInteraction), previousPanelEntries.isEmpty, preparedChatMediaInputGridEntryTransition(account: context.account, view: view, from: previousGridEntries, to: gridEntries, update: update, interfaceInteraction: controllerInteraction, inputNodeInteraction: masksInputNodeInteraction, trendingInteraction: trendingInteraction), previousGridEntries.isEmpty)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user