Consolidate the Snackbar styling code
Categories
(Firefox for Android :: Design System and Theming, task)
Tracking
()
People
(Reporter: 007, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][group4])
After moving to material 3, we'll be able to use the modern Snackbar composable API which allows for customizable data parameters. This will allow us to consolidate our logic for showing a "default" snackbar and a "warning" snackbar.
As part of this ticket:
- Use the Material 3 Snackbar APIs to make it so we only need one underlying SnackbarHost to show all of our Snackbar use cases.
- Investigate if
AcornSnackbarHostStatecan be removed.
| Reporter | ||
Updated•1 year ago
|
Comment 1•1 year ago
•
|
||
The material library has non positive snackbar duration constants for (LENGTH_INDEFINITE, LENGTH_SHORT, and LENGTH_LONG). If a positive constant is provided as the duration, the material library interprets this as a custom duration instead of a preset one. Thus, our SnackbarDelegate in AC currently takes in an Int duration (as we only allow for these presets at the moment).
Bug 1925090 adds the ability to use these custom durations. Thus, we want to change the duration param of FenixSnackbarDelegate.show so that it takes a Long, as that's what is commonly used for time lengths and for animations. It's also what the underlying SnackbarHost code uses. However, this would mean that the fenix implementation, FenixSnackbarDelegate, needs to be changed to take to a long => SnackbarDelegate would need to be changed to have a Long duration as well. This would lead to a huge refactor, which would also involve ensuring that nothing in focus breaks. This is out of the scope of Bug 1925090 so the investigation of doing this should also take place here when migrating to Material 3.
Ensure that after doing so, that we also update SnackbarState.kt accordingly to take a Long duration instead of an Int duration
| Reporter | ||
Comment 2•1 year ago
|
||
Additionally, remove the SnackbarColors data class and remove the custom Composable and instead directly leverage the M3 Snackbar composable
Updated•1 year ago
|
Comment 3•11 months ago
|
||
UX confirmed the warning snackbar is deprecated (see Figma), so we should be able to remove AcornSnackbarHostState.
Comment 4•10 months ago
|
||
Completed as part of Bug 1975266.
Updated•6 months ago
|
Description
•