private void showGridView ( ) { gridView = contentContainer . findViewById ( R . id . bottom_sheet_grid_view ) ; if ( gridView != null ) { contentContainer . setVisibility ( View . VISIBLE ) ; if ( getStyle ( ) == Style . GRID ) { int horizontalPadding = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_grid_item_horizontal_padding ) ; int paddingBottom = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_grid_padding_bottom ) ; gridView . setPadding ( horizontalPadding , 0 , horizontalPadding , paddingBottom ) ; gridView . setNumColumns ( GridView . AUTO_FIT ) ; gridView . setColumnWidth ( getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_grid_item_size ) ) ; } else { int paddingBottom = getContext ( ) . getResources ( ) . getDimensionPixelSize ( R . dimen . bottom_sheet_list_padding_bottom ) ; gridView . setPadding ( 0 , 0 , 0 , paddingBottom ) ; gridView . setNumColumns ( getStyle ( ) == Style . LIST_COLUMNS && ( getDeviceType ( getContext ( ) ) == DisplayUtil . DeviceType . TABLET || getOrientation ( getContext ( ) ) == DisplayUtil . Orientation . LANDSCAPE ) ? 2 : 1 ) ; } gridView . setOnItemClickListener ( createItemClickListener ( ) ) ; gridView . setOnItemLongClickListener ( createItemLongClickListener ( ) ) ; gridView . setAdapter ( adapter ) ; } }
Shows the grid view which is used to show the bottom sheet s items .