设计

改造ImageMessagePreviewActivity:
1、改造addPopItem方法:onPopMenuItemClick中调用Presenter处理逻辑onPopMenuItemClick
 

 
 
2、改造loading()
 
 

二、改造SessionListFragment

1、selectContactCreateGroup迁移到 SessionListPresenter中

2、SessionListFragment存在多余的方法:

        1)getLocation,没有被调用
3、迁移isSingle方法到SessionListPresenter中
4、迁移intoGroup到SessionListPresenter中
5、修改onActivityResult:
  1)抽取switch代码块中的CONTACT_PICKER_GROUP分支到SessionListPresenter#parseSelectedContacts方法中
  2)抽取switch代码块中的REQUEST_CODE_GROUPCHAT_NAME分支到
SessionListPresenter#intoRCSGroup
6、迁移createRCSGroup和createGroup到SessionListPresenter#createRCSGroup和createGroup中
7、迁移getSessionName到SessionListPresenter#getSessionName
8、修改doSearch方法:将
mEmptyView.setVisibility(View.VISIBLE);
mEmptyTip.setVisibility(View.VISIBLE);
mSessionListView.setVisibility(View.GONE);
抽取为showWhenNoData
if (mAdapter != null) {
    mAdapter.setData(rcsSessions);
    mAdapter.notifyDataSetChanged();
}
抽取为refreshData
其他大部分逻辑迁移到
SessionListPresenter#doSearch中
9、迁移initLooper
和quitLooper到SessionListPresenter中,并新增加SessionListPresenter#doInBackground 
10、注释掉CONTACT_PICKER_BROADCAST的分支(有2处),因为没有启动过requestCode = CONTACT_PICKER_BROADCAST CONTACT_PICKER_FREESMSCONTACT_PICKER_SINGLE
Activity
原文地址:https://www.cnblogs.com/activity/p/6197313.html