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
4c3c4016
Commit
4c3c4016
authored
Jun 30, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-发送按钮发送通知
parent
a4036e54
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
12 deletions
+46
-12
MultipleSelectedEvent.kt
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
+2
-1
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+3
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+31
-8
InputPanel.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
+10
-1
No files found.
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
View file @
4c3c4016
...
...
@@ -6,7 +6,8 @@ import com.yidianling.im.session.viewholder.bean.AnswersItem
public
class
MultipleSelectedEvent
(
val
strSelected
:
String
?,
var
othersState
:
OthersState
?,
var
multipleAnswerBean
:
MultipleAnswerBean
?
var
multipleAnswerBean
:
MultipleAnswerBean
?,
var
isFromInputPanel
:
Boolean
)
data class
OthersState
(
var
isOthers
:
Boolean
,
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
4c3c4016
...
...
@@ -176,7 +176,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
//请求接口发送所选题目,通过发通知到YDLMessageFragment统一回答问题。
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
null
,
null
,
new
MultipleAnswerBean
(
examId
,
questionPaperId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
(),
questionId
,
answersItems
,
message
.
getFromAccount
())));
questionId
,
answersItems
,
message
.
getFromAccount
())
,
false
));
});
multiple_choice_title
.
setText
(
customAttachLingxiWhichQuestion
.
name
);
adapterLingxiMultipleChoice
=
new
AdapterLingxiMultipleChoice
();
...
...
@@ -281,7 +281,8 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
stringBuffer
.
append
(
"#"
).
append
(
selectedStr
.
get
(
i
));
}
isOthers
=
questionList
.
get
(
position
).
getName
().
contains
(
"其他"
);
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
new
OthersState
(
isOthers
,
questionList
.
get
(
position
).
isSelected
()),
null
));
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
new
OthersState
(
isOthers
,
questionList
.
get
(
position
).
isSelected
()),
new
MultipleAnswerBean
(
examId
,
questionPaperId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
(),
questionId
,
answersItems
,
message
.
getFromAccount
()),
false
));
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
4c3c4016
...
...
@@ -60,6 +60,7 @@ import com.ydl.ydlcommon.view.CircleImageView;
import
com.ydl.ydlcommon.view.dialog.CommonDialog
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.helper.IMChatUtil
;
import
com.yidianling.im.http.ImRetrofitApi
;
...
...
@@ -224,6 +225,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
UserInfoDialog
userInfoDialog
=
null
;
private
boolean
isOthers
;
private
MultipleAnswerBean
multipleAnswerBean
;
@SuppressLint
(
"HandlerLeak"
)
private
Handler
mHandler
=
new
Handler
()
{
@Override
...
...
@@ -1081,8 +1083,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
userIsInPage
(
"67"
,
"用户离开当前页面"
,
sessionId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
());
}
ArrayList
<
AnswersItem
>
answersItems
=
new
ArrayList
<>();
public
void
onEvent
(
MultipleSelectedEvent
event
){
if
(
event
.
getOthersState
()!=
null
){
answersItems
=
event
.
getMultipleAnswerBean
().
getAnswersItems
();
multipleAnswerBean
=
event
.
getMultipleAnswerBean
();
multipleAnswerBean
.
setAnswersItems
(
answersItems
);
if
(
event
.
getOthersState
().
isOthers
()){
//用户点击了其他事件
if
(
event
.
getOthersState
().
getOthersSelect
()){
...
...
@@ -1102,24 +1108,41 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
else
{
question_multiple
.
setText
(
event
.
getStrSelected
());
}
}
else
if
(
event
.
isFromInputPanel
()){
for
(
int
i
=
0
;
i
<
answersItems
.
size
();
i
++){
if
(
answersItems
.
get
(
i
).
getName
().
contains
(
"其他"
)){
answersItems
.
get
(
i
).
setOther
(
inputPanel
.
getInputContent
());
break
;
}
}
multipleAnswerBean
.
setAnswersItems
(
answersItems
);
answerMultipleQuestion
(
multipleAnswerBean
);
}
else
{
//请求接口发送消息为56的答案
inputPanel
.
setInputContent
(
""
);
question_multiple
.
setText
(
""
);
inputPanel
.
onlyShowTextEnd
();
ArrayList
<
AnswersItem
>
answersItems
=
event
.
getMultipleAnswerBean
().
getAnswersItems
();
//请求接口发送消息为56的答案
answersItems
=
event
.
getMultipleAnswerBean
().
getAnswersItems
();
for
(
int
i
=
0
;
i
<
answersItems
.
size
();
i
++){
if
(
answersItems
.
get
(
i
).
getName
().
contains
(
"其他"
)){
answersItems
.
get
(
i
).
setOther
(
inputPanel
.
getInputContent
());
break
;
}
}
answerLingxiQuestion
(
event
.
getMultipleAnswerBean
().
getExamId
(),
event
.
getMultipleAnswerBean
().
getQuestionPaperId
(),
event
.
getMultipleAnswerBean
().
getUid
(),
event
.
getMultipleAnswerBean
().
getQuestionId
(),
answersItems
,
event
.
getMultipleAnswerBean
().
getFromUid
()
);
multipleAnswerBean
=
event
.
getMultipleAnswerBean
();
multipleAnswerBean
.
setAnswersItems
(
answersItems
);
answerMultipleQuestion
(
multipleAnswerBean
);
}
}
/*
* 用户回答问题接口
* */
private
void
answerMultipleQuestion
(
MultipleAnswerBean
multipleAnswerBean
){
inputPanel
.
setInputContent
(
""
);
question_multiple
.
setText
(
""
);
inputPanel
.
onlyShowTextEnd
();
answerLingxiQuestion
(
multipleAnswerBean
.
getExamId
(),
multipleAnswerBean
.
getQuestionPaperId
(),
multipleAnswerBean
.
getUid
(),
multipleAnswerBean
.
getQuestionId
(),
multipleAnswerBean
.
getAnswersItems
(),
multipleAnswerBean
.
getFromUid
());
}
/*
* 用户回答问题接口
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
View file @
4c3c4016
...
...
@@ -42,6 +42,9 @@ import com.tbruyelle.rxpermissions2.Permission;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.event.MultipleAnswerBean
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.nimbase.api.UIKitOptions
;
import
com.yidianling.nimbase.api.model.session.SessionCustomization
;
import
com.yidianling.nimbase.business.session.actions.BaseAction
;
...
...
@@ -62,6 +65,7 @@ import com.yidianling.uikit.custom.widget.SafeHelpRemindDialog;
import
java.io.File
;
import
java.util.List
;
import
de.greenrobot.event.EventBus
;
import
io.reactivex.functions.Consumer
;
/**
...
...
@@ -412,7 +416,12 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
if
(
v
==
switchToTextButtonInInputBar
)
{
switchToTextLayout
(
true
);
// 显示文本发送的布局
}
else
if
(
v
==
sendMessageButtonInInputBar
)
{
onTextMessageSendButtonPressed
();
if
(
onlyShowInputTest
){
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
null
,
null
,
null
,
true
));
}
else
{
onTextMessageSendButtonPressed
();
}
}
else
if
(
v
==
switchToAudioButtonInInputBar
)
{
rxPermissions
.
requestEach
(
Manifest
.
permission
.
RECORD_AUDIO
)
.
subscribe
(
new
Consumer
<
Permission
>()
{
...
...
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