-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Android optioncontainer #2350
Android optioncontainer #2350
Conversation
They're always changing the recommended style, but it looks basically the same as it does in these screenshots of Electron Cash, so I don't think it's worth looking into. |
It works fine for me, at least for tabs disabled at construction time: toga.OptionContainer(
content=[
toga.OptionItem(
"Blue", toga.Box(style=Pack(background_color="cornflowerblue"))),
toga.OptionItem(
"Green", toga.Box(style=Pack(background_color="green")), enabled=False),
toga.OptionItem(
"Red", toga.Box(style=Pack(background_color="red"))),
],
... There's no visual difference, because inactive tabs are already gray, but the Green tab no longer responds to clicks. |
The Container base class requires |
8d26c4f
to
3fcf169
Compare
Adds an OptionContainer widget for Android.
Android's BottomNavigationBar only allows 5 items. This implementation will allow you to add more items, raising a warning if you have too many, or try to select an index beyond the maximum. If you delete a visible tab (making room for more content), the lowest tab index from the "extra" tabs will be made visible.
Requires beeware/briefcase#1610, because of the need for
build_gradle_dependencies
andbase_theme
TODO:
Fixes #2346
PR Checklist: