You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refactors the overscroll effect to use a new damping calculation based on window size, replacing the previous `parabolaScrollEasing` function.
* Updates the `scrollEasing` parameter signature to take `distance` and `range` instead of `currentOffset` and `newOffset`.
* Adjusts the spring stiffness value for a different feel.
* Rewrites the `NestedScrollConnection` implementation to track touch delta and calculate damped offsets, improving the overscroll behavior for scroll and fling gestures.
springStiff =200f, // Spring stiffness for the rebound animation, default is 200f
94
-
springDamp =1f, // Spring damping for the rebound animation, default is 1f
95
-
isEnabled = { platform() ==Platform.Android|| platform() ==Platform.IOS } //Whether to enable the overscroll effect, enabled by default on Android and iOS
96
-
),
93
+
springStiff =280f, // Spring stiffness, default 280f
94
+
springDamp =1f, // Spring damping, default 1f
95
+
isEnabled = { platform() ==Platform.Android|| platform() ==Platform.IOS } //Enable only on Android/iOS by default
96
+
),
97
97
overscrollEffect =null// It is recommended to set this parameter to null to disable the default effect
98
98
) {
99
99
// List content
@@ -102,11 +102,11 @@ LazyColumn(
102
102
103
103
**Parameter Explanations:**
104
104
105
-
*`nestedScrollToParent`: Boolean, controls whether nested scroll events (e.g., from parent scroll containers) are dispatched to the parent. Defaults to`true`.
106
-
*`scrollEasing`: A function that defines the easing effect when scrolling beyond the bounds. It takes the current offset (`currentOffset`) and the new offset delta (`newOffset`) as parameters and returns the calculated new offset. By default, it uses `parabolaScrollEasing`, providing an iOS-like damping effect.
107
-
*`springStiff`: Float, defines the spring stiffness for the rebound animation. Higher values result in a faster and stiffer rebound. Defaults to `200f`.
108
-
*`springDamp`: Float, defines the spring damping for the rebound animation. Higher values result in less oscillation. Defaults to`1f`.
109
-
*`isEnabled`: A lambda expression returning a Boolean, used to dynamically control whether the overscroll effect is enabled. By default, it is enabled only on Android and iOS platforms.
105
+
*`nestedScrollToParent`: Boolean, whether to dispatch nested scroll events to parent. Default:`true`.
106
+
*`scrollEasing`: Function `(distance: Float, range: Int) -> Float`, custom easing, default effect is similar to HyperOS feel.
107
+
*`springStiff`: Float, spring stiffness for rebound. Default: `280f`.
108
+
*`springDamp`: Float, spring damping for rebound. Default:`1f`.
109
+
*`isEnabled`: Lambda, whether to enable overscroll. Default: only Android/iOS.
110
110
111
111
## Scroll End Haptic Feedback (Modifier.scrollEndHaptic())
0 commit comments