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

Consider API for manually controlling transition #17

Open
zach-klippenstein opened this issue Apr 2, 2020 · 0 comments
Open

Consider API for manually controlling transition #17

zach-klippenstein opened this issue Apr 2, 2020 · 0 comments

Comments

@zach-klippenstein
Copy link
Collaborator

The API should allow the caller to directly control the progress used to calculate visibility for transition modifiers. When the progress is specified, the top two elements of the stack should be snapshotted and changes to the backstack should be disallowed until the caller is no longer controlling it.

The backstack viewer app should include support for this, either as a slider or from inside the screens themselves (drag on the app bar?).

Use Cases

This could be useful for debugging transitions or UIs that provide their own iOS-like "peek" back gestures.

Manual peek and controlling transitions that were triggered by new backstacks are two distinct use cases and it might not make sense to try to support both, at least with the same API.

Peek API

Add a parameter to Backstack:

@FloatRange(0f, 1f) peekPercentage: Float? = null,

When this value is non-null, the top screen and the screen below it are shown mid-transition.

Open Questions

  • How to handle when control is released mid-transition? Animate based on stack diff?
  • Provide API to observe current transition progress? This would be more consistent with other declarative APIs. Default implementation observes transition progress and immediately feeds it back, but custom behavior could modify.
zach-klippenstein added a commit that referenced this issue Mar 15, 2021
- All the actual transition logic is moved out of the `Backstack` composable and into `TransitionController`.
- `BackstackInspector` and `InspectionGestureDetector` are replaced with a single API in a new, dedicated module: `xrayed()`.
- `Backstack` now just handles the container and managing saveable state.
- Introduces `FrameController`, an abstraction which can be used to implement both transitions, the inspector functionality, and things like #17.
- Removes the spring animations from the inspector. They added unnecessary lag to the gestures.
- Adds more tests for state handling.
- Fixed some races that caused navigation animation glitches.

This change fixes a number of issues:
- Closes #4
- Closes #5
- Closes #16
- Closes #42
- Closes #44 (camera distance API is used to improve the 3D view, but not for zooming itself)
- Unblocks #17
zach-klippenstein added a commit that referenced this issue Mar 15, 2021
- All the actual transition logic is moved out of the `Backstack` composable and into `TransitionController`.
- `BackstackInspector` and `InspectionGestureDetector` are replaced with a single API in a new, dedicated module: `xrayed()`.
- `Backstack` now just handles the container and managing saveable state.
- Introduces `FrameController`, an abstraction which can be used to implement both transitions, the inspector functionality, and things like #17.
- Removes the spring animations from the inspector. They added unnecessary lag to the gestures.
- Adds more tests for state handling.
- Fixed some races that caused navigation animation glitches.

This change fixes a number of issues:
- Closes #4
- Closes #5
- Closes #16
- Closes #42
- Closes #44 (camera distance API is used to improve the 3D view, but not for zooming itself)
- Unblocks #17
zach-klippenstein added a commit that referenced this issue Mar 15, 2021
- All the actual transition logic is moved out of the `Backstack` composable and into `TransitionController`.
- `BackstackInspector` and `InspectionGestureDetector` are replaced with a single API in a new, dedicated module: `xrayed()`.
- `Backstack` now just handles the container and managing saveable state.
- Introduces `FrameController`, an abstraction which can be used to implement both transitions, the inspector functionality, and things like #17.
- Removes the spring animations from the inspector. They added unnecessary lag to the gestures.
- Adds more tests for state handling.
- Fixed some races that caused navigation animation glitches.

This change fixes a number of issues:
- Closes #4
- Closes #5
- Closes #16
- Closes #42
- Closes #44 (camera distance API is used to improve the 3D view, but not for zooming itself)
- Unblocks #17
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

No branches or pull requests

1 participant