SeslAppPickerSelectLayout

open class SeslAppPickerSelectLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0, defStyleRes: Int = 0) : FrameLayout, AppPickerState, AppPickerEvent, LogTag(source)

A custom layout class for displaying a list of apps and that also supports showing a secondary list for displaying list of selected items either at the top or at the side which is enabled usingenableSelectedAppPickerView.

Key Features:

  • Dynamic Layout: Automatically adjusts layout between portrait and landscape, and based on whether the selected apps view is visible.

  • Selected Apps View: Can display a separate list of currently selected apps, either horizontally at the top (portrait) or vertically on the side (landscape).

  • Header Support: Allows for a custom header view to be displayed above the selected apps view.

  • Search Filtering: Supports filtering the main app list via setSearchFilter.

  • State Management: Manages the selection state of apps through its internal CheckStateManager and interfaces with the underlying appPickerStateView.

  • Customization:

    • Main view title can be customized using setMainViewTitle.

    • Selected view title can be set using setSelectedViewTitle.

    • Layout orientation can be forced using the app:layoutType XML attribute or programmatically via selectLayoutType.

Custom XML Attributes:

  • app:layoutType (enum): Defines the layout orientation behavior for the selected app list. Can be auto, port, or land. Defaults to auto. See SelectLayoutType for more details.

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, defStyleRes: Int = 0)

Types

Link copied to clipboard

Manages the state of checked (selected) apps.

Link copied to clipboard

Enum representing the different layout configurations for the SeslAppPickerSelectLayout.

Link copied to clipboard

Defines the layout orientation behavior of the selected app list.

Properties

Link copied to clipboard

The primary SeslAppPickerView instance used by this layout.

Link copied to clipboard
open override val logTag: String

Functions

Link copied to clipboard
fun addCheckedItem(appInfoData: AppInfoData)

Adds an item to the checked list.

fun addCheckedItem(groupAppData: GroupAppData)

Adds items from a GroupAppData to the checked items list.

Link copied to clipboard
fun addSelectedItem(appInfo: AppInfo)

Adds an app to the selected items list.

Link copied to clipboard
fun addSelectItem(categoryAppData: CategoryAppData)

Adds a category app data item to the selected list.

Link copied to clipboard

Clears the list of checked items.

Link copied to clipboard
Link copied to clipboard

Converts an AppInfoData object representing a checkbox item to an AppInfoData object suitable for a "remove" action.

Link copied to clipboard

Enables or disables showing the secondary app picker view for selected items.

Link copied to clipboard
fun getAppData(appInfo: AppInfo): AppData?

Retrieves the AppData associated with the given AppInfo.

Link copied to clipboard

Retrieves the list of AppData currently managed by the the appPickerStateView's ViewDataController.

Link copied to clipboard

Retrieves an AppInfoData object from a list based on its AppInfo.

Link copied to clipboard

Finds a CategoryAppData in a list that contains a specific AppInfo.

Link copied to clipboard

Extracts a list of CategoryAppData from a given list of AppData.

Link copied to clipboard
open override fun getState(appInfo: AppInfo): Boolean

Retrieves the current selection state of the specified application.

Link copied to clipboard

Refreshes the selected appPickerStateView.

Link copied to clipboard

Removes an item from the selected list.

Link copied to clipboard
fun removeSelectItem(appInfoData: AppInfoData?)

Removes an item from the selected list.

Link copied to clipboard
fun setHeader(view: View?)

Sets a custom header view for the selected app picker.

Link copied to clipboard

Sets the title of the main app list view.

Link copied to clipboard

Sets the listener to be called when an action button in an item is clicked.

Link copied to clipboard

Sets the listener to be called when an item in the list is clicked.

Link copied to clipboard

Sets the listener to be notified when the state of an app or all apps changes.

Link copied to clipboard
fun setSearchFilter(filter: String, onSearchFilterListener: SeslAppPickerView.OnSearchFilterListener? = null)

Sets a search filter for the app list.

Link copied to clipboard

Sets the title text for the selected view.

Link copied to clipboard
open override fun setState(appInfo: AppInfo, isSelected: Boolean)

Sets the selection state of a specific application.

Link copied to clipboard
open override fun setStateAll(isAllSelected: Boolean)

Sets the selection state of all applications in the app picker.

Link copied to clipboard
fun smoothScrollToAppInfo(appInfo: AppInfo, induceAnimation: Boolean = false)

Smoothly scrolls the selected app list to the specified app.

Link copied to clipboard
fun submitList(list: List<AppData>? = null)

Submits a new list of AppData to be displayed.

Link copied to clipboard

Updates the checked app list based on the provided list of AppData.

Link copied to clipboard
fun updateItem(appInfoData: AppInfoData)

Updates an item in the app list with new data.