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

Animate scroll initiated by mouse wheel input #438

Merged
merged 26 commits into from
Mar 23, 2023

Conversation

MatkovIvan
Copy link
Member

@MatkovIvan MatkovIvan commented Mar 15, 2023

Proposed Changes

Testing

Test: Scroll some scrollable view via mouse wheel; Observe smooth animated position changes.

Issues Fixed

Fixes JetBrains/compose-multiplatform#1955

@MatkovIvan MatkovIvan added the enhancement New feature or request label Mar 15, 2023
@MatkovIvan MatkovIvan requested a review from igordmn March 15, 2023 15:41
@MatkovIvan MatkovIvan self-assigned this Mar 15, 2023
@MatkovIvan MatkovIvan marked this pull request as ready for review March 17, 2023 10:48
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good with mouse and touch.

Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Looks very smooth on the latest commit on Windows with a mouse, and works as expected on macOs with a touchpad/mouse (without smoothing)

@MatkovIvan MatkovIvan merged commit 7fdfeea into jb-main Mar 23, 2023
@MatkovIvan MatkovIvan deleted the ivan.matkov/fix-scroll-progress-status branch March 23, 2023 12:27
igordmn pushed a commit that referenced this pull request Nov 15, 2023
…l input (#438)

* Set scroll progress state on mouse events

* Animate mouse wheel scroll

* Refactor changes

* Add helper inline functions

* Batch offsets

* Filter zero values and apply raw delta only without animation

* Use scrollBy inside animation, fix parameter usage in lambda

* Fix tests

* Add TODOs and comments

* Fix more tests

* Cleanup mouse hover test helper class

* Add test for scroll during animation

* Address feedback (part 1)

* Make smooth scrolling configurable

* Do not animate scroll on events from trackpads

* Fix internal type for tests

* Make animation scrolling speed density dependant

* Fix conditionally applying scroll modifier

* Fix cancel animation condition

* Cache smooth scrolling flag

* Adjust scrolling animation threshold

* Add isScrollInProgress TODO

* Add test for isSmoothScrollingEnabled flag

* Reset flag in finally

* Use strict comparison to detect consuming event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smooth scrolling not supported in Linux
2 participants