is TwoPaneBackStackEntry composable list of routes incompatible with arguments / URI Routes?

Copper Contributor

Hello,

I am doing some tests on the SDK and have encountered a roadblock. Currently, my application uses route arguments to find item details. However, upon navigating to them, the following exception is returned:

java.lang.IllegalArgumentException: Invalid route item/4, not present in list of routes [home?, items?, item/{itemId}, ...]

 
I am unsure if this is a problem stemming from the fact that listOf[Routes] cannot take into account those values or if it is an error on my end. Could you please clarify?

Thank you for all your hard work!

6 Replies
I tried a lot of things but I think it may be a limitation of the library given how it handles the routes as a list.

For now I continued using the library using the twopane composable (without nav), this allows some flexibility in other places where I was sure the twopanenav wouldn't work out.

It would be nice to find a fix/workaround for this anyways.

Hi @tscholze and @Papes96, thanks for your questions.

Unfortunately, you're right that the current implementation does not support arguments in the list of routes. While we work on a fix for this, I hope you can continue to use the original TwoPaneLayout composable to provide more flexibility.

 

Sorry for the inconvenience and thanks for providing feedback!

@khalper Thanks for the tip!

 

Do you have any rough ETA on which the "new approach" will support parameters? :)

@tscholze I unfortunately don't have an ETA at the moment, but I will make sure to reply to this thread with any updates/release information! Thanks for your patience :)
Hi @tscholze and @Papes96,
I'm working on updating TwoPaneLayoutNav to support navigation with arguments on this branch: https://github.com/microsoft/surface-duo-compose-sdk/tree/khalp/twopanelayoutnav-args

I will be testing out the current approach for the next sprint, but if you have any other thoughts/feedback on if this implementation would be helpful for your use case, let me know!