Since I've migrated my Android Project to AndroidX i am receiving the following lint error:
Error: Must be one of: Snackbar.LENGTH_INDEFINITE, Snackbar.LENGTH_SHORT, Snackbar.LENGTH_LONG [WrongConstant]
Snackbar snackbar = Snackbar.make(rootView, message, sticky ? Snackbar.LENGTH_INDEFINITE : 4500
So instead of defining a custom duration (4500ms), I am now using Snackbar.LENGTH_LONG
.
Since i am implementing some time-based operation that depends on how long the snackbar is visible, I need to know the actual duration of Snackbar.LENGTH_LONG
in milliseconds. How do I find out that value?
The docs are not really helpful here:
Show the Snackbar for a short period of time.