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

For canGoBackward and canGoForward, support callbacks in addition to precomputed booleans #290

Open
chimbori opened this issue Feb 18, 2020 · 0 comments

Comments

@chimbori
Copy link
Collaborator

Use Case

The use case is that the value of canGoBackward can change by clicking on the CTA button. In my case, the CTA button takes the user to grant custom permissions, and they can proceed when they have granted permission.

The current API for doing this for each slide takes a single Boolean which does not work, because it is never recomputed after initial setting.

The alternative way of setNavigationPolicy comes with its own challenges: it passes in a position parameter, so it is generic to all slides. In our code, some slides are optional, and only added in the flow if certain conditions are met. This makes keeping track of the slide positions quite challenging.

API Proposal

Add an overloaded canGoBackward and canGoForward that takes in an interface with a single-abstract-method that returns a boolean. At every instance where the library wants to decide if it can go forward or backward, it will call these methods once for each such occurrence.

I can implement this myself, but posting an issue to seek blessings for the proposed change and implementation direction. Thanks!

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