mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Camera and editor improvements
This commit is contained in:
@@ -191,41 +191,41 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
|
||||
accountSettingsController.parentController = self
|
||||
controllers.append(accountSettingsController)
|
||||
|
||||
tabBarController.cameraItemAndAction = (
|
||||
UITabBarItem(title: "Camera", image: UIImage(bundleImageName: "Chat List/Tabs/IconCamera"), tag: 2),
|
||||
{ [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
let coordinator = self.openStoryCamera(
|
||||
transitionIn: nil,
|
||||
transitionedIn: { [weak self] in
|
||||
guard let self, let rootTabController = self.rootTabController else {
|
||||
return
|
||||
}
|
||||
if let index = rootTabController.controllers.firstIndex(where: { $0 is ChatListController}) {
|
||||
rootTabController.selectedIndex = index
|
||||
}
|
||||
},
|
||||
transitionOut: { [weak self] finished in
|
||||
guard let self else {
|
||||
return nil
|
||||
}
|
||||
if finished {
|
||||
if let chatListController = self.chatListController as? ChatListControllerImpl, let transitionView = chatListController.transitionViewForOwnStoryItem() {
|
||||
return StoryCameraTransitionOut(
|
||||
destinationView: transitionView,
|
||||
destinationRect: transitionView.bounds,
|
||||
destinationCornerRadius: transitionView.bounds.height / 2.0
|
||||
)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
)
|
||||
coordinator?.animateIn()
|
||||
}
|
||||
)
|
||||
// tabBarController.cameraItemAndAction = (
|
||||
// UITabBarItem(title: "Camera", image: UIImage(bundleImageName: "Chat List/Tabs/IconCamera"), tag: 2),
|
||||
// { [weak self] in
|
||||
// guard let self else {
|
||||
// return
|
||||
// }
|
||||
// let coordinator = self.openStoryCamera(
|
||||
// transitionIn: nil,
|
||||
// transitionedIn: { [weak self] in
|
||||
// guard let self, let rootTabController = self.rootTabController else {
|
||||
// return
|
||||
// }
|
||||
// if let index = rootTabController.controllers.firstIndex(where: { $0 is ChatListController}) {
|
||||
// rootTabController.selectedIndex = index
|
||||
// }
|
||||
// },
|
||||
// transitionOut: { [weak self] finished in
|
||||
// guard let self else {
|
||||
// return nil
|
||||
// }
|
||||
// if finished {
|
||||
// if let chatListController = self.chatListController as? ChatListControllerImpl, let transitionView = chatListController.transitionViewForOwnStoryItem() {
|
||||
// return StoryCameraTransitionOut(
|
||||
// destinationView: transitionView,
|
||||
// destinationRect: transitionView.bounds,
|
||||
// destinationCornerRadius: transitionView.bounds.height / 2.0
|
||||
// )
|
||||
// }
|
||||
// }
|
||||
// return nil
|
||||
// }
|
||||
// )
|
||||
// coordinator?.animateIn()
|
||||
// }
|
||||
// )
|
||||
|
||||
tabBarController.setControllers(controllers, selectedIndex: restoreSettignsController != nil ? (controllers.count - 1) : (controllers.count - 2))
|
||||
|
||||
@@ -400,16 +400,6 @@ public final class TelegramRootController: NavigationController, TelegramRootCon
|
||||
|
||||
var attributes: [MessageAttribute] = []
|
||||
let imageFlags: TelegramMediaImageFlags = []
|
||||
// var stickerFiles: [TelegramMediaFile] = []
|
||||
// if !stickers.isEmpty {
|
||||
// for fileReference in stickers {
|
||||
// stickerFiles.append(fileReference.media)
|
||||
// }
|
||||
// }
|
||||
// if !stickerFiles.isEmpty {
|
||||
// attributes.append(EmbeddedMediaStickersMessageAttribute(files: stickerFiles))
|
||||
// imageFlags.insert(.hasStickers)
|
||||
// }
|
||||
|
||||
let media = TelegramMediaImage(imageId: MediaId(namespace: Namespaces.Media.LocalImage, id: randomId), representations: representations, immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: imageFlags)
|
||||
if let timeout, timeout > 0 && timeout <= 60 {
|
||||
|
||||
Reference in New Issue
Block a user