Package 

Interface QueryChannelsController


  • 
    public interface QueryChannelsController
    
                        

    The 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

    • Method Summary

      Modifier and Type Method Description
      abstract FilterObject getFilter() 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 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.
      abstract Boolean getCheckFilterOnChannelUpdatedEvent() When ChannelUpdatedEvent is triggered, if it is true a new query to the server is done to check if the update on the channel match the filter to be added or deleted from the list of channels
      abstract Unit setCheckFilterOnChannelUpdatedEvent(Boolean checkFilterOnChannelUpdatedEvent) When ChannelUpdatedEvent is triggered, if it is true a new query to the server is done to check if the update on the channel match the filter to be added or deleted from the list of channels
      abstract Boolean getRecoveryNeeded() 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 LiveData<List<String>> getMutedChannelIds()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • 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

      • getCheckFilterOnChannelUpdatedEvent

         abstract Boolean getCheckFilterOnChannelUpdatedEvent()

        When ChannelUpdatedEvent is triggered, if it is true a new query to the server is done to check if the update on the channel match the filter to be added or deleted from the list of channels

      • setCheckFilterOnChannelUpdatedEvent

         abstract Unit setCheckFilterOnChannelUpdatedEvent(Boolean checkFilterOnChannelUpdatedEvent)

        When ChannelUpdatedEvent is triggered, if it is true a new query to the server is done to check if the update on the channel match the filter to be added or deleted from the list of 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