Skip to content

4 Using different styles

Michael Rapp edited this page Dec 30, 2017 · 1 revision

The library provides three predefined styles, which can be used in order to display a bottom sheet's items. They can be arranged as a list, which is the default style, as a two-columned list or as a grid. These different styles are represented by the values of the enum BottomSheet.Style. In order to apply a style, the respective enum value has to be passed to the setStyle-method of a BottomSheet.Builder. When displaying the items as a list or two-columned list, the items' icons should have a size of 24dp. When using a grid instead, the icons' size should be 48dp.

Furthermore, it is possible to specify the width of a bottom sheet by using the setWidth-method. On smartphones the bottom sheet always takes up the whole available horizontal space, when in portrait mode. Because of the limited space, even when displaying the bottom sheet's items as a two-columned list, they are arranged using a single column on smartphones in portrait mode. The following image shows the appearance of a bottom sheet, when its items are arranged as a two-columned list, respectively a grid:

Clone this wiki locally