StorytellerGridState

class StorytellerGridState(val lazyGridState: LazyGridState = LazyGridState(), val enablePullToRefresh: Boolean = false) : StorytellerDataState

A state holder for Storyteller grid components (e.g., StorytellerStoriesGrid, StorytellerClipsGrid). It encapsulates a LazyGridState to manage the underlying grid's scroll position and layout information. It also provides methods to interact with the grid, such as reloading its data or scrolling to specific items, and can manage pull-to-refresh behavior. For more details on using Storyteller list components and their states, see the Storyteller Lists Documentation.

This state is typically created and remembered using rememberStorytellerGridState.

Parameters

lazyGridState

The underlying LazyGridState that this state object will manage, defaults to a new state created by rememberLazyGridState.

enablePullToRefresh

Boolean indicating whether pull-to-refresh functionality should be enabled for the grid, defaults to false. Note that pull-to-refresh is only effective if the grid is scrollable.

Constructors

Link copied to clipboard
constructor(lazyGridState: LazyGridState = LazyGridState(), enablePullToRefresh: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard

Provides information about the currently visible items and layout of the grid. This is a direct accessor to LazyGridState.layoutInfo.

Link copied to clipboard
open override val isScrolling: Boolean

true if the grid is currently being scrolled, false otherwise. Reflects the LazyGridState.isScrollInProgress property of the underlying grid state.

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun reloadData()

Reloads the data for the Storyteller grid. This function invokes the internal reload callback to refresh the grid's content. See the Storyteller Lists Documentation for more on list management.

Link copied to clipboard
open suspend override fun scrollToItem(index: Int, offset: Int)

Scrolls the grid to the item at the specified index with a given pixel offset.