toga icon indicating copy to clipboard operation
toga copied to clipboard

[Android Backend] move to Material3

Open Heus-Sueh opened this issue 2 years ago • 8 comments

What is the problem or limitation you are having?

The version of Material Design used now is quite old and dated despite being usable

Describe the solution you'd like

Material3 is much more beautiful and modern

https://developer.android.com/jetpack/compose/designsystems/material2-material3

Describe alternatives you've considered

None

Additional context

It would be really cool to be able to create Material3 apps using the simplicity of Python

Heus-Sueh avatar Nov 29 '23 01:11 Heus-Sueh

Broadly speaking, I agree that we should try to keep up to date with current design preferences on the Android platform.

In terms of how we would go about adopting Material3... I'm not entirely sure what that involves. Based on the migration guide that you've linked, it's not clear to me that we're even using Material2 at present - we're only using 1 widget in the androidx namespace (SwipeRefreshLayout), and that widget isn't in the material sub-namespace. I don't know if a material3 backend would effectively be an entirely different Toga backend, or if we can adopt or transition to Material3 in the current Android backend.

freakboy3742 avatar Nov 29 '23 04:11 freakboy3742

If Material 3 is based on Jetpack Compose, which appears to be the case, then that would have to be a completely separate backend.

mhsmith avatar Nov 29 '23 08:11 mhsmith

If Material 3 is based on Jetpack Compose, which appears to be the case, then that would have to be a completely separate backend.

That would take a lot of effort, right?

Heus-Sueh avatar Nov 30 '23 13:11 Heus-Sueh

Yes, it could share some of the low-level parts of the existing Android backend, but the widgets themselves would be quite different, and the layout system too.

mhsmith avatar Nov 30 '23 15:11 mhsmith

Yes, it could share some of the low-level parts of the existing Android backend, but the widgets themselves would be quite different, and the layout system too.

Do you think it's worth the effort to try to do this migration or is it not a priority right now?

Heus-Sueh avatar Dec 01 '23 00:12 Heus-Sueh

It is unlikely to be a priority for the core team any time soon.

However, if you are motivated to try your hand at a migration, I'd encourage you to try.

freakboy3742 avatar Dec 01 '23 00:12 freakboy3742

An update on Material3 support - We've had to introduce Material3 in order to add the OptionContainer widget in #2350. Based on that experience, we don't need to move to Jetpack Compose; "Material Design Components for Android" exist that work in the existing layout structure.

On that basis, once #2350 lands, it should be possible to migrate on a widget-by-widget basis, and get the "new" look and feel of any widgets by changing the underlying widget (e.g., using com.google.android.material.button.MaterialButton instead of android.widgets.Button), adapting any to any API changes, and updating the widget probe to accomodate any behavioural/appearance changes.

freakboy3742 avatar Jan 25 '24 04:01 freakboy3742

I haven't yet released anything based on beeware, for exactly this reason: The widgets look dated, acceptance isn't good.

That said: Moving to "state of play" status regarding current design like MD3 would be WONDERFUL (caps intended!)

PS: Thanks for all your efforts, this is a great project!

sfc23 avatar Apr 12 '24 22:04 sfc23