Class ChannelListDataHandler
-
- All Implemented Interfaces:
-
ai.nexconn.chatui.base.interfaces.OnPagedDataLoader
public class ChannelListDataHandler extends MultiDataHandler implements OnPagedDataLoader
Core data handler for the channel list
Responsible for channel data fetching, filtering, sorting, deduplication, and UI model management. Implements OnPagedDataLoader to support load-more pagination.
Data loading has two paths:
- Since:
5.10.4
-
-
Field Summary
Fields Modifier and Type Field Description public final static MultiDataHandler.DataKey<List<BaseUiChannel>>KEY_CONVERSATION_LISTprotected final CopyOnWriteArrayList<BaseUiChannel>uiConversationListprotected volatile booleanisAlive
-
Constructor Summary
Constructors Constructor Description ChannelListDataHandler(Context applicationContext)
-
Method Summary
Modifier and Type Method Description voidrefresh()Refreshes the channel list. voidrefresh(long delayMs)Refreshes the channel list with a custom delay. voiddoUpdate(List<BaseChannel> channels)voidupdateByChannel(BaseChannel channel)Updates a single channel (from event callback) BaseUiChannelfindConversationFromList(ChannelType type, String channelId)voidrefreshConversationList()booleanisSupported(ChannelType type)voidloadNext(OnDataChangeListener<Boolean> listener)Loads the next page of data. booleanhasNext()Returns whether there is a next page. voidstop()Stops the handler. -
Methods inherited from class ai.nexconn.chatui.base.BaseHandler
isAlive -
Methods inherited from class ai.nexconn.chatui.base.MultiDataHandler
addDataChangeListener, notifyDataChange, notifyDataError, notifyDataError, replaceDataChangeListener -
Methods inherited from class ai.nexconn.chatui.base.interfaces.OnPagedDataLoader
hasPrevious, loadPrevious -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
refresh
void refresh()
Refreshes the channel list. Rapid successive calls are auto-coalesced.
-
refresh
void refresh(long delayMs)
Refreshes the channel list with a custom delay.
If delay is non-positive, falls back to the default coalescing window.
-
updateByChannel
void updateByChannel(BaseChannel channel)
Updates a single channel (from event callback)
-
findConversationFromList
BaseUiChannel findConversationFromList(ChannelType type, String channelId)
-
refreshConversationList
void refreshConversationList()
-
isSupported
boolean isSupported(ChannelType type)
-
loadNext
void loadNext(OnDataChangeListener<Boolean> listener)
Loads the next page of data.
- Parameters:
listener- the load completion listener
-
hasNext
boolean hasNext()
Returns whether there is a next page.
- Returns:
true if more data is available
-
stop
void stop()
Stops the handler.
-
-
-
-