Here is my conclusion about this:
Android supports multi-line snackbars, but has a maximum limit of 2 lines, which corresponds to the design guide, which states that the height of the multi-line snack bar should be 80dp (almost 2 lines)
To make sure of this, I used a sample cheesesquare android samples. If I use the following line:
Snackbar.make(view, "Random Text \n When a second snackbar is triggered while the first is displayed", Snackbar.LENGTH_LONG) .setAction("Action", null).show();
In this case, I see a multi-line snack panel with the text of the 2nd line, i.e. "When the second nook starts," but if I change this code to the following implementation:
Snackbar.make(view, "Random Text \n When \na second snackbar is triggered while the first is displayed", Snackbar.LENGTH_LONG) .setAction("Action", null).show();
I can only see "Random Text \ nWhen ... ". This means that the design library intentionally forces textview to have a maximum of 2 lines.
mudit Jun 08 '15 at 9:53 on 2015-06-08 09:53
source share