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

Add OptionContainer for Android #2346

Closed
mhsmith opened this issue Jan 16, 2024 · 2 comments · Fixed by #2350
Closed

Add OptionContainer for Android #2346

mhsmith opened this issue Jan 16, 2024 · 2 comments · Fixed by #2350
Labels
android The issue relates to Android mobile support. enhancement New features, or improvements to existing features.

Comments

@mhsmith
Copy link
Member

mhsmith commented Jan 16, 2024

What is the problem or limitation you are having?

Android is now the only one of the main 5 platforms which doesn't support OptionContainer.

Describe the solution you'd like

Last time I looked into this, the recommended API was BottomNavigationView.

It requires an additional Gradle library, as shown here. This should be added to the Briefcase template, and the Toga code should be written such that if the library is missing, it doesn't crash unless the app actually tries to use the widget.

Like iOS, it has a limit of 5 items. Unlike iOS, I don't think it has any built-in overflow mechanism. For the initial implementation, we agreed we can just accept the limit and document it.

@mhsmith mhsmith added enhancement New features, or improvements to existing features. android The issue relates to Android mobile support. labels Jan 16, 2024
@freakboy3742
Copy link
Member

Instead of hard coding in the Android template, would it be worth taking this opportunity to convert the list of library requirements that are in the template into a pyproject.toml configuration item (analogous to system_runtime_requires on linux)? In this case, Material seems like a reasonably common library (as are the others already there), but providing the option to remove libraries (or include other ones) would seem like a worthwhile related change.

@mhsmith
Copy link
Member Author

mhsmith commented Jan 17, 2024

Makes sense, but since existing apps may automatically update their Toga version on a briefcase update -r without updating anything else, the Toga code should still protect itself against a missing library as noted above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. enhancement New features, or improvements to existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants