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
f15e59c0
Commit
f15e59c0
authored
Jun 29, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-用户显示灵犀的正在输入中
parent
2d620ac1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletions
+29
-1
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+26
-1
im_lingxi_which_question_item.xml
m-im/src/main/res/layout/im_lingxi_which_question_item.xml
+1
-0
im_nim_lingxi_multiple_choice.xml
m-im/src/main/res/layout/im_nim_lingxi_multiple_choice.xml
+2
-0
No files found.
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
f15e59c0
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.content.ContextWrapper
;
import
android.os.Build
;
import
android.view.View
;
import
android.widget.TextView
;
import
androidx.recyclerview.widget.GridLayoutManager
;
...
...
@@ -14,6 +17,7 @@ import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.yidianling.common.tools.LogUtil
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.event.MultipleSelectedEvent
;
import
com.yidianling.im.event.OthersState
;
...
...
@@ -76,7 +80,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
switch
(
customAttachLingxiWhichQuestion
.
type
){
case
"radio"
:
//您想要咨询下列哪类的问题?(单选)
return
R
.
layout
.
im_nim_lingxi_which_question
;
// return R.layout.im_nim_lingxi_multiple_choice;
case
"check"
:
//请问是发生了什么事情导致的呢?(多选)
return
R
.
layout
.
im_nim_lingxi_multiple_choice
;
case
"3"
:
//您是先生还是女生
...
...
@@ -170,6 +173,10 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
private
void
initMultipleChoice
()
{
confirm_multiple_choice
.
setOnClickListener
(
view
->
{
//请求接口发送所选题目
answerLingxiQuestion
(
examId
,
questionPaperId
,
ImIn
.
INSTANCE
.
getUserInfo
().
getUid
(),
questionId
,
answersItems
);
});
multiple_choice_title
.
setText
(
customAttachLingxiWhichQuestion
.
name
);
adapterLingxiMultipleChoice
=
new
AdapterLingxiMultipleChoice
();
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
...
...
@@ -238,15 +245,30 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
if
(
i
==
position
){
questionList
.
get
(
i
).
setSelected
(
false
);
selectedStr
.
remove
(
questionList
.
get
(
i
).
getName
());
answersItems
.
remove
(
position
);
}
}
else
{
if
(
i
==
position
){
questionList
.
get
(
i
).
setSelected
(
true
);
selectedStr
.
add
(
questionList
.
get
(
i
).
getName
());
answersItems
.
add
(
new
AnswersItem
(
questionList
.
get
(
position
).
getId
(),
questionList
.
get
(
position
).
getName
(),
"其他"
,
questionList
.
get
(
position
).
getRelates
()));
}
}
}
confirm_multiple_choice
.
setText
(
String
.
format
(
"确定(%d)"
,
selectedStr
.
size
()));
if
(
selectedStr
.
size
()>
0
){
confirm_multiple_choice
.
setEnabled
(
true
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getResources
().
getDrawable
(
R
.
drawable
.
im_background_18dp_1da1f2
));
}
}
else
{
confirm_multiple_choice
.
setEnabled
(
false
);
confirm_multiple_choice
.
setText
(
"确定"
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
}
stringBuffer
.
delete
(
2
,
stringBuffer
.
length
());
for
(
int
i
=
0
;
i
<
selectedStr
.
size
();
i
++){
stringBuffer
.
append
(
"#"
).
append
(
selectedStr
.
get
(
i
));
...
...
@@ -254,6 +276,9 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
isOthers
=
questionList
.
get
(
position
).
getName
().
contains
(
"其他"
);
EventBus
.
getDefault
().
post
(
new
MultipleSelectedEvent
(
stringBuffer
.
toString
(),
new
OthersState
(
isOthers
,
questionList
.
get
(
position
).
isSelected
())));
adapterLingxiMultipleChoice
.
setTagData
(
questionList
);
}
private
void
updateLocalMsg
(
Integer
position
)
{
//更新本地消息
...
...
m-im/src/main/res/layout/im_lingxi_which_question_item.xml
View file @
f15e59c0
...
...
@@ -6,6 +6,7 @@
android:text=
"婚姻家庭婚姻混"
android:textColor=
"@color/platform_color_1DA1F2"
android:gravity=
"center"
android:minWidth=
"110dp"
android:background=
"@drawable/im_background_18dp_e8f5fe"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_8"
...
...
m-im/src/main/res/layout/im_nim_lingxi_multiple_choice.xml
View file @
f15e59c0
...
...
@@ -39,11 +39,13 @@
android:text=
"确定(0)"
android:layout_marginTop=
"@dimen/platform_dp_24"
android:textSize=
"@dimen/im_text_size_15"
android:enabled=
"false"
app:layout_constraintEnd_toEndOf=
"@id/multiple_question_rv"
android:layout_marginEnd=
"@dimen/platform_dp_12"
android:background=
"@drawable/im_background_18dp_ebebeb"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_8"
android:textColor=
"@color/white"
android:gravity=
"center"
android:layout_marginBottom=
"@dimen/platform_dp_20"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
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