public final void setWidth ( final int width ) { if ( style == Style . LIST_COLUMNS && ( getDeviceType ( context ) == DeviceType . TABLET || getOrientation ( context ) == Orientation . LANDSCAPE ) ) { columnCount = 2 ; } else if ( style == Style . GRID ) { int padding = context . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_grid_item_horizontal_padding ) ; int itemSize = context . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_grid_item_size ) ; columnCount = ( ( getDeviceType ( context ) != DeviceType . TABLET && context . getResources ( ) . getConfiguration ( ) . orientation == Configuration . ORIENTATION_PORTRAIT ? context . getResources ( ) . getDisplayMetrics ( ) . widthPixels : width ) - 2 * padding ) / itemSize ; } else { columnCount = 1 ; } rawItems = null ; notifyDataSetChanged ( ) ; }
Sets the width of the bottom sheet the items which are displayed by the adapter belong to .