ChannelListViewModelFactory

constructor(filter: FilterObject? = null, sort: QuerySorter<Channel> = ChannelListViewModel.DEFAULT_SORT, limit: Int = ChannelListViewModel.DEFAULT_CHANNEL_LIMIT, messageLimit: Int? = null, memberLimit: Int? = null, isDraftMessagesEnabled: Boolean = ChatUI.draftMessagesEnabled, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory())

Builds a factory for a ChannelListViewModel that queries channels by an explicit filter and sort.

Parameters

filter

How to filter the channels. When null, a default filter scoped to messaging channels the current user is a member of is used.

sort

How to sort the channels, defaults to last_updated.


constructor(predefinedFilterName: String, filterValues: Map<String, Any>? = null, sortValues: Map<String, Any>? = null, limit: Int = ChannelListViewModel.DEFAULT_CHANNEL_LIMIT, messageLimit: Int? = null, memberLimit: Int? = null, isDraftMessagesEnabled: Boolean = ChatUI.draftMessagesEnabled, chatEventHandlerFactory: ChatEventHandlerFactory = ChatEventHandlerFactory())

Builds a factory for a ChannelListViewModel that queries channels using a predefined filter resolved by the server.

Parameters

predefinedFilterName

The name of the predefined filter registered on the backend.

filterValues

Optional values interpolated into the predefined filter template.

sortValues

Optional values interpolated into the predefined sort template.