* Stop pinning the scroll offset in moving programmatically
* Add 'optional' string interpolation
* Add comments
* Add CoreTests.test_initial_scroll_offset_reset()
* ci: remove macos-12 jobs for the deprecation
* ci: name circleci jobs
This is because the `state` argument of `Core.isScrollable(state:)` is
not always equal to `FloatingPanelController.state` property. Therefore,
the API should pass the `state` property of `Core.isScrollable(state:)`.
The new `floatingPanel(_:shouldAllowToScroll)` delegate method allows the
library user to determine whether the content scrolls or not in certain
state. `Core.isScrollable(state:)` and `LayoutAdpter.offset(from:)` are
added for this feature.
This is the revised version of commit 448fc5c.
Commit 448fc5c has a critical regression in scroll tracking that can cause the
scroll content to bounce after moving a panel, for example, pulling down it from
full to half state.
By re-investigating #524, I found that this problem only occurred with the
`fitToBounds` content mode and a small scroll view content.
Therefore I fixed it in the more specific way.
UIScrollView would unexpectedly change its scroll offset after updating the bounces property when dealing with small scrollable content. This fixes issue #524, "Scrolling jumps when tableView content is small".
This fixes#572 to change the backdrop alpha when the view size or
its size class changes.
The main change is that `true` is passed as a
`forceLayout` parameter into `viewWillTransition(to:with:)` callbacks.
Because it's necessary for the backdrop alpha's update when the view
size or its size class changes.
This also fixes a regression at `9c45c31` commit.
```diff
- layoutAdapter.activateLayout(for: state, forceLayout: true)
+ layoutAdapter.activateLayout(for: state, forceLayout: forceLayout)
```
The behavior before the above change indicates that the method has
worked well even when `forceLayout` is set to `true` in their callbacks.
Additional improvements:
* Format `activateLayout(forceLayout:contentInsetAdjustmentBehavior:)`
* Add `_floor` function for `test_updateBackdropAlpha()`
* Add test_updateBackdropAlpha
* Fix backdrop alpha's flickers in Maps.app
This issue occurs when swinging down a panel with all one's might.
The trigger is here.
```
func floatingPanelWillEndDragging(_ vc: FloatingPanelController, withVelocity velocity: CGPoint, targetState: UnsafeMutablePointer<FloatingPanelState>) {
if targetState.pointee != .full {
owner.searchVC.hideHeader(animated: true)
}
if targetState.pointee == .tip {
>>> vc.contentMode = .static
}
}
```
However, any library users expect to affect the backdrop by this code.
And then I reconsidered the reason why the backdrop alpha changes in
activateLayout(for:forceLayout:) and it's because the animation using
CAAnimation on v1.
Therefore I decided to move the point to change the backdrop alpha into
the move animation's completion handler.
And also the responsibility of `setBackdropAlpha(of:)` was moved into
`Core` because `Core` takes on a role of changing the backdrop alpha.