Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prototype of a stepper composable helper for making backstacks.#1423

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
zach-klippenstein wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromzachklipp/backstack-helper

Conversation

@zach-klippenstein
Copy link
Collaborator

No description provided.

@zach-klippensteinzach-klippensteinforce-pushed thezachklipp/backstack-helper branch 8 times, most recently frome5c4530 tof5c2987CompareSeptember 11, 2025 19:37
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
public interface Stepper<T, R> {

/** The (possibly empty) stack of steps that came before the current one. */
val previousSteps: List<Step<R>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think you added this one later and it wasn't part of the initial revision and I meant to call out that something like this is needed. Likely, I would even go a step further and argue thatstepper() should not return aList<R>, but rather a type that expresses how the backstack was changed.

Here is my prototype that Amazon uses in production now:https://github.com/amzn/app-platform/blob/main/recipes/common/impl/src/commonMain/kotlin/software/amazon/app/platform/recipes/backstack/PresenterBackstackScope.kt#L19-L32 (it's not part of the official API, because I wanted get an idea first how it works out in production). Here it runs in the browser:https://amzn.github.io/app-platform/#web-recipe-app

The problem I wanted to solve is to make it easy for the UI layer to play animations for changes in the backstack, like the cross-slide animation in the demo above. Exposing only a stack makes this more challenging for the UI layer. That's why I introduced theBackstackChange type.

*
* @return False if the stack was empty (i.e. this is a noop).
*/
fun goBack(): Boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If this is a stack, why not call types and functions accordingly?push() andpop() feel more natural to me.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@vRallevvRallevvRallev left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@zach-klippenstein@vRallev

[8]ページ先頭

©2009-2025 Movatter.jp