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
4219dd24
Commit
4219dd24
authored
Jun 23, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-单选逻辑
parent
c843762f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
7 deletions
+17
-7
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+6
-6
AdapterLingxiWhichQuestion.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
+8
-0
LingxiWhichQuestionBean.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
+3
-1
No files found.
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
4219dd24
...
...
@@ -62,7 +62,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
adapterLingxiWhichQuestion
=
new
AdapterLingxiWhichQuestion
();
for
(
int
i
=
0
;
i
<
8
;
i
++){
questionList
.
add
(
new
QuestionItemBean
(
"1"
,
"婚姻情感"
));
questionList
.
add
(
new
QuestionItemBean
(
"1"
,
"婚姻情感"
,
false
));
}
adapterLingxiWhichQuestion
.
setTagData
(
questionList
);
adapterLingxiWhichQuestion
.
setItemListener
(
this
);
...
...
@@ -86,11 +86,11 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
@Override
public
void
onItemClick
(
@NotNull
QuestionItemBean
string
,
int
position
)
{
ToastUtil
.
toastShort
(
"单选点击了"
+
position
);
//todo发送消息
public
void
onItemClick
(
@NotNull
QuestionItemBean
itemBean
,
int
position
)
{
for
(
int
i
=
0
;
i
<
questionList
.
size
();
i
++){
questionList
.
get
(
i
).
setSelected
(
i
==
position
);
}
adapterLingxiWhichQuestion
.
setTagData
(
questionList
);
}
@Override
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
View file @
4219dd24
...
...
@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
com.yidianling.im.R
import
com.yidianling.im.session.viewholder.bean.LingxiWhichQuestionBean
import
com.yidianling.im.session.viewholder.bean.QuestionItemBean
...
...
@@ -41,6 +42,13 @@ class AdapterLingxiWhichQuestion : RecyclerView.Adapter<AdapterLingxiWhichQuesti
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
holder
.
tvWhichQuestion
.
text
=
tagList
[
position
].
name
if
(
tagList
[
position
].
isSelected
!!
){
holder
.
tvWhichQuestion
.
background
=
ContextCompat
.
getDrawable
(
holder
.
itemView
.
context
,
R
.
drawable
.
im_background_18dp_1da1f2
)
holder
.
tvWhichQuestion
.
setTextColor
(
ContextCompat
.
getColor
(
holder
.
itemView
.
context
,
R
.
color
.
white
))
}
else
{
holder
.
tvWhichQuestion
.
background
=
ContextCompat
.
getDrawable
(
holder
.
itemView
.
context
,
R
.
drawable
.
im_background_18dp_e8f5fe
)
holder
.
tvWhichQuestion
.
setTextColor
(
ContextCompat
.
getColor
(
holder
.
itemView
.
context
,
R
.
color
.
platform_color_1DA1F2
))
}
holder
.
tvWhichQuestion
.
setOnClickListener
{
onItemClickListener
?.
onItemClick
(
tagList
[
position
],
position
)
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
View file @
4219dd24
...
...
@@ -13,5 +13,6 @@ data class LingxiWhichQuestionBean(
)
data class
QuestionItemBean
(
var
id
:
String
?,
var
name
:
String
?
var
name
:
String
?,
var
isSelected
:
Boolean
?=
false
)
\ No newline at end of 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