Commit c87dabe8 by 徐健

修复多出空指针异常

parent 606a5550
...@@ -35,16 +35,16 @@ object CourseSendPlugin { ...@@ -35,16 +35,16 @@ object CourseSendPlugin {
fun sendMsg(isPlaying: Boolean) { fun sendMsg(isPlaying: Boolean) {
eventSink!!.success(isPlaying) eventSink?.success(isPlaying)
} }
fun sendRequestData() { fun sendRequestData() {
eventSink!!.success("requestData") eventSink?.success("requestData")
} }
fun sendLoginSuccess() { fun sendLoginSuccess() {
eventSink!!.success("loginSuccess") eventSink?.success("loginSuccess")
} }
} }
\ No newline at end of file
package com.yidianling.uikit.business.session.activity; package com.yidianling.uikit.business.session.activity;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
...@@ -115,6 +116,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -115,6 +116,7 @@ public abstract class YDLBaseMessageActivity extends UI {
//==================== ChatUI Override ==================== //==================== ChatUI Override ====================
@SuppressLint("CheckResult")
public void setToolBar(int toolBarId) { public void setToolBar(int toolBarId) {
tb = (TitleBarBottom) findViewById(toolBarId); tb = (TitleBarBottom) findViewById(toolBarId);
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
...@@ -144,6 +146,8 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -144,6 +146,8 @@ public abstract class YDLBaseMessageActivity extends UI {
Disposable dis = ServiceImpl.Companion.getInstance().getDoctorChatStatus(Long.parseLong(ActionHandlerStorage.getL(sessionId).getInfo().toUid)) Disposable dis = ServiceImpl.Companion.getInstance().getDoctorChatStatus(Long.parseLong(ActionHandlerStorage.getL(sessionId).getInfo().toUid))
.subscribe(chatStatusBean -> { .subscribe(chatStatusBean -> {
if (ActionHandlerStorage.getL(sessionId) != null) {
int status = chatStatusBean.data.getStatus(); int status = chatStatusBean.data.getStatus();
ActionHandlerStorage.getL(sessionId).setDoctorStatus(status); ActionHandlerStorage.getL(sessionId).setDoctorStatus(status);
ActionHandlerStorage.getL(sessionId).setDoctorBusyNum(chatStatusBean.data.getBusyTotal()); ActionHandlerStorage.getL(sessionId).setDoctorBusyNum(chatStatusBean.data.getBusyTotal());
...@@ -168,6 +172,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -168,6 +172,7 @@ public abstract class YDLBaseMessageActivity extends UI {
} }
initSystemMessage(chatStatusBean.data.getPromptRule(), status); initSystemMessage(chatStatusBean.data.getPromptRule(), status);
}
}, throwable -> { }, throwable -> {
}); });
...@@ -178,6 +183,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -178,6 +183,7 @@ public abstract class YDLBaseMessageActivity extends UI {
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> { .subscribe(res -> {
if (ActionHandlerStorage.getL(sessionId) != null) {
if (res.data == 1) { if (res.data == 1) {
//在线 //在线
tb.setMinTitleText("在线"); tb.setMinTitleText("在线");
...@@ -189,6 +195,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -189,6 +195,7 @@ public abstract class YDLBaseMessageActivity extends UI {
tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666)); tb.setMinTitleColor(getResources().getColor(R.color.platform_color_666666));
tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line)); tb.setMinTitleDrawable(getResources().getDrawable(R.drawable.im_background_chat_top_status_off_line));
} }
}
}, throwable -> { }, throwable -> {
}); });
} else { } else {
...@@ -221,6 +228,7 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -221,6 +228,7 @@ public abstract class YDLBaseMessageActivity extends UI {
/** /**
* 发送推荐专家列表 * 发送推荐专家列表
*/ */
@SuppressLint("CheckResult")
public void sendRecommendExpertListMessage(int type, boolean showExpertList) { public void sendRecommendExpertListMessage(int type, boolean showExpertList) {
// 调取接口获取推荐专家列表 // 调取接口获取推荐专家列表
...@@ -232,7 +240,9 @@ public abstract class YDLBaseMessageActivity extends UI { ...@@ -232,7 +240,9 @@ public abstract class YDLBaseMessageActivity extends UI {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> { .subscribe(res -> {
//发送推荐专家列表消息 //发送推荐专家列表消息
if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).sendRecommendExpertListMessage(sessionId, res.data, type, showExpertList); ActionHandlerStorage.getL(sessionId).sendRecommendExpertListMessage(sessionId, res.data, type, showExpertList);
}
}, throwable -> { }, throwable -> {
ToastUtil.toastShort(throwable.toString()); ToastUtil.toastShort(throwable.toString());
}); });
......
...@@ -214,6 +214,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -214,6 +214,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
* 初始化顶部专家信息栏 * 初始化顶部专家信息栏
*/ */
private void initTopCustomBar() { private void initTopCustomBar() {
if (ActionHandlerStorage.getL(sessionId) != null) {
// 头像 // 头像
String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage; String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage;
if (!TextUtils.isEmpty(headUrl)) { if (!TextUtils.isEmpty(headUrl)) {
...@@ -242,6 +243,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -242,6 +243,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
} }
} }
}
private void showTips() { private void showTips() {
mHandler.sendEmptyMessageDelayed(1, 1000); mHandler.sendEmptyMessageDelayed(1, 1000);
...@@ -347,23 +349,29 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -347,23 +349,29 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题");
if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).startHelp(getActivity()); ActionHandlerStorage.getL(sessionId).startHelp(getActivity());
} }
}
}); });
rootView.findViewById(R.id.action_feedback).setOnClickListener(new View.OnClickListener() { rootView.findViewById(R.id.action_feedback).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈");
if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).startFeedback(getActivity()); ActionHandlerStorage.getL(sessionId).startFeedback(getActivity());
} }
}
}); });
; ;
rootView.findViewById(R.id.action_call).setOnClickListener(new View.OnClickListener() { rootView.findViewById(R.id.action_call).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线");
if (ActionHandlerStorage.getL(sessionId) != null) {
ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity()); ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity());
} }
}
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment