Kennyc1012 / BottomSheetMenu

BottomSheetMenu style dialogs for Android
Apache License 2.0
887 stars 99 forks source link

Number of columns if Grid? #25

Closed allanguintu closed 8 years ago

allanguintu commented 8 years ago

Is there any way to set the number of columns using the grid? I have the same number of items like in the example. It doesnt look good having 4 icons on the first row and then 2 icons on the bottom row. Is there any settings I could change to set number of columns?

Thanks

Kennyc1012 commented 8 years ago

Its modeled after the design guidelines found here where it shows tablets having 4 icons in a row. However, I will update it to alter the logic to evenly distribute them based on the number of icons present

allanguintu commented 8 years ago

Thank you.. really looking forward to that.

Kennyc1012 commented 8 years ago

The way column count will work for grids is as followed:

You can set the number of columns via the builder by calling the setColumnCount(int count) method, or you can set it via a style by specifying the <attr name="bottom_sheet_column_count" format="integer" /> attribute

If the column count isn't specified, it will be obtained based on the number of items to display. If there are 7 or more items or exactly 4 items, 4 columns will be shown. If 1,2,3 or 5 items are to be displayed, 3 columns will be shown.

These values are only used if using the Grid style. The list style still follows the same logic as before

allanguintu commented 8 years ago

Wow! That was quick... thank you very much sir Kenny!