SeslAppPickerGridView

class SeslAppPickerGridView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : SeslAppPickerView(source)

A specialized SeslAppPickerView that displays app items in a grid layout.

This class extends SeslAppPickerView and provides a grid-based representation for app selection. It uses a GridAdapter and an AutoFitGridLayoutManager to achieve the grid layout.

Key features:

  • Displays items in a grid.

  • Supports setting the number of columns (span count) for the grid.

  • Automatically adjusts padding and item spacing for a visually appealing grid.

  • Implements custom item decorations for rounded corners and spacing between grid items.

Parameters

context

The Context the view is running in, through which it can access the current theme, resources, etc.

attrs

The attributes of the XML tag that is inflating the view.

defStyleAttr

An attribute in the current theme that contains a reference to a style resource that supplies default values for the view. Can be 0 to not look for defaults.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Creates an instance of SeslAppPickerGridView.

Functions

Link copied to clipboard
open override fun getAppPickerAdapter(viewType: Int): AbsAdapter

Retrieves the adapter for the app picker view.

Link copied to clipboard
open override fun getLayoutManager(viewType: Int): AutoFitGridLayoutManager

Returns the AutoFitGridLayoutManager to be used for the RecyclerView.

Link copied to clipboard
fun setGridSpanCount(spanCount: Int)

Sets the number of columns (span count) for the grid layout.

Link copied to clipboard
open override fun setItemDecoration(i: Int, headerFooterAdapter: HeaderFooterAdapter)