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
b052d78e
Commit
b052d78e
authored
Jun 26, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-回答问题
parent
560634fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
11 deletions
+33
-11
CustomAttachLingxiAnswerQuestion.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiAnswerQuestion.java
+8
-5
MsgViewHolderLingxiAnswerQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiAnswerQuestion.java
+8
-1
im_custom_message_round_c2e7ff_6dp_bg.xml
m-im/src/main/res/drawable/im_custom_message_round_c2e7ff_6dp_bg.xml
+8
-0
im_nim_lingxi_answer_question.xml
m-im/src/main/res/layout/im_nim_lingxi_answer_question.xml
+9
-5
No files found.
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiAnswerQuestion.java
View file @
b052d78e
package
com
.
yidianling
.
im
.
session
.
extension
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yidianling.im.session.viewholder.bean.QuestionItemBean
;
import
java.util.ArrayList
;
public
class
CustomAttachLingxiAnswerQuestion
extends
CustomAttachment
{
private
final
String
QUESTIONPAPERID
=
"questionPaperId
"
;
//试卷id
private
final
String
ANSWERS
=
"answers
"
;
//试卷id
public
String
questionPaperId
;
public
ArrayList
<
QuestionItemBean
>
answers
;
public
CustomAttachLingxiAnswerQuestion
()
{
super
(
CustomAttachmentType
.
TYPE_LINGXI_ANSWER_QUESTION
);
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
this
.
questionPaperId
=
data
.
getString
(
QUESTIONPAPERID
);
this
.
answers
=(
ArrayList
<
QuestionItemBean
>)
JSON
.
parseArray
(
data
.
getString
(
ANSWERS
),
QuestionItemBean
.
class
);
}
@Override
protected
JSONObject
packData
()
{
JSONObject
data
=
new
JSONObject
();
data
.
put
(
QUESTIONPAPERID
,
questionPaperId
);
data
.
put
(
ANSWERS
,
answers
);
return
data
;
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiAnswerQuestion.java
View file @
b052d78e
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.view.Gravity
;
import
android.widget.TextView
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.extension.CustomAttachLingxiAnswerQuestion
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
public
class
MsgViewHolderLingxiAnswerQuestion
extends
MsgViewHolderBase
{
private
TextView
answer_question
;
CustomAttachLingxiAnswerQuestion
customattachLingxiAnswerQuestion
;
public
MsgViewHolderLingxiAnswerQuestion
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
...
...
@@ -19,6 +23,7 @@ public class MsgViewHolderLingxiAnswerQuestion extends MsgViewHolderBase {
@Override
protected
void
inflateContentView
()
{
answer_question
=
findViewById
(
R
.
id
.
answer_question
);
}
...
...
@@ -30,6 +35,8 @@ public class MsgViewHolderLingxiAnswerQuestion extends MsgViewHolderBase {
@Override
protected
void
bindContentView
()
{
customattachLingxiAnswerQuestion
=
((
CustomAttachLingxiAnswerQuestion
)
message
.
getAttachment
());
answer_question
.
setText
(
customattachLingxiAnswerQuestion
.
answers
.
get
(
0
).
getName
());
}
}
m-im/src/main/res/drawable/im_custom_message_round_c2e7ff_6dp_bg.xml
0 → 100644
View file @
b052d78e
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/color_c2e7ff"
/>
<corners
android:topLeftRadius=
"@dimen/platform_dp_10"
android:bottomRightRadius=
"@dimen/platform_dp_10"
android:bottomLeftRadius=
"@dimen/platform_dp_10"
/>
</shape>
m-im/src/main/res/layout/im_nim_lingxi_answer_question.xml
View file @
b052d78e
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"aaa"
android:background=
"@color/color_c2e7ff"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:tools=
"http://schemas.android.com/tools"
tools:text=
"答案"
android:background=
"@drawable/im_custom_message_round_c2e7ff_6dp_bg"
android:id=
"@+id/answer_question"
android:textColor=
"@color/im_color_242424"
android:textSize=
"@dimen/im_sp_14"
android:paddingTop=
"@dimen/platform_dp_9"
android:paddingBottom=
"@dimen/platform_dp_9"
android:paddingStart=
"@dimen/platform_dp_10"
android:paddingEnd=
"@dimen/platform_dp_10"
>
android:paddingEnd=
"@dimen/platform_dp_10"
>
</TextView>
\ 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