Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
7f27cb30
Commit
7f27cb30
authored
Apr 07, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:屏蔽艾特相关功能、视频通话相关功能。增加删除历史聊天记录功能(接口未给)
parent
119487eb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
7 deletions
+116
-7
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+3
-1
AitManager.java
m-im/src/main/java/com/yidianling/uikit/business/ait/AitManager.java
+2
-1
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+110
-4
YDLTeamMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLTeamMessageFragment.java
+1
-0
InputPanel.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
+0
-1
No files found.
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
7f27cb30
...
...
@@ -408,7 +408,9 @@ public class SessionHelper {
ArrayList
<
BaseAction
>
actions
=
new
ArrayList
<>();
actions
.
add
(
new
ImageAction
());
actions
.
add
(
new
VideoAction
());
actions
.
add
(
avChatAction
);
//去掉群聊的视频通话按钮
// actions.add(avChatAction);
SessionTeamCustomization
.
SessionTeamCustomListener
listener
=
new
SessionTeamCustomization
.
SessionTeamCustomListener
()
{
@Override
...
...
m-im/src/main/java/com/yidianling/uikit/business/ait/AitManager.java
View file @
7f27cb30
...
...
@@ -176,7 +176,8 @@ public class AitManager implements TextWatcher {
if
(
s
.
toString
().
equals
(
"@"
))
{
// 启动@联系人界面
if
(!
TextUtils
.
isEmpty
(
tid
)
)
{
AitContactSelectorActivity
.
start
(
context
,
tid
);
//暂时注释艾特相关群成员功能
// AitContactSelectorActivity.start(context, tid);
}
}
aitContactsModel
.
onInsertText
(
start
,
s
.
toString
());
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
7f27cb30
...
...
@@ -4,9 +4,13 @@ import android.animation.Animator;
import
android.animation.ObjectAnimator
;
import
android.animation.ValueAnimator
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.media.AudioManager
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
...
...
@@ -22,12 +26,10 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.alibaba.fastjson.JSON
;
import
com.google.gson.Gson
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.Observer
;
...
...
@@ -36,7 +38,6 @@ import com.netease.nimlib.sdk.ResponseCode;
import
com.netease.nimlib.sdk.msg.MessageBuilder
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.MsgServiceObserve
;
import
com.netease.nimlib.sdk.msg.attachment.MsgAttachment
;
import
com.netease.nimlib.sdk.msg.constant.MsgStatusEnum
;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.CustomMessageConfig
;
...
...
@@ -47,20 +48,28 @@ import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.data.PlatformDataManager
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.modular.ModularServiceManager
;
import
com.ydl.ydlcommon.ui.LoadingDialogFragment
;
import
com.ydl.ydlcommon.utils.AnimUtils
;
import
com.ydl.ydlcommon.utils.LogUtil
;
import
com.ydl.ydlcommon.utils.NetworkParamsUtils
;
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
;
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
;
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
;
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
;
import
com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
;
import
com.ydl.ydlcommon.utils.log.LogHelper
;
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
;
import
com.ydl.ydlcommon.view.CircleImageView
;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.ydl.ydlcommon.view.dialog.ListDialog
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.bean.RemoveHistory
;
import
com.yidianling.im.config.constants.ImConstants
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.helper.IMChatUtil
;
...
...
@@ -86,6 +95,7 @@ import com.yidianling.uikit.api.NimUIKitImpl;
import
com.yidianling.uikit.business.ait.AitManager
;
import
com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity
;
import
com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper
;
import
com.yidianling.uikit.business.session.helper.MessageListPanelHelper
;
import
com.yidianling.uikit.business.session.module.input.InputPanel
;
import
com.yidianling.uikit.business.session.module.list.MessageListPanelEx
;
import
com.yidianling.uikit.business.session.view.ChatPrivateTips
;
...
...
@@ -248,6 +258,67 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
TitleBarBottom
titleBar
=
((
YDLBaseMessageActivity
)
getActivity
()).
getTitleBarBottom
();
titleBar
.
setTitleLeftDraw
(
getResources
().
getDrawable
(
R
.
drawable
.
loading_01
));
titleBar
.
setTitle
(
"正在连接中..."
);
if
(
sessionType
==
SessionTypeEnum
.
Team
){
titleBar
.
setRightIcon
(
getContext
().
getDrawable
(
R
.
drawable
.
platform_common_more
));
}
titleBar
.
setOnRightTextClick
(
new
TitleBarBottom
.
OnTitleBarTextClick
()
{
@Override
public
void
onClick
(
View
view
,
boolean
isActive
)
{
List
<
String
>
list
=
new
ArrayList
<>();
// if (ImConstants.KEFUXIAOYI.equals(toChatUsername) || "4108805".equals(toChatUsername)) {
// list.add("历史聊天记录");
// list.add("客服热线");
// } else {
// list.add("投诉反馈");
//
// list.add("历史聊天记录");
// list.add("删除聊天记录");
// }
list
.
add
(
"删除聊天记录"
);
ListDialog
.
Builder
dialog
=
new
ListDialog
.
Builder
(
getContext
(),
list
,
0
);
list
.
add
(
"取消"
);
dialog
.
create
().
show
();
dialog
.
SetOnItemClickLister
(
new
ListDialog
.
Builder
.
OnItemClickLister
()
{
@Override
public
void
onItemClick
(
Dialog
dialog
,
View
view
,
int
position
)
{
LogHelper
.
Companion
.
getInstance
().
writeLogSync
(
String
.
format
(
"聊天界面:%s"
,
list
.
get
(
position
)));
switch
(
list
.
get
(
position
))
{
case
"投诉反馈"
:
ImIn
.
INSTANCE
.
feedBackIntent
((
Activity
)
getContext
());
break
;
case
"返回首页"
:
ImIn
.
INSTANCE
.
mainIntent
(
getContext
(),
0
);
break
;
case
"客服热线"
:
// showCallDialog();
break
;
case
"历史聊天记录"
:
// historyMsg();
break
;
case
"删除聊天记录"
:
deleteChatHistory
();
break
;
case
"ta的主页"
:
// showUserHome();
break
;
case
"取消"
:
break
;
}
dialog
.
dismiss
();
}
@Override
public
void
onItemLongClick
(
Dialog
dialog
,
View
view
,
int
position
)
{
}
});
}
});
fl_container
=
rootView
.
findViewById
(
R
.
id
.
message_activity_list_view_container
);
v_chattips
=
rootView
.
findViewById
(
R
.
id
.
v_chattips
);
lin_actions
=
rootView
.
findViewById
(
R
.
id
.
lin_actions
);
...
...
@@ -286,7 +357,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
rela_zixun
.
setVisibility
(
View
.
GONE
);
}
}
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)&&
ActionHandlerStorage
.
getL
(
sessionId
).
isNotPrepare
())
{
IMChatUtil
.
INSTANCE
.
prepareChatData
((
AppCompatActivity
)
getActivity
(),
sessionId
,
(
expertInfo
)
->
{
String
toUid
=
expertInfo
.
shareData
.
toUid
;
...
...
@@ -304,8 +374,44 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
else
{
initView
();
}
//群聊则隐藏立即咨询按钮
if
(
SessionTypeEnum
.
Team
==
sessionType
){
rela_zixun
.
setVisibility
(
View
.
GONE
);
titleBar
.
setTitleRightDraw
(
null
);
}
}
/**
* 删除聊天记录
*/
private
void
deleteChatHistory
()
{
CommonDialog
dialog
=
CommonDialog
.
create
(
getContext
());
dialog
.
setMessage
(
"确定删除与ta的聊天记录?"
);
dialog
.
setCancelAble
(
true
);
dialog
.
setLeftOnclick
(
"再考虑下"
,
v
->
dialog
.
dismiss
());
dialog
.
setRightClick
(
"立即删除"
,
v
->
{
LoadingDialogFragment
loadingDialog
=
LoadingDialogFragment
.
Companion
.
newInstance
(
"正在删除"
);
loadingDialog
.
show
(((
AppCompatActivity
)
getContext
()).
getSupportFragmentManager
(),
null
);
RemoveHistory
cmd
=
new
RemoveHistory
();
// cmd.toUid = getInfo().toUid;
cmd
.
type
=
1
;
Disposable
disposable
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
rmHistory
(
NetworkParamsUtils
.
getMaps
(
cmd
))
.
subscribeOn
(
Schedulers
.
io
())
.
compose
(
RxUtils
.
INSTANCE
.
resultData
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
objectBaseResponse
->
{
loadingDialog
.
hide
();
ToastUtil
.
toastShort
(
"聊天记录已删除"
);
NIMClient
.
getService
(
MsgService
.
class
).
clearChattingHistory
(
cmd
.
toUid
,
SessionTypeEnum
.
P2P
);
MessageListPanelHelper
.
getInstance
().
notifyClearMessages
(
cmd
.
toUid
);
},
throwable
->
{
loadingDialog
.
hide
();
HttpErrorUtils
.
Companion
.
handleError
(
getContext
(),
throwable
);
});
});
dialog
.
show
();
}
@SuppressLint
(
"CheckResult"
)
private
void
initView
()
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
)
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLTeamMessageFragment.java
View file @
7f27cb30
...
...
@@ -34,6 +34,7 @@ public class YDLTeamMessageFragment extends YDLMessageFragment {
return
true
;
}
@Override
public
boolean
sendMessage
(
IMMessage
message
)
{
if
(!
isAllowSendMessage
(
message
))
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
View file @
7f27cb30
...
...
@@ -57,7 +57,6 @@ import com.yidianling.nimbase.common.util.string.StringUtil;
import
com.yidianling.uikit.api.NimUIKit
;
import
com.yidianling.uikit.api.NimUIKitImpl
;
import
com.yidianling.uikit.business.ait.AitTextChangeListener
;
import
com.yidianling.uikit.custom.bridge.ActionHandlerStorage
;
import
com.yidianling.uikit.custom.widget.SafeHelpRemindDialog
;
import
java.io.File
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment