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
Bug 1925333 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
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](https://searchfox.org/mozilla-central/source/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/compose/snackbar/SnackbarState.kt) accordingly to take a `Long` duration instead of an `Int` duration