Navigation Root Provider
- Android specific navigation root provider. Collects the screen size and shape for animations. Uses CommonNavigationRootProvider.
diff --git a/docs/404.html b/docs/404.html index 2d6f6e4..9943076 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -
Android specific navigation root provider. Collects the screen size and shape for animations. Uses CommonNavigationRootProvider.
Creates a default platform-specific instance of NavigationRootData.
Initialize this outside of setContent and provide to NavigationRootProvider.
Creates a default platform-specific instance of NavigationRootData.
Android specific navigation root provider. Collects the screen size and shape for animations. Uses CommonNavigationRootProvider.
Base for the content animator scope implementations. Describes the bare minimum needed. When implementing - keep in mind:
elements, appearing and disappearing from the stack, update the state and trigger animations
onBackGesture represents the user's actions and should not be used to manipulate the stack
indexFromTop represents the index of the item from the top of the stack, with 0 being the top. Negative numbers represent an item not existing in the stack while being animated. If several items are being removed and all are animated at the same time - indexFromTop will be represent the order of the items being removed, -1 being the latest item that has been removed. Yes, the number can be less than -1.
animationProgressForScope is a value that is used to provide AnimatedVisibilityScope's to the content for things like modifiers that depend on SharedTransitionScope. The resulting value provided to the AnimatedVisibilityScope is constrained to a range between 0f and 1f. It's expected to mirror indexFromTop, meaning it must be -1 when the item is outside of the stack, 0 when at the top of the stack, and 1 when at the back of the stack. It's also expected to depend on back gestures.
Note: when several animations with different keys are used for a single item - the first scope is used to provide animationProgressForScope. Refer to ContentAnimator and contentAnimator for more information.
Creates an animation scope.
renderUntil Controls content rendering based on it's position in the stack and animation state. Content at or above renderUntil is always rendered if it's the item is index 0 or -1 (top or outside).
If requireVisibilityInBackstack is false (which is by default) - the top and outside items are rendered at all times while the backstack items are only rendered if they're being animated.
If requireVisibilityInBackstack is set to false - will be visible even when it's not animated (note that if you're combining animations, like fade() + scale(), if one of them has requireVisibilityInBackstack set to false - ALL items will be visible while in backstack as if all animations have requireVisibilityInBackstack set to true).
Base for the content animator scope implementations. Describes the bare minimum needed. When implementing - keep in mind:
Creates an animation scope.
Cache for child anim prerequisites so they arent recalculated hundreds of times per second during gestures
Manages the animation data cache.
Manages the children's animation state and modifiers. Creates instances of animator scopes avoiding duplicates.
Animates the stack. Caches the children for the time of animation.
This is useful for tracking exiting children and their order, which is not possible with sourceStack.contains(something)
This is basically a duplicate of the raw source stack. It's necessary to control the order of operations for correct animation data calculation.
Caching all children in an observable manner, so all updates are reflected in the ui.
This is useful for tracking exiting children and their order, which is not possible with sourceStack.contains(something)
This is basically a duplicate of the raw source stack. It's necessary to control the order of operations for correct animation data calculation.
Caching all children in an observable manner, so all updates are reflected in the ui.
Manages the animation data cache.
Manages the children's animation state and modifiers. Creates instances of animator scopes avoiding duplicates.
Creates an instance of a StackAnimatorScope. It manages instance caching and animations.
Animates the stack. Caches the children for the time of animation.
Creates an instance of a StackAnimatorScope. It manages instance caching and animations.
This is true when the animation(gestures and passive, excluding the navigation cancellation animation) targets the top of the stack from the back.
Example: removal of an item from the stack while this item was in the back
This is true when this item is going from a position in the back to another position in the back in any order, e.g. from 2 to 1, or from 1 to 2 (0 being the top of the stack).
This is true when the animation(passive, excluding the navigation cancellation animation) targets the outside of the stack from the back.
Example: removal of an item from the stack
This is true when this item is going from a position in the back to another position in the back that is closer to the top, e.g. from 2 to 1 (0 being the top of the stack).
Example: removal of an item from the stack while this item was (and will still be) in the back.
This is true when the animation(passive, excluding the navigation cancellation animation) targets the top of the stack from outside.
Example: addition of this item to stack.
This is true when the animation(passive, excluding the navigation cancellation animation) targets the back of the stack from the top.
Example: addition of an item to the stack when this item was at the top
This is true when the animation(gestures and passive, excluding the navigation cancellation animation) targets outside of the stack from the top.
Example: removal of an item from the stack
This is true when this item is going from a position in the back to another position in the back that is closer to the bottom, e.g. from 1 to 2 (0 being the top of the stack).
Example: addition of an item to the stack when this item was (and will still be) in the back.
Represents the status of an animation.
previousLocation must represent the previous location of an item in the stack. If the item has not been moved in the stack - previousLocation must be null.
location must represent the current location of an item in the stack (irrespective of the animation) and it's changes must trigger the animation.
direction must represent the direction of the animation even when animating with gestures.
animationType must represent the type of the current animation.
This is true when the animation(gestures and passive, excluding the navigation cancellation animation) targets the top of the stack from the back.
This is true when this item is going from a position in the back to another position in the back in any order, e.g. from 2 to 1, or from 1 to 2 (0 being the top of the stack).
This is true when the animation(passive, excluding the navigation cancellation animation) targets the outside of the stack from the back.
This is true when this item is going from a position in the back to another position in the back that is closer to the top, e.g. from 2 to 1 (0 being the top of the stack).
This is true when the animation(passive, excluding the navigation cancellation animation) targets the top of the stack from outside.
This is true when the animation(passive, excluding the navigation cancellation animation) targets the back of the stack from the top.
This is true when the animation(gestures and passive, excluding the navigation cancellation animation) targets outside of the stack from the top.
This is true when this item is going from a position in the back to another position in the back that is closer to the bottom, e.g. from 1 to 2 (0 being the top of the stack).
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Represents the type of an animation.
Returns a representation of an immutable list of all enum entries, in the order they're declared.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
Represents the animator used by StackAnimator to create the animation scope.
The key parameter helps optimize scope creation by preventing the creation of a new scope if one with the same key already exists.
The renderUntil parameter controls content rendering based on its position in the stack, with 0 being the top. StackAnimator will not render an item if its position is greater than renderUntil. The animation scope implementation can be aware of renderUntil.
The requireVisibilityInBackstack parameter manages the item's visibility in the backstack after animations are completed. If an item's position exceeds renderUntil and requireVisibilityInBackstack is true, the item will remain visible. Note that if multiple animations (e.g., fade() + scale()) are combined, and at least one has requireVisibilityInBackstack set to true, all items that do not meet renderUntil will be visible in the backstack.
The animatorScopeFactory parameter is used to create the animation scope. Refer to contentAnimator for an example.
The animationModifier parameter provides the animated Modifier to the content.
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Only happens upon removal of an item from the stack
Represents the location of an item in the stack. indexFromTop is the index of the item from the top of the stack, with 0 being the top. Negative indexFromTop represents an item not existing in the stack.
Represents the status of an animation.
Represents the type of an animation.
Contains all animations in a list.
Represents the animator used by StackAnimator to create the animation scope.
Represents the location of an item in the stack. indexFromTop is the index of the item from the top of the stack, with 0 being the top. Negative indexFromTop represents an item not existing in the stack.
Handles back gestures on both edges of the screen and drives the provided BackDispatcher accordingly.
is used for getting the back dispatcher conveniently.
a Modifier to applied to the overlay.
controls whether the start edge is enabled or not, left in LTR mode and right in RTL mode.
controls whether the end edge is enabled or not, right in LTR mode and left in RTL mode.
the width in Dp from the screen edge where the gesture first down touch is recognized. When null - use the entire width of the screen.
a distance threshold in Dp from the initial touch point in the direction of gesture. The gesture is initiated once this threshold is surpassed.
a threshold of progress that needs to be reached for the gesture to be confirmed once the touch is completed. The gesture is cancelled if the touch is completed without reaching the threshold.
a content to be shown under the overlay.
Provides navigation controller and view model stores, default component context, navigation root for overlays, and the back dispatcher vis CompositionLocalProvider, displays overlays.
Base for child instances. Contains componentContext for features like rememberRetained, OnDestinationDisposeEffect, LocalComponentContext.
Provides some data from the root of the app for displaying overlays and other things.
DO NOT CALL DIRECTLY. Use navController
DO NOT CALL DIRECTLY. Use navController
Simple store for navigation controllers.
DO NOT CALL DIRECTLY. Use navController
DO NOT CALL DIRECTLY. Use navController
DO NOT CALL DIRECTLY. Use navController
Generic navigation controller. Contains a stack for overlays and a stack for screens.
Navigates to a destination. If a destination exists already - moves it to the top instead of adding a new entry. If the removeIfIsPreceding is enabled (is by default) and the requested destination precedes the current one in the stack - navigate back instead.
Navigates back in this(!) nav controller.
Removes destinations that, in the stack, are after the provided one.
Replaces all destinations with the provided one.
Replaces the current destination with the provided one.
Removes destinations that, in the stack, are after the provided one.
Navigates back in this(!) nav controller.
Navigates to a destination. If a destination exists already - moves it to the top instead of adding a new entry. If the removeIfIsPreceding is enabled (is by default) and the requested destination precedes the current one in the stack - navigate back instead.
Replaces all destinations with the provided one.
Replaces the current destination with the provided one.
Sets up stack animators for overlays and contained content and manages back gestures for the animations. Animations are passed down using CompositionLocalProvider for other navigation hosts to consume.
router is a typical router where you declare the content of each destination.
allows to specify what destinations should not be rendered and animated.
Creates the root of the app for back gesture handling, storing view models, and navigation controller instances. View model store by default is wrapped into default component context's instance keeper.
Initialize this outside of setContent.
Fallback implementation of a navigation root provider. Uses BoxWithConstraints to provide the screen size, which is possibly incorrect on some platforms. Please use a platform implementation. You are welcome to open an issue or PR.
Sets up the navigation root. Is used for managing overlays. Contains information about the screen for some animations, like materialContainerMorph.
Detects drag gestures on a composable and dispatches back gestures to a BackDispatcher.
The BackDispatcher instance that will receive the back gestures.
Whether the left edge of the composable is enabled for back gestures.
Whether the right edge of the composable is enabled for back gestures.
The width of the edge area that will trigger a back gesture. Defaults to null. When null - uses the full composable's width
The minimum distance the user must drag to activate a back gesture. Defaults to 4.dp.
The minimum progress required to confirm a back gesture. Defaults to 0.2F.
The minimum velocity required to confirm a back gesture. Defaults to 8.dp.
Whether to block child drag inputs. Defaults to false.
Base for child instances. Contains componentContext for features like rememberRetained, OnDestinationDisposeEffect, LocalComponentContext.
Generic navigation controller. Contains a stack for overlays and a stack for screens.
Simple store for navigation controllers.
Sets up the navigation root. Is used for managing overlays. Contains information about the screen for some animations, like materialContainerMorph.
Creates the root of the app for back gesture handling, storing view models, and navigation controller instances. View model store by default is wrapped into default component context's instance keeper.
Detects drag gestures on a composable and dispatches back gestures to a BackDispatcher.
Handles back gestures on both edges of the screen and drives the provided BackDispatcher accordingly.
Provides navigation controller and view model stores, default component context, navigation root for overlays, and the back dispatcher vis CompositionLocalProvider, displays overlays.
Creates a navigation controller instance in the NavControllerStore, which allows for sharing the same instance between multiple calls of navController.
Sets up stack animators for overlays and contained content and manages back gestures for the animations. Animations are passed down using CompositionLocalProvider for other navigation hosts to consume.
Fallback implementation of a navigation root provider. Uses BoxWithConstraints to provide the screen size, which is possibly incorrect on some platforms. Please use a platform implementation. You are welcome to open an issue or PR.
Creates a navigation controller instance in the NavControllerStore, which allows for sharing the same instance between multiple calls of navController.
Is basically a decompose component that replicates the functionality of a generic navigation controller. The instance is not retained, therefore on configuration changes components will die and get recreated. By default inherits parent's ComponentContext.
childFactory allows for creating custom children instances that implement DecomposeChildInstance.
key is used for identifying childStack's during serialization and instances in NavControllerStore, which means keys MUST be unique.
On death removes itself from the NavControllerStore right after the composition's death.
Handles gestures using the provided back handler, which by default is the chileren's one.
Displays content in the overlay provided NavigationRootProvider
Kind of like DisposableEffect, but relies on InstanceKeeper.Instance's onDestroy to make sure an action is done when a component is actually destroyed, surviving configuration changes. Keys must be unique.
Handles gestures using the provided back handler, which by default is the chileren's one.
Displays content in the overlay provided NavigationRootProvider
Kind of like DisposableEffect, but relies on InstanceKeeper.Instance's onDestroy to make sure an action is done when a component is actually destroyed, surviving configuration changes. Keys must be unique.
Saves the call in a container that executes the call before getting fully destroyed, surviving configuration changes, making sure the block is only executed when a component fully dies,
Alternative to rememberSaveable that keeps the value alive during configuration changes, but not process death. Remembers and stores the value in the InstanceKeeper tied to ComponentContext provided by LocalComponentContext, meaning the value will be retained as long as the component/backstack entry (provided by NavHost) exists.
Saves the call in a container that executes the call before getting fully destroyed, surviving configuration changes, making sure the block is only executed when a component fully dies,
Alternative to rememberSaveable that keeps the value alive during configuration changes, but not process death. Remembers and stores the value in the InstanceKeeper tied to ComponentContext provided by LocalComponentContext, meaning the value will be retained as long as the component/backstack entry (provided by NavHost) exists.
Gets an existing view model instance. Does not manage the view model's lifecycle.
Creates a view model instance using the prepared (by prepareLazyViewModel) reference if an instance does not exist. The first instance manages the view model's lifecycle.
Gets an existing view model instance. Does not manage the view model's lifecycle.
Creates a view model instance using the prepared (by prepareLazyViewModel) reference if an instance does not exist. The first instance manages the view model's lifecycle.
Prepares a simple lazy view model. A reference is saved in ViewModelStore which is later called by getLazyViewModel
Android-like view model instancer. Will get or create a ViewModel instance in the LocalViewModelStore. Provide key if you have multiple instances of the same view model, or it will get the first created one. ViewModel.onDestroy method will be called when the component/destination is removed and AFTER the composable gets destroyed.
Prepares a simple lazy view model. A reference is saved in ViewModelStore which is later called by getLazyViewModel
Android-like view model instancer. Will get or create a ViewModel instance in the LocalViewModelStore. Provide key if you have multiple instances of the same view model, or it will get the first created one. ViewModel.onDestroy method will be called when the component/destination is removed and AFTER the composable gets destroyed.
JVM specific navigation root provider. Collects the max window size for animations. Uses CommonNavigationRootProvider.
Creates a default platform-specific instance of NavigationRootData.
Initialize this outside of setContent and provide to NavigationRootProvider.
Creates a default platform-specific instance of NavigationRootData.
JVM specific navigation root provider. Collects the max window size for animations. Uses CommonNavigationRootProvider.
hewo