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

实现了更符合 MD3 的过渡动画 #12

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Dustin-Jiang
Copy link

跟着 Material You 指南中的 Transition 章节 改进了原有的过场动画.

  • 升级了 AGP 版本, 虽然我也不知道为什么要升级, 但是 Android Studio 这样提示的 ();
  • 实现了 MaterialSharedAxis 的过渡动画;
  • 用 NavHost 重新实现了 IndexScreen 的导航, 方便实现过渡动画 (原来用 HorizontalPager 的实现有点迷惑, 而且好像没法做复杂一点的 Transition).

第一次接触安卓开发, 自然而然就拿 BIT101 练手了 ()

希望没犯很大的错误 qwq

- Introduce `MotionConstants` for default motion values.
- Implement Material Shared Axis animations for X and Y axes.
- Update the enter, exit, popEnter, and popExit transitions to use `materialSharedAxisXIn` and `materialSharedAxisXOut`.
- Modify navigation colors and backgrounds for a transparent navigation bar.
- Remove unused imports and update transition usage.
This commit introduces several improvements to the index page navigation.

**Changes:**

-   **Index Page Navigation:**
    -   Replaced `HorizontalPager` with `NavHost` for more flexible navigation.
    -   Used navigation route to control navigation.
    -   Added shared Z-axis transition animations for smoother navigation.
    - Changed index page struct to support route.
-   **Motion Constants:**
    - Added EmphasizedDecelerate and EmphasizedAccelerate for easing.
-   **Material Shared Axis:**
    - Added `materialSharedAxisZIn` and `materialSharedAxisZOut` for shared Z-axis transition.
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.

1 participant