Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the panel sheet to go above the upper position when it is in full state #569

Open
wants to merge 772 commits into
base: master
Choose a base branch
from

Conversation

engali94
Copy link

@engali94 engali94 commented Oct 6, 2022

Allow the panel sheet to go above the upper position when it is in the .full state

scenee and others added 30 commits November 21, 2019 21:17
* Added nearbyPosition : always a position of a user's finger.
* debugging nearby position in Maps.app.
* Added test cases move with nearby position.
This seems to be Xcode 11's bug of linking frameworks.
This issue is that a panel moved up while dragging it
down if content offset of the tracking scroll view in
a content view controller was greater than its top interaction buffer.

Ref. scenee#293
The grabber area was not working expectedly.
Fix a panel's move-up while dragging it down
Ideally, it's better to define a delegate method like
scrollViewDidEndDragging(_:willDecelerate:) in FloatingPanelControllerDelegate
to notify whether a panel will be decelerated or not.
However it's a broken change so I add this change as workaround.
The delegate method definition will be improved on v2.0.
Return the child view controller to consult
…#314)

* add floatingPanel(_:contentOffsetForPinning:)
* add 'Show NavigationController' sample
* fix the initial content offset in a navigation bar with  a large text
    The content offset preservation should be applied only when
    `FloatingPanelController.contentInsetAdjustmentBehavior` is `.always`.
    This is because the library user loses control of the initial offset.
* Convert the tracked scroll view frame to the surface coordinate space
fixes floatingPanel(_ vc: FloatingPanelController, contentOffsetForPinning) name
scenee and others added 26 commits November 29, 2021 20:46
…sition (scenee#527)

Changed how `initialScrollOffset` is set. This issue was described in scenee#526.
* Updated 'ci' workflow for Xcode 13.3.1
* Modernized and simplified the workflow using 'strategy.matrix'
* 'arm64-apple-ios15.4' target is not included in swiftpm because its build gets an build error.
With Xcode 14 Beta 1 library fails to compile with following error.

> Stored properties cannot be marked potentially unavailable with `@available`

Because CALayerCornerCurve is not marked with any @available annotation it is possible to declare private optional storage of it.
Resolved Maps-SwiftUI Example Animation Stuttering (scenee#546)
Fix the view index of FloatingPanelView for SwiftUI
This resolves issue scenee#561. Instead of continuing to work a modal presentation transition even if a panel state is not .hidden, this library calls fatalError as a programmer error on the occasion.
This job is unstable because of its environment.
'Show Top Positioned Panel' in Samples app was broken.
@scenee
Copy link
Owner

scenee commented Oct 14, 2022

Allow the panel sheet to go above the upper position when it is in the .full state

We are able to allow this behavior without introducing a new API. See this code in Maps sample

let loc = vc.surfaceLocation
if vc.isAttracting == false {
let minY = vc.surfaceLocation(for: .full).y - 6.0
let maxY = vc.surfaceLocation(for: .tip).y + 6.0
vc.surfaceLocation = CGPoint(x: loc.x, y: min(max(loc.y, minY), maxY))
}

It limits the most upper position of the panel to 6pt above the .full position. We can also customize the limitation and handle other positioned panel(top, left and right) along with user specific use cases.

See also here: https://github.com/scenee/FloatingPanel#specify-the-panel-moves-boundary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.