注册

环信官方Demo源码分析及SDK简单应用-主界面的三个fragment-设置界面

环信官方Demo源码分析及SDK简单应用

环信官方Demo源码分析及SDK简单应用-ChatDemoUI3.0

环信官方Demo源码分析及SDK简单应用-LoginActivity

环信官方Demo源码分析及SDK简单应用-主界面的三个fragment-会话界面

环信官方Demo源码分析及SDK简单应用-主界面的三个fragment-通讯录界面
 
环信官方Demo源码分析及SDK简单应用-主界面的三个fragment-设置界面
 
环信官方Demo源码分析及SDK简单应用-EaseUI
 
环信官方Demo源码分析及SDK简单应用-IM集成开发详案及具体代码实现
 
设置界面

我们来贴代码

跟我们平常写的什么我的界面是大同小异的。主要有这些,其大多设置与demoModel有关

零钱
RedPacketUtil.startChangeActivity(getActivity());
接受新消息通知
settingsModel.setSettingMsgNotification(false);
 
PreferenceManager.getInstance().setSettingMsgNotification(paramBoolean);
valueCache.put(Key.VibrateAndPlayToneOn, paramBoolean);
声音​
settingsModel.setSettingMsgSound(false);
震动​
settingsModel.setSettingMsgVibrate(false);
消息推送设置

使用扬声器播放语音
settingsModel.setSettingMsgSpeaker(false);
自定义AppKey​
settingsModel.enableCustomAppkey(false);
自定义server​
settingsModel.enableCustomServer(false);	settingsModel.enableCustomServer(false);
个人资料​
startActivity(new Intent(getActivity(), UserProfileActivity.class).putExtra("setting", true)
.putExtra("username", EMClient.getInstance().getCurrentUser()));
通讯录黑名单​
startActivity(new Intent(getActivity(), BlacklistActivity.class));
诊断​
startActivity(new Intent(getActivity(), DiagnoseActivity.class));
IOS离线推送昵称​
startActivity(new Intent(getActivity(), OfflinePushNickActivity.class));
通话设置​
startActivity(new Intent(getActivity(), CallOptionActivity.class));
允许聊天室群主离开​
settingsModel.allowChatroomOwnerLeave(false);
chatOptions.allowChatroomOwnerLeave(false);
退出群组时删除聊天数据​
settingsModel.setDeleteMessagesAsExitGroup(false);
chatOptions.setDeleteMessagesAsExitGroup(false);
自动同意群组加群邀请
settingsModel.setAutoAcceptGroupInvitation(false);
chatOptions.setAutoAcceptGroupInvitation(false);
视频自适应编码​
settingsModel.setAdaptiveVideoEncode(false);
EMClient.getInstance().callManager().getCallOptions().enableFixedVideoResolution(true);
退出登录​
DemoHelper.getInstance().logout(false,new EMCallBack() {

@Override
public void onSuccess() {
getActivity().runOnUiThread(new Runnable() {
public void run() {
pd.dismiss();
// show login screen
((MainActivity) getActivity()).finish();
startActivity(new Intent(getActivity(), LoginActivity.class));

}
});
}

@Override
public void onProgress(int progress, String status) {

}

@Override
public void onError(int code, String message) {
getActivity().runOnUiThread(new Runnable() {

@Override
public void run() {
// TODO Auto-generated method stub
pd.dismiss();
Toast.makeText(getActivity(), "unbind devicetokens failed", Toast.LENGTH_SHORT).show();
}
});
}
});
到这里主界面的三个fragment就都讲完了,我们来看重头戏。
 
环信官方Demo源码分析及SDK简单应用-EaseUI

0 个评论

要回复文章请先登录注册