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
36b12cf9
Commit
36b12cf9
authored
Jul 07, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/4.2.60' into 4.2.60
# Conflicts: # config.gradle
parents
339f40ea
4b9462e5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
75 deletions
+59
-75
config.gradle
config.gradle
+1
-1
CustomAttachLingxiAnswerQuestion.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiAnswerQuestion.java
+1
-1
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+51
-72
MessageListPanelEx.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
+5
-0
im_nim_message_item_text.xml
m-im/src/main/res_uikit/layout/im_nim_message_item_text.xml
+1
-1
No files found.
config.gradle
View file @
36b12cf9
...
...
@@ -93,7 +93,7 @@ ext {
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.37"
,
"m-home"
:
"0.0.22.67"
,
"m-im"
:
"0.0.19.3
3
"
,
"m-im"
:
"0.0.19.3
6
"
,
"m-dynamic"
:
"0.0.7.24"
,
"m-article"
:
"0.0.0.8"
,
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiAnswerQuestion.java
View file @
36b12cf9
...
...
@@ -8,7 +8,7 @@ import java.util.ArrayList;
public
class
CustomAttachLingxiAnswerQuestion
extends
CustomAttachment
{
private
final
String
ANSWERS
=
"answers"
;
private
final
String
QUESTIONID
=
"question
Paper
Id"
;
private
final
String
QUESTIONID
=
"questionId"
;
public
ArrayList
<
QuestionItemBean
>
answers
;
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
36b12cf9
...
...
@@ -47,14 +47,11 @@ import io.reactivex.schedulers.Schedulers;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
public
class
MsgViewHolderLingxiWhichQuestion
extends
MsgViewHolderBase
implements
AdapterLingxiWhichQuestion
.
OnQuestionlItemClickListener
,
AdapterLingxiMultipleChoice
.
OnMultiplelItemClickListener
{
private
RecyclerView
recycleviewWhichQuestion
;
public
class
MsgViewHolderLingxiWhichQuestion
extends
MsgViewHolderBase
implements
AdapterLingxiMultipleChoice
.
OnMultiplelItemClickListener
{
private
RecyclerView
recycleviewMultipleChoice
;
private
TextView
confirm_multiple_choice
;
private
TextView
which_question_title
;
private
TextView
multiple_choice_title
;
private
AdapterLingxiWhichQuestion
adapterLingxiWhichQuestion
;
private
AdapterLingxiMultipleChoice
adapterLingxiMultipleChoice
;
ArrayList
<
QuestionItemBean
>
questionList
=
new
ArrayList
<
QuestionItemBean
>();
...
...
@@ -71,6 +68,8 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
private
String
singleOrMultipletype
;
private
ArrayList
<
AnswersItem
>
answersItems
=
new
ArrayList
<>();
Map
<
String
,
Object
>
mapMessageFromCustom
;
Map
map1
=
new
HashMap
();
public
MsgViewHolderLingxiWhichQuestion
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
...
...
@@ -80,14 +79,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
customAttachLingxiWhichQuestion
=
((
CustomAttachLingxiWhichQuestion
)
message
.
getAttachment
());
singleOrMultipletype
=
customAttachLingxiWhichQuestion
.
type
;
if
(
customAttachLingxiWhichQuestion
.
type
!=
null
)
{
switch
(
customAttachLingxiWhichQuestion
.
type
)
{
case
"radio"
:
//您想要咨询下列哪类的问题?(单选)
return
R
.
layout
.
im_nim_lingxi_which_question
;
case
"check"
:
//请问是发生了什么事情导致的呢?(多选)
return
R
.
layout
.
im_nim_lingxi_multiple_choice
;
default
:
return
R
.
layout
.
im_nim_lingxi_which_question
;
}
}
else
{
return
R
.
layout
.
im_nim_lingxi_which_question
;
}
...
...
@@ -96,10 +88,9 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
@Override
protected
void
inflateContentView
()
{
recycleviewWhichQuestion
=
findViewById
(
R
.
id
.
which_question_rv
);
//
recycleviewWhichQuestion = findViewById(R.id.which_question_rv);
recycleviewMultipleChoice
=
findViewById
(
R
.
id
.
multiple_question_rv
);
confirm_multiple_choice
=
findViewById
(
R
.
id
.
confirm_multiple_choice
);
which_question_title
=
findViewById
(
R
.
id
.
which_question_title
);
multiple_choice_title
=
findViewById
(
R
.
id
.
multiple_choice_title
);
}
...
...
@@ -116,7 +107,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
if
(
customAttachLingxiWhichQuestion
.
options
!=
null
)
{
questionList
=
(
ArrayList
<
QuestionItemBean
>)
customAttachLingxiWhichQuestion
.
options
;
}
adapterLingxiWhichQuestion
=
new
AdapterLingxiWhichQuestion
();
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++)
{
questionList
.
get
(
i
).
setSelected
(
false
);
if
(
questionList
.
get
(
i
).
getName
().
length
()
>
5
)
{
...
...
@@ -124,35 +114,26 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
}
if
(
customAttachLingxiWhichQuestion
.
type
!=
null
)
{
switch
(
customAttachLingxiWhichQuestion
.
type
)
{
case
"radio"
:
//您想要咨询下列哪类的问题?(单选)
if
(
questionList
!=
null
&&
questionList
.
size
()
!=
0
)
{
initSingleChoice
();
}
break
;
case
"check"
:
//请问是发生了什么事情导致的呢?(多选)
singleOrMultipletype
=
customAttachLingxiWhichQuestion
.
type
;
initMultipleChoice
();
break
;
default
:
break
;
}
}
//进入消息列表时候,保存当type为56的时候的,将ID作为key保存
NIMClient
.
getService
(
MsgService
.
class
).
queryMessageList
(
message
.
getSessionId
(),
SessionTypeEnum
.
P2P
,
0
,
100
).
setCallback
(
new
RequestCallback
<
List
<
IMMessage
>>()
{
@Override
public
void
onSuccess
(
List
<
IMMessage
>
param
)
{
if
(
param
!=
null
&&
param
.
size
()
>
0
)
{
for
(
IMMessage
msg
:
param
)
{
MsgAttachment
attachment
=
msg
.
getAttachment
();
if
(
attachment
instanceof
CustomAttachLingxiAnswerQuestion
)
{
CustomAttachLingxiAnswerQuestion
customattachlingxianswerquestion
=
(
CustomAttachLingxiAnswerQuestion
)
attachment
;
Map
map1
=
msg
.
getLocalExtension
();
map1
=
new
HashMap
();
if
(!
map1
.
containsKey
(
customattachlingxianswerquestion
.
questionId
)){
map1
.
put
(
customattachlingxianswerquestion
.
questionId
,
true
);
}
mapMessageFromCustom
=
map1
;
UpdateFromLocalExtention
();
LogUtil
.
e
(
"aaaaaquestionID:"
+
customattachlingxianswerquestion
.
questionId
);
}
else
{
//用户没有回答问题;
}
}
}
...
...
@@ -181,18 +162,26 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
if
(
mapMessage
!=
null
)
{
Object
questionPaperId
=
mapMessage
.
get
(
customAttachLingxiWhichQuestion
.
questionPaperId
);
Object
questionPaperId
=
mapMessage
.
get
(
customAttachLingxiWhichQuestion
.
id
);
LogUtil
.
e
(
"aaaaaIDIDI:"
+
customAttachLingxiWhichQuestion
.
id
);
if
(
questionPaperId
!=
null
)
{
boolean
b
=
(
boolean
)
questionPaperId
;
if
(
b
)
{
//隐藏回答的信息
if
(
singleOrMultipletype
.
contains
(
"radio"
)){
recycleviewWhichQuestion
.
setVisibility
(
View
.
GONE
);
}
else
{
recycleviewMultipleChoice
.
setVisibility
(
View
.
GONE
);
confirm_multiple_choice
.
setVisibility
(
View
.
GONE
);
}
else
{
recycleviewMultipleChoice
.
setVisibility
(
View
.
VISIBLE
);
confirm_multiple_choice
.
setVisibility
(
View
.
VISIBLE
);
}
}
else
{
//隐藏回答的信息
if
(
singleOrMultipletype
.
contains
(
"radio"
)){
recycleviewMultipleChoice
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
recycleviewMultipleChoice
.
setVisibility
(
View
.
VISIBLE
);
confirm_multiple_choice
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
...
...
@@ -203,7 +192,11 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
private
void
initMultipleChoice
()
{
if
(
singleOrMultipletype
.
contains
(
"radio"
)){
confirm_multiple_choice
.
setVisibility
(
View
.
GONE
);
}
else
{
confirm_multiple_choice
.
setVisibility
(
View
.
VISIBLE
);
}
confirm_multiple_choice
.
setOnClickListener
(
view
->
{
//请求接口发送所选题目,通过发通知到YDLMessageFragment统一回答问题。
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
null
,
null
,
...
...
@@ -222,27 +215,34 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
recycleviewMultipleChoice
.
setAdapter
(
adapterLingxiMultipleChoice
);
}
private
void
initSingleChoice
()
{
which_question_title
.
setText
(
customAttachLingxiWhichQuestion
.
name
);
adapterLingxiWhichQuestion
.
setTagData
(
questionList
,
isSingleChoice
);
adapterLingxiWhichQuestion
.
setItemListener
(
this
);
GridLayoutManager
gridLayoutManager
=
new
GridLayoutManager
(
context
,
2
);
//当list中字段大于6个显示单行,否则显示双行
gridLayoutManager
.
setSpanCount
(
isSingleChoice
?
1
:
2
);
gridLayoutManager
.
setOrientation
(
GridLayoutManager
.
VERTICAL
);
recycleviewWhichQuestion
.
setLayoutManager
(
gridLayoutManager
);
recycleviewWhichQuestion
.
setAdapter
(
adapterLingxiWhichQuestion
);
/*
* 用户回答问题接口
* */
private
void
answerLingxiQuestion
(
String
examID
,
String
questionPaperId
,
String
uid
,
String
questionId
,
ArrayList
<
AnswersItem
>
answersItems
)
{
String
str
=
new
Gson
().
toJson
(
new
LingxiAnswerBean
(
new
AnswerBean
(
examID
,
questionPaperId
,
uid
,
questionId
,
answersItems
),
uid
,
"56"
,
message
.
getFromAccount
()));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
lingxiAnswerQuestion
(
body
)
.
compose
(
RxUtils
.
INSTANCE
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
{
LogUtil
.
e
(
"answerQuestion"
+
it
.
toString
());
},
throwable
->
LogUtil
.
e
(
throwable
.
getMessage
())
);
}
@Override
public
void
onItemClick
(
@NotNull
QuestionItemBean
itemBean
,
int
position
)
{
@Override
public
void
onMultipleItemClick
(
@NotNull
QuestionItemBean
string
,
int
position
)
{
if
(
singleOrMultipletype
.
contains
(
"radio"
)){
/*
* 单选题:分其他选项和非其他选项
* 其他选项,唤起输入框
* 点击非其他选项直接发送答案
* */
if
(
isClickable
)
{
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++)
{
if
(
questionList
.
get
(
i
).
isSelected
())
{
if
(
i
==
position
)
{
...
...
@@ -265,7 +265,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
questionList
.
get
(
i
).
setSelected
(
i
==
position
);
}
adapterLingxiWhichQuestion
.
setTagData
(
questionList
,
isSingleChoice
);
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++)
{
if
(
questionList
.
get
(
i
).
isSelected
()){
answersItems
.
clear
();
...
...
@@ -293,30 +293,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
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
,
false
));
}
}
}
/*
* 用户回答问题接口
* */
private
void
answerLingxiQuestion
(
String
examID
,
String
questionPaperId
,
String
uid
,
String
questionId
,
ArrayList
<
AnswersItem
>
answersItems
)
{
String
str
=
new
Gson
().
toJson
(
new
LingxiAnswerBean
(
new
AnswerBean
(
examID
,
questionPaperId
,
uid
,
questionId
,
answersItems
),
uid
,
"56"
,
message
.
getFromAccount
()));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
lingxiAnswerQuestion
(
body
)
.
compose
(
RxUtils
.
INSTANCE
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
it
->
{
LogUtil
.
e
(
"answerQuestion"
+
it
.
toString
());
},
throwable
->
LogUtil
.
e
(
throwable
.
getMessage
())
);
}
@Override
public
void
onMultipleItemClick
(
@NotNull
QuestionItemBean
string
,
int
position
)
{
if
(
isClickable
){
}
else
{
//多选发送消息
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++)
{
if
(
questionList
.
get
(
i
).
isSelected
())
{
...
...
@@ -362,6 +339,8 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
questionId
,
answersItems
,
message
.
getFromAccount
()),
false
,
false
));
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
}
}
private
void
updateLocalMsg
(
Integer
position
,
ArrayList
<
String
>
selectedPosition
)
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
View file @
36b12cf9
...
...
@@ -285,8 +285,13 @@ public class MessageListPanelEx {
}
if
(
needRefresh
)
{
sortMessages
(
items
);
new
Handler
().
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
adapter
.
notifyDataSetChanged
();
}
});
}
adapter
.
updateShowTimeItem
(
addedListItems
,
false
,
true
);
...
...
m-im/src/main/res_uikit/layout/im_nim_message_item_text.xml
View file @
36b12cf9
...
...
@@ -13,6 +13,6 @@
android:includeFontPadding=
"false"
android:lineSpacingExtra=
"3dip"
android:minHeight=
"40dp"
android:textColor=
"@color/
white
"
android:textColor=
"@color/
im_color_242424
"
android:textSize=
"17dp"
/>
</LinearLayout>
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