miuix-nav draft#346
Open
YuKongA wants to merge 118 commits into
Open
Conversation
Adds NavTransitions object with Cupertino, MiuixDefault, AndroidCrossActivity, Scale, Fade, SharedAxisX, Modal, and None — all pure functions of relativeDepth, deferred-read inside navGraphicsTransition blocks, zero recomposition.
Saveable state is the one subsystem keyed by contentKey.toString() rather than by the key object, so distinct-by-equals keys with an equal toString (same-named data classes in different packages, Int 1 vs String "1" from factories) passed the equality-based duplicate guard and collapsed into one SaveableStateProvider slot: co-composed colliders crashed with "Key was used multiple times", separated ones silently bled or erased each other's rememberSaveable state. Extend the reconcile-time guard to require saveable-key uniqueness across the new stack and entries still animating out, sharing one navSaveableKey definition with the holder so validation and the slot key cannot drift. Pin the contract with collision, mixed-hierarchy save/restore, and swipe-vs-scroll arbitration tests, and document the contentKey toString requirements in the entry DSL and the guide (including the preset table's misattributed corner clip / dim, which belong to NavDisplayEffects).
Drop Cupertino, Scale, Fade, and SharedAxisX from NavTransitions: Cupertino had become line-for-line identical to MiuixDefault, and the three generic looks had zero usage anywhere while being a few lines each on the public navGraphicsTransition builder. The library ships only its own navigation feel; Modal stays as the sole opaqueDepth = 2f structure backing modal takeover, and None as the named no-animation primitive. MiuixDefault becomes the default transition of all NavDisplay overloads — visually identical to the previous Cupertino default. The guide's preset table shrinks accordingly and the custom-transitions section gains a cross-fade recipe showing how to build the removed looks externally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces documentation and code changes to add support for the new
miuix-navnavigation runtime, replacing the previous dependency onandroidx.navigation3in the example app. It includes comprehensive English and Chinese documentation, updates navigation-related imports and dependencies, and integratesmiuix-navinto the app's navigation system.Documentation additions:
miuix-nav:docs/guide/miuix-nav.mdexplaining setup, usage, transitions, gestures, save/restore, and extension boundaries.docs/zh_CN/guide/miuix-nav.mdwith equivalent content.miuix-navguide. [1] [2]Example app migration to
miuix-nav:Dependency changes:
androidx.navigation3andmiuixNavigation3Uidependencies fromexample/shared/build.gradle.ktsand addedmiuixNav.Codebase refactor to use
miuix-nav:navigation3.Routewithnavigation.Routein the app code.androidx.navigation3APIs inAppContent.ktand replaced them withmiuix-navequivalents, including transitions, effects, and back stack management. [1] [2]These changes ensure the app and documentation now use and explain the new
miuix-navnavigation system, providing a more flexible and modern navigation experience.