diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryController.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryController.swift index c791af5863..46a82494b3 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryController.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryController.swift @@ -2,6 +2,7 @@ import Foundation import UIKit import Display import AsyncDisplayKit +import SwiftSignalKit import TelegramCore import TelegramPresentationData import ProgressNavigationButtonNode @@ -120,6 +121,10 @@ public final class AuthorizationSequenceCodeEntryController: ViewController { override public func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) + if let navigationController = self.navigationController as? NavigationController, let layout = self.validLayout { + addTemporaryKeyboardSnapshotView(navigationController: navigationController, parentView: self.view, layout: layout) + } + self.controllerNode.activateInput() } @@ -219,3 +224,25 @@ public final class AuthorizationSequenceCodeEntryController: ViewController { self.controllerNode.updateCode("\(code)") } } + +func addTemporaryKeyboardSnapshotView(navigationController: NavigationController, parentView: UIView, layout: ContainerViewLayout) { + if case .compact = layout.metrics.widthClass, let statusBarHost = navigationController.statusBarHost { + if let keyboardView = statusBarHost.keyboardView { + if let snapshotView = keyboardView.snapshotView(afterScreenUpdates: false) { + keyboardView.layer.removeAllAnimations() + UIView.performWithoutAnimation { + snapshotView.frame = CGRect(origin: CGPoint(x: 0.0, y: layout.size.height - snapshotView.frame.size.height), size: snapshotView.frame.size) + if let keyboardWindow = statusBarHost.keyboardWindow { + keyboardWindow.addSubview(snapshotView) + } + + Queue.mainQueue().after(0.45, { + snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak snapshotView] _ in + snapshotView?.removeFromSuperview() + }) + }) + } + } + } + } +} diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryControllerNode.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryControllerNode.swift index 1b99dceaa9..e2e7840121 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryControllerNode.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequenceCodeEntryControllerNode.swift @@ -74,6 +74,8 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF self.codeInputView.alpha = self.inProgress ? 0.6 : 1.0 } } + + private let appearanceTimestamp = CACurrentMediaTime() init(strings: PresentationStrings, theme: PresentationTheme) { self.strings = strings @@ -270,8 +272,16 @@ final class AuthorizationSequenceCodeEntryControllerNode: ASDisplayNode, UITextF } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { + let previousInputHeight = self.layoutArguments?.0.inputHeight ?? 0.0 + let newInputHeight = layout.inputHeight ?? 0.0 + self.layoutArguments = (layout, navigationBarHeight) + var layout = layout + if CACurrentMediaTime() - self.appearanceTimestamp < 2.0, newInputHeight < previousInputHeight { + layout = layout.withUpdatedInputHeight(previousInputHeight) + } + let maximumWidth: CGFloat = min(430.0, layout.size.width) let inset: CGFloat = 24.0 diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequencePasswordEntryController.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequencePasswordEntryController.swift index b7c2bd1f6c..b4ba03969a 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequencePasswordEntryController.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequencePasswordEntryController.swift @@ -89,6 +89,10 @@ final class AuthorizationSequencePasswordEntryController: ViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) + if let navigationController = self.navigationController as? NavigationController, let layout = self.validLayout { + addTemporaryKeyboardSnapshotView(navigationController: navigationController, parentView: self.view, layout: layout) + } + self.controllerNode.activateInput() } diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpController.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpController.swift index cf0dded3dd..c65fa59016 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpController.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpController.swift @@ -130,6 +130,10 @@ final class AuthorizationSequenceSignUpController: ViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) + if let navigationController = self.navigationController as? NavigationController, let layout = self.validLayout { + addTemporaryKeyboardSnapshotView(navigationController: navigationController, parentView: self.view, layout: layout) + } + self.controllerNode.activateInput() } diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpControllerNode.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpControllerNode.swift index 660d80a0eb..d689128673 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpControllerNode.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequenceSignUpControllerNode.swift @@ -2,6 +2,7 @@ import Foundation import UIKit import AsyncDisplayKit import Display +import SwiftSignalKit import TelegramPresentationData import TextFormat import Markdown @@ -40,6 +41,8 @@ final class AuthorizationSequenceSignUpControllerNode: ASDisplayNode, UITextFiel private var layoutArguments: (ContainerViewLayout, CGFloat)? + private let appearanceTimestamp = CACurrentMediaTime() + var currentName: (String, String) { return (self.firstNameField.textField.text ?? "", self.lastNameField.textField.text ?? "") } @@ -209,8 +212,16 @@ final class AuthorizationSequenceSignUpControllerNode: ASDisplayNode, UITextFiel } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) { + let previousInputHeight = self.layoutArguments?.0.inputHeight ?? 0.0 + let newInputHeight = layout.inputHeight ?? 0.0 + self.layoutArguments = (layout, navigationBarHeight) + var layout = layout + if CACurrentMediaTime() - self.appearanceTimestamp < 2.0, newInputHeight < previousInputHeight { + layout = layout.withUpdatedInputHeight(previousInputHeight) + } + let maximumWidth: CGFloat = min(430.0, layout.size.width) var insets = layout.insets(options: [.statusBar]) diff --git a/submodules/ChatListUI/Sources/Node/ChatListNode.swift b/submodules/ChatListUI/Sources/Node/ChatListNode.swift index b01c44204a..ec49e37e88 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNode.swift @@ -2297,7 +2297,7 @@ public final class ChatListNode: ListView { isEmpty = true loop1: for entry in transition.chatListView.filteredEntries { switch entry { - case .GroupReferenceEntry, .HeaderEntry, .HoleEntry: + case .HeaderEntry, .HoleEntry: break default: if case .ArchiveIntro = entry { diff --git a/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift b/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift index f9cf05d8b5..571ccd6a23 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift @@ -612,7 +612,7 @@ func chatListNodeEntriesForView(_ view: EngineChatList, state: ChatListNodeState autoremoveTimeout: item.item.autoremoveTimeout, forumTopicData: item.item.forumTopicData, topForumTopicItems: item.item.topForumTopicItems, - revealed: threadId == 1 && (state.hiddenItemShouldBeTemporaryRevealed || state.editing) + revealed: state.hiddenItemShouldBeTemporaryRevealed || state.editing ))) if pinningIndex != 0 { pinningIndex -= 1 @@ -632,7 +632,7 @@ func chatListNodeEntriesForView(_ view: EngineChatList, state: ChatListNodeState message: groupReference.topMessage, editing: state.editing, unreadCount: groupReference.unreadCount, - revealed: state.hiddenItemShouldBeTemporaryRevealed, + revealed: state.hiddenItemShouldBeTemporaryRevealed || view.items.isEmpty, hiddenByDefault: hideArchivedFolderByDefault )) if pinningIndex != 0 { diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift index 555b558c5b..206becc8db 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoData.swift @@ -1151,7 +1151,7 @@ func peerInfoHeaderButtons(peer: Peer?, cachedData: CachedPeerData?, isOpenedFro } var canReport = true - if channel.isVerified || channel.adminRights != nil || channel.flags.contains(.isCreator) { + if channel.adminRights != nil || channel.flags.contains(.isCreator) { canReport = false } diff --git a/submodules/WebSearchUI/Sources/WebSearchController.swift b/submodules/WebSearchUI/Sources/WebSearchController.swift index 45f9b4697e..79695f3c85 100644 --- a/submodules/WebSearchUI/Sources/WebSearchController.swift +++ b/submodules/WebSearchUI/Sources/WebSearchController.swift @@ -413,11 +413,7 @@ public final class WebSearchController: ViewController { } } - private func updateSearchQuery(_ query: String) { - if !query.isEmpty { - let _ = addRecentWebSearchQuery(engine: self.context.engine, string: query).start() - } - + private func updateSearchQuery(_ query: String) { let scope: Signal switch self.mode { case .media: