Skip to content

Comments

manager: optimize BottomBar pagescroll animation#3196

Merged
YuKongA merged 2 commits intotiann:mainfrom
u9521:page-anim
Feb 3, 2026
Merged

manager: optimize BottomBar pagescroll animation#3196
YuKongA merged 2 commits intotiann:mainfrom
u9521:page-anim

Conversation

@u9521
Copy link
Contributor

@u9521 u9521 commented Feb 3, 2026

  • Replace animateScrollToPage with animateScrollBy
  • using a dynamic duration based on the distance between pages.

- Replace `animateScrollToPage` with `animateScrollBy` using a dynamic duration based on the distance between pages.
- Ensure the selected state synchronizes with the `pageState` upon completion of the scroll animation.

Signed-off-by: u9521 <[email protected]>
Copy link
Contributor

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 optimizes the BottomBar page scroll animation by replacing animateScrollToPage with animateScrollBy and implementing dynamic animation duration based on page distance. The change aims to provide smoother and more proportional animations when navigating between pages in the bottom navigation bar.

Changes:

  • Replaced animateScrollToPage with pixel-based animateScrollBy for more granular control
  • Introduced dynamic duration calculation that scales with navigation distance
  • Added state management (selectedPage, isNavigating) to track navigation state and prevent conflicts during animation

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

- Track navigation coroutine jobs to allow cancellation when a new page is selected.
- Ensure `isNavigating` and `selectedPage` are only updated by the most recent navigation job.
- Adjust scroll animation duration calculation based on distance.

Signed-off-by: u9521 <[email protected]>
@YuKongA YuKongA merged commit 097f832 into tiann:main Feb 3, 2026
@YuKongA
Copy link
Collaborator

YuKongA commented Feb 3, 2026

漏了从第四页通过侧滑回主页时也需要

KOWX712 pushed a commit to KOWX712/KernelSU that referenced this pull request Feb 3, 2026
- Replace `animateScrollToPage` with `animateScrollBy`
- using a dynamic duration based on the distance between pages.

---------

Signed-off-by: u9521 <[email protected]>
@u9521
Copy link
Contributor Author

u9521 commented Feb 3, 2026

漏了从第四页通过侧滑回主页时也需要

#3197 😥 加了,现在首页两个卡片和返回也用新动画了,应该齐了吧

@u9521 u9521 deleted the page-anim branch February 3, 2026 12:56
PhuScam pushed a commit to PhuScam/KernelSU that referenced this pull request Feb 5, 2026
- Replace `animateScrollToPage` with `animateScrollBy`
- using a dynamic duration based on the distance between pages.

---------

Signed-off-by: u9521 <[email protected]>
PhuScam pushed a commit to PhuScam/KernelSU that referenced this pull request Feb 18, 2026
- Replace `animateScrollToPage` with `animateScrollBy`
- using a dynamic duration based on the distance between pages.

---------

Signed-off-by: u9521 <[email protected]>
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