-
public interface QueryChannelsControllerThe QueryChannelsController is a small helper to show a list of channels
.channels a livedata object with the list of channels. this list
.loading if we're currently loading
.loadingMore if we're currently loading more channels
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classQueryChannelsController.ChannelsState
-
Method Summary
Modifier and Type Method Description abstract FilterObjectgetFilter()The filter used for this query abstract QuerySort<Channel>getSort()The sort used for this query abstract Function2<Channel, FilterObject, Boolean>getNewChannelEventFilter()When the NotificationAddedToChannelEvent is triggered the newChannelEventFilter determines if the channel should be added to the query or not. abstract BooleangetRecoveryNeeded()If the API call failed and we need to rerun this query abstract LiveData<Boolean>getEndOfChannels()If we've reached the end of the channels abstract LiveData<List<Channel>>getChannels()The list of channels Typically we recommend using channelsState instead, it's a bit more complex but ensures that you're handling all edge cases abstract LiveData<QueryChannelsController.ChannelsState>getChannelsState()Similar to the channels field, but returns the a ChannelsState object This sealed class makes it easier to verify that you've implemented all possible error/no result states abstract LiveData<Boolean>getLoading()If we are currently loading channels abstract LiveData<Boolean>getLoadingMore()If we are currently loading more channels abstract UnitsetNewChannelEventFilter(Function2<Channel, FilterObject, Boolean> newChannelEventFilter)When the NotificationAddedToChannelEvent is triggered the newChannelEventFilter determines if the channel should be added to the query or not. -
-
Method Detail
-
getFilter
abstract FilterObject getFilter()
The filter used for this query
-
getSort
abstract QuerySort<Channel> getSort()
The sort used for this query
-
getNewChannelEventFilter
abstract Function2<Channel, FilterObject, Boolean> getNewChannelEventFilter()
When the NotificationAddedToChannelEvent is triggered the newChannelEventFilter determines if the channel should be added to the query or not. Return true to add the channel, return false to ignore it. By default it will simply add every channel for which this event is received
-
getRecoveryNeeded
abstract Boolean getRecoveryNeeded()
If the API call failed and we need to rerun this query
-
getEndOfChannels
abstract LiveData<Boolean> getEndOfChannels()
If we've reached the end of the channels
-
getChannels
abstract LiveData<List<Channel>> getChannels()
The list of channels Typically we recommend using channelsState instead, it's a bit more complex but ensures that you're handling all edge cases
-
getChannelsState
abstract LiveData<QueryChannelsController.ChannelsState> getChannelsState()
Similar to the channels field, but returns the a ChannelsState object This sealed class makes it easier to verify that you've implemented all possible error/no result states
-
getLoading
abstract LiveData<Boolean> getLoading()
If we are currently loading channels
-
getLoadingMore
abstract LiveData<Boolean> getLoadingMore()
If we are currently loading more channels
-
setNewChannelEventFilter
abstract Unit setNewChannelEventFilter(Function2<Channel, FilterObject, Boolean> newChannelEventFilter)
When the NotificationAddedToChannelEvent is triggered the newChannelEventFilter determines if the channel should be added to the query or not. Return true to add the channel, return false to ignore it. By default it will simply add every channel for which this event is received
-
-
-
-