Skip to content

manager: use spring animation for pager navigation#3492

Open
XiaoTong6666 wants to merge 4 commits into
tiann:mainfrom
XiaoTong6666:pr4
Open

manager: use spring animation for pager navigation#3492
XiaoTong6666 wants to merge 4 commits into
tiann:mainfrom
XiaoTong6666:pr4

Conversation

@XiaoTong6666

@XiaoTong6666 XiaoTong6666 commented May 25, 2026

Copy link
Copy Markdown
Contributor
  • Replace tween-based pager navigation with Compose spring animation.
  • Extract pager navigation state handling into MainPagerState.
  • Use Animatable with spring animation instead of animateScrollBy(tween) for pager transitions.
  • Keep existing scroll consumption checks and settling behavior.

The spring parameters are mapped from the previous damped spring model:

x'' = -c * x' - k * (x - target)
stiffness = k
dampingRatio = c / (2 * sqrt(k))
k = 322.2
c = 32.31
dampingRatio ~= 0.9

@XiaoTong6666 XiaoTong6666 marked this pull request as draft May 25, 2026 16:06
@XiaoTong6666 XiaoTong6666 changed the title maImplement custom spring physics for pager scrolling and fix overscroll artifacts manager: Implement custom spring physics for pager scrolling and fix overscroll artifacts May 25, 2026
@XiaoTong6666 XiaoTong6666 changed the title manager: Implement custom spring physics for pager scrolling and fix overscroll artifacts manager: enhance pager navigation with spring physics and fix overscroll artifacts May 25, 2026
@XiaoTong6666 XiaoTong6666 force-pushed the pr4 branch 2 times, most recently from edc6285 to e960e80 Compare May 25, 2026 16:20
@XiaoTong6666 XiaoTong6666 marked this pull request as ready for review May 25, 2026 16:24
@YuKongA YuKongA requested a review from Copilot May 25, 2026 16:25

This comment was marked as outdated.

@XiaoTong6666 XiaoTong6666 marked this pull request as draft May 26, 2026 11:13
@XiaoTong6666 XiaoTong6666 changed the title manager: enhance pager navigation with spring physics and fix overscroll artifacts manager: use spring animation for pager navigation Jun 18, 2026
@XiaoTong6666 XiaoTong6666 marked this pull request as ready for review June 18, 2026 18:16
@YuKongA YuKongA requested a review from Copilot June 19, 2026 16:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread manager/app/src/main/java/me/weishu/kernelsu/ui/component/bottombar/BottomBar.kt Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@XiaoTong6666 XiaoTong6666 force-pushed the pr4 branch 5 times, most recently from 00966e2 to 3c9a558 Compare July 2, 2026 12:53
Replace tween-based pager scrolling in MainPagerState with a
spring-driven TargetBasedAnimation while keeping the existing
scroll delta checks and settling behavior.
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.

3 participants