public class ConversationListFragment extends Fragment implements BaseAdapter.OnItemClickListener
Modifier and Type | Field and Description |
---|---|
protected ConversationListAdapter |
mAdapter |
protected ConversationListViewModel |
mConversationListViewModel |
protected android.os.Handler |
mHandler |
protected RecyclerView |
mList |
protected android.view.View |
mNoticeContainerView |
protected android.widget.TextView |
mNoticeContentTv |
protected android.widget.ImageView |
mNoticeIconIv |
protected SmartRefreshLayout |
mRefreshLayout |
protected long |
NOTICE_SHOW_DELAY_MILLIS |
Constructor and Description |
---|
ConversationListFragment() |
Modifier and Type | Method and Description |
---|---|
void |
addFooterView(android.view.View view) |
void |
addHeaderView(android.view.View view) |
protected void |
initRefreshView()
初始化刷新模块
|
protected void |
onConversationListLoadMore() |
protected void |
onConversationListRefresh(RefreshLayout refreshLayout) |
void |
onCreate(android.os.Bundle savedInstanceState) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onItemClick(android.view.View view,
ViewHolder holder,
int position)
会话列表点击事件回调
|
boolean |
onItemLongClick(android.view.View view,
ViewHolder holder,
int position)
会话列表长按事件回调
|
protected ConversationListAdapter |
onResolveAdapter()
获取 adapter.
|
void |
onResume() |
void |
onViewCreated(android.view.View view,
android.os.Bundle savedInstanceState) |
void |
setEmptyView(int emptyId) |
void |
setEmptyView(android.view.View view) |
protected void |
subscribeUi()
观察 view model 各数据以便进行页面刷新操作。
|
protected void |
updateNoticeContent(NoticeContent content)
更新连接状态通知栏
|
protected final long NOTICE_SHOW_DELAY_MILLIS
protected ConversationListAdapter mAdapter
protected RecyclerView mList
protected android.view.View mNoticeContainerView
protected android.widget.TextView mNoticeContentTv
protected android.widget.ImageView mNoticeIconIv
protected ConversationListViewModel mConversationListViewModel
protected SmartRefreshLayout mRefreshLayout
protected android.os.Handler mHandler
public void onCreate(android.os.Bundle savedInstanceState)
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)
public void onViewCreated(android.view.View view, android.os.Bundle savedInstanceState)
public void onResume()
protected void initRefreshView()
protected void subscribeUi()
protected void onConversationListRefresh(RefreshLayout refreshLayout)
protected void onConversationListLoadMore()
protected void updateNoticeContent(NoticeContent content)
content
- protected ConversationListAdapter onResolveAdapter()
public void onItemClick(android.view.View view, ViewHolder holder, int position)
onItemClick
in interface BaseAdapter.OnItemClickListener
view
- 点击 viewholder
- ViewHolder
position
- 点击位置public boolean onItemLongClick(android.view.View view, ViewHolder holder, int position)
onItemLongClick
in interface BaseAdapter.OnItemClickListener
view
- 点击 viewholder
- ViewHolder
position
- 点击位置public void addHeaderView(android.view.View view)
view
- 自定义列表 header viewpublic void addFooterView(android.view.View view)
view
- 自定义列表 footer viewpublic void setEmptyView(android.view.View view)
view
- 自定义列表 空数据 viewpublic void setEmptyView(int emptyId)
emptyId
- 自定义列表 空数据的 LayoutId