Package 

Class ChannelListKt

    • Method Summary

      Modifier and Type Method Description
      final static Unit ChannelList(Modifier modifier, PaddingValues contentPadding, ChannelListViewModel viewModel, LazyListState lazyListState, Function0<Unit> onLastItemReached, Function1<Channel, Unit> onChannelClick, Function1<Channel, Unit> onChannelLongClick, Function1<Message, Unit> onSearchResultClick, Function0<Unit> loadingContent, Function0<Unit> emptyContent, Function1<String, Unit> emptySearchContent, Function1<BoxScope, Unit> helperContent, Function1<LazyItemScope, Unit> loadingMoreContent, Function2<LazyItemScope, ItemState.ChannelItemState, Unit> channelContent, Function2<LazyItemScope, ItemState.SearchResultItemState, Unit> searchResultContent, Function1<LazyItemScope, Unit> divider) Default ChannelList component, that relies on the ChannelListViewModel to load the data and show it on the UI.
      final static Unit ChannelList(ChannelsState channelsState, User currentUser, Modifier modifier, PaddingValues contentPadding, LazyListState lazyListState, Function0<Unit> onLastItemReached, Function1<Channel, Unit> onChannelClick, Function1<Channel, Unit> onChannelLongClick, Function1<Message, Unit> onSearchResultClick, Function0<Unit> loadingContent, Function0<Unit> emptyContent, Function1<String, Unit> emptySearchContent, Function1<BoxScope, Unit> helperContent, Function1<LazyItemScope, Unit> loadingMoreContent, Function2<LazyItemScope, ItemState.ChannelItemState, Unit> channelContent, Function2<LazyItemScope, ItemState.SearchResultItemState, Unit> searchResultContent, Function1<LazyItemScope, Unit> divider) Root Channel list component, that represents different UI, based on the current channel state.
      final static Unit DefaultChannelItemDivider() Represents the default item divider in channel items.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ChannelList

        @Composable() final static Unit ChannelList(Modifier modifier, PaddingValues contentPadding, ChannelListViewModel viewModel, LazyListState lazyListState, Function0<Unit> onLastItemReached, Function1<Channel, Unit> onChannelClick, Function1<Channel, Unit> onChannelLongClick, Function1<Message, Unit> onSearchResultClick, Function0<Unit> loadingContent, Function0<Unit> emptyContent, Function1<String, Unit> emptySearchContent, Function1<BoxScope, Unit> helperContent, Function1<LazyItemScope, Unit> loadingMoreContent, Function2<LazyItemScope, ItemState.ChannelItemState, Unit> channelContent, Function2<LazyItemScope, ItemState.SearchResultItemState, Unit> searchResultContent, Function1<LazyItemScope, Unit> divider)

        Default ChannelList component, that relies on the ChannelListViewModel to load the data and show it on the UI.

        Parameters:
        modifier - Modifier for styling.
        contentPadding - Padding values to be applied to the channel list surrounding the content inside.
        viewModel - The ViewModel that loads all the data and connects it to the UI.
        lazyListState - State of the lazy list that represents the list of channels.
        onLastItemReached - Handler for pagination, when the user reaches the last item in the list.
        onChannelClick - Handler for a single item tap.
        onChannelLongClick - Handler for a long item tap.
        onSearchResultClick - Handler for a single search result tap.
        loadingContent - Composable that represents the loading content, when we're loading the initial data.
        emptyContent - Composable that represents the empty content if there are no channels.
        emptySearchContent - Composable that represents the empty content if there are no channels matching the search query.
        helperContent - Composable that represents the helper content.
        loadingMoreContent - : Composable that represents the loading more content, when we're loading the next page.
        channelContent - Composable that allows the user to completely customize the item UI.
        divider - Composable that allows the user to define an item divider.
      • ChannelList

        @Composable() final static Unit ChannelList(ChannelsState channelsState, User currentUser, Modifier modifier, PaddingValues contentPadding, LazyListState lazyListState, Function0<Unit> onLastItemReached, Function1<Channel, Unit> onChannelClick, Function1<Channel, Unit> onChannelLongClick, Function1<Message, Unit> onSearchResultClick, Function0<Unit> loadingContent, Function0<Unit> emptyContent, Function1<String, Unit> emptySearchContent, Function1<BoxScope, Unit> helperContent, Function1<LazyItemScope, Unit> loadingMoreContent, Function2<LazyItemScope, ItemState.ChannelItemState, Unit> channelContent, Function2<LazyItemScope, ItemState.SearchResultItemState, Unit> searchResultContent, Function1<LazyItemScope, Unit> divider)

        Root Channel list component, that represents different UI, based on the current channel state.

        This is decoupled from ViewModels, so the user can provide manual and custom data handling, as well as define a completely custom UI component for the channel item.

        If there is no state, no query active or the data is being loaded, we show the LoadingIndicator.

        If there are no results or we're offline, usually due to an error in the API or network, we show an EmptyContent.

        If there is data available and it is not empty, we show Channels.

        Parameters:
        channelsState - Current state of the Channel list, represented by ChannelsState.
        currentUser - The data of the current user, used various states.
        modifier - Modifier for styling.
        contentPadding - Padding values to be applied to the list surrounding the content inside.
        lazyListState - State of the lazy list that represents the list of channels.
        onLastItemReached - Handler for pagination, when the user reaches the end of the list.
        onChannelClick - Handler for a single item tap.
        onChannelLongClick - Handler for a long item tap.
        onSearchResultClick - Handler for a single search result tap.
        loadingContent - Composable that represents the loading content, when we're loading the initial data.
        emptyContent - Composable that represents the empty content if there are no channels.
        emptySearchContent - Composable that represents the empty content if there are no channels matching the search query.
        helperContent - Composable that represents the helper content.
        loadingMoreContent - : Composable that represents the loading more content, when we're loading the next page.
        channelContent - Composable that allows the user to completely customize the item UI.
        searchResultContent - Composable that allows the user to completely customize the search result item UI.
        divider - Composable that allows the user to define an item divider.