Skip to content

Conversation

@HChenX
Copy link
Contributor

@HChenX HChenX commented Nov 18, 2025

This commit refactors the pull-to-refresh drag resistance mechanism to align with the Overscroll utility.

Key changes:

  • Replaces the custom resistance calculation with DefaultParabolaScrollEasing for a more consistent feel.
  • Introduces currentTouch to track the raw pointer distance, separate from the visual dragOffset.
  • Renames rawDragOffset to dragOffset for clarity.
  • Simplifies the nested scroll connection by centralizing offset calculations into a new addTouchDelta function.

This commit refactors the pull-to-refresh drag resistance mechanism to align with the `Overscroll` utility.

Key changes:
*   Replaces the custom resistance calculation with `DefaultParabolaScrollEasing` for a more consistent feel.
*   Introduces `currentTouch` to track the raw pointer distance, separate from the visual `dragOffset`.
*   Renames `rawDragOffset` to `dragOffset` for clarity.
*   Simplifies the nested scroll connection by centralizing offset calculations into a new `addTouchDelta` function.
@YuKongA YuKongA requested a review from Copilot November 18, 2025 14:54
Copilot finished reviewing on behalf of YuKongA November 18, 2025 14:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the pull-to-refresh drag resistance mechanism to align with the Overscroll utility, improving consistency and code maintainability.

Key changes:

  • Replaces custom resistance calculation with DefaultParabolaScrollEasing for consistent drag behavior
  • Introduces currentTouch to track raw pointer distance separately from the damped visual dragOffset
  • Centralizes offset calculations into a new addTouchDelta helper function for cleaner nested scroll handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

YuKongA and others added 5 commits November 18, 2025 23:00
…Refresh.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…Refresh.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@YuKongA YuKongA merged commit 2b2cb7d into compose-miuix-ui:main Nov 18, 2025
5 checks passed
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.

2 participants