Skip to content

Commit

Permalink
Web app improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
laktyushin committed Jun 28, 2024
1 parent 9146416 commit 0a08c09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions submodules/AttachmentUI/Sources/AttachmentContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {
}
if let view = otherGestureRecognizer.view, view.description.contains("WKChildScroll") {
return false
// let velocity = panGestureRecognizer.velocity(in: nil)
// if abs(velocity.x) > abs(velocity.y) * 2.0 {
// return false
// }
}
if let _ = otherGestureRecognizer.view?.asyncdisplaykit_node as? CollectionIndexNode {
return false
Expand Down Expand Up @@ -222,7 +218,7 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate {
let currentHitView = self.hitTest(point, with: nil)

var scrollViewAndListNode = self.findScrollView(view: currentHitView)
if scrollViewAndListNode?.0.frame.height == self.frame.width {
if scrollViewAndListNode?.0.frame.height == self.frame.width || scrollViewAndListNode?.0.isDescendant(of: self.view) == false {
scrollViewAndListNode = nil
}
let scrollView = scrollViewAndListNode?.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelega
public private(set) var controllers: [ViewController] = []
private var state: State = State(layout: nil, canBeClosed: nil, top: nil, transition: nil, pending: nil)

weak var minimizedContainer: MinimizedContainer?

private var ignoreInputHeight: Bool = false

public private(set) var isReady: Bool = false
Expand Down Expand Up @@ -235,6 +237,13 @@ public final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelega
let topNode = topController.displayNode
var bottomControllerLayout = layout
if bottomController.view.disableAutomaticKeyboardHandling.isEmpty {
if let minimizedContainer = self.minimizedContainer, (bottomControllerLayout.inputHeight ?? 0.0) > 0.0 {
var updatedSize = bottomControllerLayout.size
var updatedIntrinsicInsets = bottomControllerLayout.intrinsicInsets
updatedSize.height -= minimizedContainer.collapsedHeight(layout: layout)
updatedIntrinsicInsets.bottom = 0.0
bottomControllerLayout = bottomControllerLayout.withUpdatedSize(updatedSize).withUpdatedIntrinsicInsets(updatedIntrinsicInsets)
}
bottomControllerLayout = bottomControllerLayout.withUpdatedInputHeight(nil)
}
bottomController.containerLayoutUpdated(bottomControllerLayout, transition: .immediate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ open class NavigationController: UINavigationController, ContainableController,
let updatedLayout = layout.withUpdatedSize(updatedSize).withUpdatedIntrinsicInsets(updatedIntrinsicInsets)
transition.updateFrame(node: flatContainer, frame: CGRect(origin: CGPoint(), size: updatedSize))
flatContainer.update(layout: updatedLayout, canBeClosed: false, controllers: controllers, transition: transition)
flatContainer.minimizedContainer = self.minimizedContainer
case let .split(splitContainer):
let flatContainer = NavigationContainer(isFlat: self.isFlat, controllerRemoved: { [weak self] controller in
self?.controllerRemoved(controller)
Expand Down

0 comments on commit 0a08c09

Please sign in to comment.