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
2d620ac1
Commit
2d620ac1
authored
Jun 29, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-用户显示灵犀的正在输入中
parent
e9e55060
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
30 deletions
+61
-30
MultipleSelectedEvent.kt
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
+6
-1
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+37
-25
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+16
-3
InputPanel.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
+2
-1
No files found.
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
View file @
2d620ac1
...
...
@@ -2,5 +2,9 @@ package com.yidianling.im.event
public
class
MultipleSelectedEvent
(
val
strSelected
:
String
,
var
isOthers
:
Boolean
var
othersState
:
OthersState
)
data class
OthersState
(
var
isOthers
:
Boolean
,
var
othersSelect
:
Boolean
)
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
2d620ac1
...
...
@@ -16,6 +16,7 @@ import com.ydl.ydlcommon.data.http.RxUtils;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.event.OthersState
;
import
com.yidianling.im.http.ImRetrofitApi
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion
;
...
...
@@ -47,6 +48,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
private
RecyclerView
recycleviewMultipleChoice
;
private
TextView
confirm_multiple_choice
;
private
TextView
which_question_title
;
private
TextView
multiple_choice_title
;
private
AdapterLingxiWhichQuestion
adapterLingxiWhichQuestion
;
private
AdapterLingxiMultipleChoice
adapterLingxiMultipleChoice
;
...
...
@@ -57,7 +59,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
private
StringBuffer
stringBuffer
=
new
StringBuffer
(
"已选:"
);
ArrayList
<
String
>
selectedStr
=
new
ArrayList
<
String
>();
private
Boolean
isClickable
=
true
;
private
Boolean
isOthers
;
//回答试卷接口
private
String
examId
;
private
String
questionPaperId
;
...
...
@@ -94,6 +96,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
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
);
}
...
...
@@ -109,7 +112,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
questionList
=
(
ArrayList
<
QuestionItemBean
>)
customAttachLingxiWhichQuestion
.
options
;
}
adapterLingxiWhichQuestion
=
new
AdapterLingxiWhichQuestion
();
which_question_title
.
setText
(
customAttachLingxiWhichQuestion
.
name
);
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++){
questionList
.
get
(
i
).
setSelected
(
false
);
if
(
questionList
.
get
(
i
).
getName
().
length
()>
5
){
...
...
@@ -122,27 +124,11 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
switch
(
customAttachLingxiWhichQuestion
.
type
){
case
"radio"
:
//您想要咨询下列哪类的问题?(单选)
if
(
questionList
!=
null
&&
questionList
.
size
()!=
0
){
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
);
initSingleChoice
();
}
break
;
case
"check"
:
//请问是发生了什么事情导致的呢?(多选)
// //请问是发生了什么事情导致的呢?(多选)
adapterLingxiMultipleChoice
=
new
AdapterLingxiMultipleChoice
();
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
adapterLingxiMultipleChoice
.
setItemListener
(
this
);
GridLayoutManager
multipleChoiceManager
=
new
GridLayoutManager
(
context
,
2
);
//当list中字段大于6个显示单行,否则显示双行
multipleChoiceManager
.
setSpanCount
(
isSingleChoice
?
1
:
2
);
multipleChoiceManager
.
setOrientation
(
GridLayoutManager
.
VERTICAL
);
recycleviewMultipleChoice
.
setLayoutManager
(
multipleChoiceManager
);
recycleviewMultipleChoice
.
setAdapter
(
adapterLingxiMultipleChoice
);
initMultipleChoice
();
break
;
case
"3"
:
//您是先生还是女生
break
;
...
...
@@ -151,6 +137,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
}
UpdateFromLocalExtention
();
}
private
void
UpdateFromLocalExtention
()
{
try
{
Map
<
String
,
Object
>
map
=
message
.
getLocalExtension
();
if
(
map
!=
null
)
{
...
...
@@ -175,8 +167,31 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
}
catch
(
Exception
e
)
{
}
}
private
void
initMultipleChoice
()
{
multiple_choice_title
.
setText
(
customAttachLingxiWhichQuestion
.
name
);
adapterLingxiMultipleChoice
=
new
AdapterLingxiMultipleChoice
();
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
adapterLingxiMultipleChoice
.
setItemListener
(
this
);
GridLayoutManager
multipleChoiceManager
=
new
GridLayoutManager
(
context
,
2
);
//当list中字段大于6个显示单行,否则显示双行
multipleChoiceManager
.
setSpanCount
(
isSingleChoice
?
1
:
2
);
multipleChoiceManager
.
setOrientation
(
GridLayoutManager
.
VERTICAL
);
recycleviewMultipleChoice
.
setLayoutManager
(
multipleChoiceManager
);
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
);
}
@Override
...
...
@@ -236,12 +251,9 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
for
(
int
i
=
0
;
i
<
selectedStr
.
size
();
i
++){
stringBuffer
.
append
(
"#"
).
append
(
selectedStr
.
get
(
i
));
}
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
false
));
isOthers
=
questionList
.
get
(
position
).
getName
().
contains
(
"其他"
);
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
new
OthersState
(
isOthers
,
questionList
.
get
(
position
).
isSelected
())));
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
if
(
questionList
.
get
(
position
).
getName
().
contains
(
"其他"
)){
//唤起输入键盘,隐藏标签、图片等其他布局
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
true
));
}
}
private
void
updateLocalMsg
(
Integer
position
)
{
//更新本地消息
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
2d620ac1
...
...
@@ -220,7 +220,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
String
userInfoDialogSourceFrom
=
""
;
private
UserInfoDialog
userInfoDialog
=
null
;
private
boolean
isOthers
;
@SuppressLint
(
"HandlerLeak"
)
private
Handler
mHandler
=
new
Handler
()
{
@Override
...
...
@@ -1079,9 +1079,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
public
void
onEvent
(
MultipleSelectedEvent
event
){
if
(
event
.
isOthers
()){
if
(
event
.
getOthersState
().
isOthers
()){
//用户点击了其他事件
inputPanel
.
onlyShowTextStart
();
if
(
event
.
getOthersState
().
getOthersSelect
()){
//其他是选中状态
isOthers
=
event
.
getOthersState
().
getOthersSelect
();
rootView
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
inputPanel
.
onlyShowTextStart
();
}
},
500
);
}
else
{
//其他是未选中状态
isOthers
=
event
.
getOthersState
().
getOthersSelect
();
inputPanel
.
onlyShowTextEnd
();
}
}
else
{
question_multiple
.
setText
(
event
.
getStrSelected
());
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/input/InputPanel.java
View file @
2d620ac1
...
...
@@ -144,7 +144,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
private
String
sendText
=
""
;
private
Boolean
onlyShowInputTest
=
false
;
private
Boolean
onlyShowInputTest
=
false
;
//灵犀2.0 点击其他的时候隐藏除输入框以外的其他内容
/***设置输入框内容*/
public
void
setInputContent
(
String
content
)
{
...
...
@@ -857,6 +857,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
* 隐藏所有输入布局
*/
private
void
hideAllInputLayout
(
boolean
immediately
)
{
if
(
hideAllInputLayoutRunnable
==
null
)
{
hideAllInputLayoutRunnable
=
new
Runnable
()
{
...
...
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