3

When I loose connection within the Youtube Android app, there's a little Snackbar that appears on the bottom saying there's no connection.

That Snackbar is considerably smaller (in height) to a normal Snackbar and font size seems smaller also. Couldn't find documentation or either references on it. Should I create a custom View for that or is there any simple way to do so?

Also a related question: is it applicable within material design parameters to create that "mini-snackbar"? I see no reference to it in io.materialdesign website but nethertheless Google uses it on the Youtube app.

elanonrigby
  • 479
  • 1
  • 6
  • 14

1 Answers1

1

Even though, the Snackbar does not allow you to set a custom layout, you can get its View. Then, you can access (and alter) its LayoutParams, which you use to change the layout parameters of the Snackbar including its height.

Alternatively, you could create your custom Snackbar by extending BaseTransientBottomBar class. Also, you may consider looking into using one of the many external libraries featuring custom Snackbar implementations: Here's an example I've been using for a while already: CSnackBar

Sergey Emeliyanov
  • 5,158
  • 6
  • 29
  • 52