On Android Support Library 24.1.1, the Snackbar was working fine:
Then starting on Android Support Library 24.2.0 onwards, the Snackbar started to behave like this:
On the library revision history, there is the following statement:
Behavior changes: Snackbar now draws behind the navigation bar if the status bar is translucent.
But the thing is that my app is full screen and it doesn't have the navigation bar or the status bar. How can I fix it?
setTextSize(24); //increase max lines of text in snackbar. default is 2. sbNoAct. show(); int height = sbView.
SnackBar takes a widget as a child. SnackBar takes the height of the child to render. When you pass a container with height 200 it will set the snack bar's height 200. scaffoldKey.
So to answer your question the actual duration for the long length is 2750 milliseconds.
It's 2020 and also I don't know if it's related but I got my snackbar having some padding at the bottom when using android 10 gesture navigation. None of the above works for my case. I finally got it fixed with a super simple line:
val snackbar = Snackbar.make(view, message, duration)
snackbar.isGestureInsetBottomIgnored = true // here
snackbar.show()
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With