Commit b4a89612 by 霍志良

fix:修复redPoint接口,body

parent 482512f5
...@@ -97,12 +97,11 @@ import com.yidianling.im.session.viewholder.MsgViewHolderSticker; ...@@ -97,12 +97,11 @@ import com.yidianling.im.session.viewholder.MsgViewHolderSticker;
import com.yidianling.im.session.viewholder.MsgViewHolderSubscriptTime; import com.yidianling.im.session.viewholder.MsgViewHolderSubscriptTime;
import com.yidianling.im.session.viewholder.MsgViewHolderSystemTips; import com.yidianling.im.session.viewholder.MsgViewHolderSystemTips;
import com.yidianling.im.session.viewholder.MsgViewHolderTip; import com.yidianling.im.session.viewholder.MsgViewHolderTip;
import com.yidianling.im.ui.param.BuryRedPointsParm; import com.yidianling.im.ui.param.BuryRedPointParam;
import com.yidianling.nimbase.api.model.session.SessionCustomization; import com.yidianling.nimbase.api.model.session.SessionCustomization;
import com.yidianling.nimbase.api.model.session.SessionEventListener; import com.yidianling.nimbase.api.model.session.SessionEventListener;
import com.yidianling.nimbase.business.session.actions.BaseAction; import com.yidianling.nimbase.business.session.actions.BaseAction;
import com.yidianling.nimbase.impl.cache.TeamDataCache; import com.yidianling.nimbase.impl.cache.TeamDataCache;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.uikit.api.NimUIKit; import com.yidianling.uikit.api.NimUIKit;
import com.yidianling.uikit.business.session.actions.ImageAction; import com.yidianling.uikit.business.session.actions.ImageAction;
import com.yidianling.uikit.business.session.actions.VideoAction; import com.yidianling.uikit.business.session.actions.VideoAction;
...@@ -111,7 +110,7 @@ import com.yidianling.uikit.business.team.model.TeamExtras; ...@@ -111,7 +110,7 @@ import com.yidianling.uikit.business.team.model.TeamExtras;
import com.yidianling.uikit.business.team.model.TeamRequestCode; import com.yidianling.uikit.business.team.model.TeamRequestCode;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage; import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler; import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.user.api.bean.UserResponseBean;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -212,7 +211,7 @@ public class SessionHelper { ...@@ -212,7 +211,7 @@ public class SessionHelper {
* 通知服务端红点 * 通知服务端红点
* */ * */
private static void notifyRedPoint( String assistantUid, String userId) { private static void notifyRedPoint( String assistantUid, String userId) {
String str = new Gson().toJson(new BuryRedPointsParm(assistantUid, userId)); String str = new Gson().toJson(new BuryRedPointParam(assistantUid, userId));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str); RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str);
Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().imBuryRedPoints(body) Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().imBuryRedPoints(body)
.compose(RxUtils.INSTANCE.resultJavaData()) .compose(RxUtils.INSTANCE.resultJavaData())
......
package com.yidianling.im.ui.param;
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/9/10
*/
public class BuryRedPointParam {
public String assistantUid;
public String userUid;
public BuryRedPointParam(String assistantUid, String userId) {
this.assistantUid = assistantUid;
this.userUid = userId;
}
}
package com.yidianling.im.ui.param
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/9/8
*/
class BuryRedPointsParm (assistantUid :String,userId:String)
\ No newline at end of file
...@@ -255,21 +255,21 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -255,21 +255,21 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
fl_question_content = rootView.findViewById(R.id.fl_question_content); fl_question_content = rootView.findViewById(R.id.fl_question_content);
rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE); rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if(ActionHandlerStorage.getL(sessionId).getUserType()!=2) { if (ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) { if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE); rela_zixun.setVisibility(View.GONE);
} }
} }
if(ActionHandlerStorage.getL(sessionId).isNotPrepare()) { if (ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(),sessionId, (expertInfo) -> { IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
String toUid = expertInfo.shareData.toUid; String toUid = expertInfo.shareData.toUid;
IP2PCustomActionHandler handler = ActionHandlerStorage.getL(sessionId); IP2PCustomActionHandler handler = ActionHandlerStorage.getL(sessionId);
handler.setExpertInfo(toUid,expertInfo); handler.setExpertInfo(toUid, expertInfo);
handler.setUserType(expertInfo.shareData.user_type); handler.setUserType(expertInfo.shareData.user_type);
initView(); initView();
}); });
}else { } else {
initView(); initView();
} }
} }
...@@ -357,7 +357,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -357,7 +357,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
initTopViewHeight(); //设置顶部专家信息栏高度 initTopViewHeight(); //设置顶部专家信息栏高度
addScrollListener(); addScrollListener();
TitleBarBottom titleBar = ((YDLBaseMessageActivity) getActivity()).getTitleBarBottom(); TitleBarBottom titleBar = ((YDLBaseMessageActivity) getActivity()).getTitleBarBottom();
IMChatUtil.INSTANCE.initChatOnlineState(titleBar,getContext(),sessionId,this); IMChatUtil.INSTANCE.initChatOnlineState(titleBar, getContext(), sessionId, this);
} }
if (ActionHandlerStorage.getL(sessionId) != null) { if (ActionHandlerStorage.getL(sessionId) != null) {
...@@ -480,19 +480,23 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -480,19 +480,23 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
try { try {
String year = bean.getContent(); String year = bean.getContent();
userInfoDialogAge = Calendar.getInstance().get(Calendar.YEAR) - Integer.valueOf(year); userInfoDialogAge = Calendar.getInstance().get(Calendar.YEAR) - Integer.valueOf(year);
} catch (Exception e) { } } catch (Exception e) {
}
} else if (TextUtils.equals(bean.getUserInfoType(), "gener")) { } else if (TextUtils.equals(bean.getUserInfoType(), "gener")) {
try { try {
userInfoDialogSex = bean.getContent(); userInfoDialogSex = bean.getContent();
} catch (Exception e) { } } catch (Exception e) {
}else if (TextUtils.equals(bean.getUserInfoType(), "questionType")) { }
} else if (TextUtils.equals(bean.getUserInfoType(), "questionType")) {
try { try {
userInfoDialogConsultType = bean.getContent(); userInfoDialogConsultType = bean.getContent();
} catch (Exception e) { } } catch (Exception e) {
}else if (TextUtils.equals(bean.getUserInfoType(), "questionContent")) { }
} else if (TextUtils.equals(bean.getUserInfoType(), "questionContent")) {
try { try {
userInfoDialogQuestionDes = bean.getContent(); userInfoDialogQuestionDes = bean.getContent();
} catch (Exception e) { } } catch (Exception e) {
}
} }
} }
getSourceFrom(); getSourceFrom();
...@@ -582,11 +586,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -582,11 +586,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rl_contain.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { rl_contain.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
if(initHeightFinish) { if (initHeightFinish) {
rvPaddingTop+=rl_contain.getHeight(); rvPaddingTop += rl_contain.getHeight();
messageListView.setPadding(0,rvPaddingTop,0,0); messageListView.setPadding(0, rvPaddingTop, 0, 0);
}else { } else {
rvPaddingTop+=rl_contain.getHeight(); rvPaddingTop += rl_contain.getHeight();
} }
initHeightFinish = true; initHeightFinish = true;
rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this); rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this);
...@@ -596,19 +600,19 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -596,19 +600,19 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
expertInfoViewHeight = top_expert_info_ll.getHeight(); expertInfoViewHeight = top_expert_info_ll.getHeight();
if(messageListPanel.linearLayoutManager.findLastVisibleItemPosition()==0) { if (messageListPanel.linearLayoutManager.findLastVisibleItemPosition() == 0) {
initHeightFinish = true; initHeightFinish = true;
//如果页面未充满时,设置padding会出现覆盖问题,必须设置margin才可以 //如果页面未充满时,设置padding会出现覆盖问题,必须设置margin才可以
messageListView.setPadding(0,rvPaddingTop,0,0); messageListView.setPadding(0, rvPaddingTop, 0, 0);
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) messageListView.getLayoutParams(); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) messageListView.getLayoutParams();
layoutParams.topMargin = expertInfoViewHeight; layoutParams.topMargin = expertInfoViewHeight;
messageListView.setLayoutParams(layoutParams); messageListView.setLayoutParams(layoutParams);
} else { } else {
if(initHeightFinish) { if (initHeightFinish) {
rvPaddingTop+=expertInfoViewHeight; rvPaddingTop += expertInfoViewHeight;
messageListView.setPadding(0,rvPaddingTop,0,0); messageListView.setPadding(0, rvPaddingTop, 0, 0);
}else { } else {
rvPaddingTop+=expertInfoViewHeight; rvPaddingTop += expertInfoViewHeight;
} }
} }
initHeightFinish = true; initHeightFinish = true;
...@@ -622,7 +626,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -622,7 +626,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
int rvPaddingTop = ll_actions_yi.getHeight(); int rvPaddingTop = ll_actions_yi.getHeight();
messageListView.setPadding(0,rvPaddingTop,0,0); messageListView.setPadding(0, rvPaddingTop, 0, 0);
rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this); rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this);
} }
}); });
......
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