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
5455aa49
Commit
5455aa49
authored
Jun 21, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-您想要咨询下列哪类问题
parent
6b9fb191
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
210 additions
and
0 deletions
+210
-0
CustomAttachLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiWhichQuestion.java
+21
-0
CustomAttachmentType.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
+4
-0
LingxiWhichQuestionBean.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/LingxiWhichQuestionBean.kt
+8
-0
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+58
-0
AdapterLingxiWhichQuestion.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
+56
-0
im_background_18dp_e8f5fe.xml
m-im/src/main/res/drawable/im_background_18dp_e8f5fe.xml
+6
-0
im_lingxi_which_question_item.xml
m-im/src/main/res/layout/im_lingxi_which_question_item.xml
+20
-0
im_nim_lingxi_which_question.xml
m-im/src/main/res/layout/im_nim_lingxi_which_question.xml
+37
-0
No files found.
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiWhichQuestion.java
0 → 100644
View file @
5455aa49
package
com
.
yidianling
.
im
.
session
.
extension
;
import
com.alibaba.fastjson.JSONObject
;
public
class
CustomAttachLingxiWhichQuestion
extends
CustomAttachment
{
private
final
String
KEY_STATUS
=
"status"
;
public
CustomAttachLingxiWhichQuestion
()
{
super
(
CustomAttachmentType
.
TYPE_LINGXI_WHICH_QUESTION
);
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
}
@Override
protected
JSONObject
packData
()
{
return
null
;
}
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
View file @
5455aa49
...
...
@@ -42,4 +42,8 @@ public interface CustomAttachmentType {
int
TYPE_FILTER_42
=
42
;
//客服切换过滤42
int
TYPE_CONFIRM_ORDER
=
38
;
//确认订单
int
TYPE_ORDER_ALREADY_DONE
=
39
;
//已完成订单
//灵犀2.0问诊数据
int
TYPE_LINGXI_WHICH_QUESTION
=
50
;
//您想要咨询哪类问题
}
m-im/src/main/java/com/yidianling/im/session/viewholder/LingxiWhichQuestionBean.kt
0 → 100644
View file @
5455aa49
package
com.yidianling.im.session.viewholder
data class
LingxiWhichQuestionBean
(
var
isSelected
:
Boolean
,
var
name
:
String
,
var
id
:
String
)
\ No newline at end of file
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
0 → 100644
View file @
5455aa49
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.viewholder.adapter.AdapterLingxiWhichQuestion
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
import
org.jetbrains.annotations.NotNull
;
import
java.util.ArrayList
;
public
class
MsgViewHolderLingxiWhichQuestion
extends
MsgViewHolderBase
implements
AdapterLingxiWhichQuestion
.
OnQuestionlItemClickListener
{
private
RecyclerView
recycleviewWhichQuestion
;
private
AdapterLingxiWhichQuestion
adapterLingxiWhichQuestion
;
ArrayList
<
String
>
questionList
=
new
ArrayList
<
String
>();
public
MsgViewHolderLingxiWhichQuestion
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
@Override
protected
int
getContentResId
()
{
return
R
.
layout
.
im_nim_lingxi_which_question
;
}
@Override
protected
void
inflateContentView
()
{
recycleviewWhichQuestion
=
findViewById
(
R
.
id
.
which_question_rv
);
}
@Override
protected
void
bindContentView
()
{
questionList
.
add
(
"aaa"
);
questionList
.
add
(
"aaa"
);
questionList
.
add
(
"aaa"
);
questionList
.
add
(
"aaa"
);
questionList
.
add
(
"aaa"
);
questionList
.
add
(
"aaa"
);
adapterLingxiWhichQuestion
=
new
AdapterLingxiWhichQuestion
();
adapterLingxiWhichQuestion
.
setTagData
(
questionList
);
GridLayoutManager
gridLayoutManager
=
new
GridLayoutManager
(
context
,
2
);
gridLayoutManager
.
setOrientation
(
LinearLayoutManager
.
VERTICAL
);
recycleviewWhichQuestion
.
setLayoutManager
(
gridLayoutManager
);
recycleviewWhichQuestion
.
setAdapter
(
adapterLingxiWhichQuestion
);
}
@Override
public
void
onItemClick
(
@NotNull
LingxiWhichQuestionBean
string
,
int
position
)
{
ToastUtil
.
toastShort
(
"点击了"
+
position
);
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/adapter/AdapterLingxiWhichQuestion.kt
0 → 100644
View file @
5455aa49
package
com.yidianling.im.session.viewholder.adapter
import
androidx.recyclerview.widget.RecyclerView
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.TextView
import
com.ydl.ydl_image.module.GlideApp
import
com.yidianling.im.R
import
com.yidianling.im.session.viewholder.LingxiWhichQuestionBean
/**
* @author huozhiliang
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2021/6/21
*/
class
AdapterLingxiWhichQuestion
:
RecyclerView
.
Adapter
<
AdapterLingxiWhichQuestion
.
ViewHolder
>()
{
private
lateinit
var
tagList
:
List
<
String
>
private
var
onItemClickListener
:
OnQuestionlItemClickListener
?
=
null
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
tv_which_question
:
TextView
=
itemView
.
findViewById
(
R
.
id
.
tv_which_question
)
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
return
ViewHolder
(
LayoutInflater
.
from
(
parent
.
context
).
inflate
(
R
.
layout
.
im_lingxi_which_question_item
,
parent
,
false
)
)
}
override
fun
getItemCount
():
Int
{
return
tagList
.
size
?:
0
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
// holder.tv_which_question.setText("")
holder
.
tv_which_question
.
setOnClickListener
{
onItemClickListener
?.
onItemClick
(
LingxiWhichQuestionBean
(
true
,
"aa"
,
"aaa"
),
position
)
}
}
fun
setTagData
(
data
:
List
<
String
>)
{
tagList
=
data
notifyDataSetChanged
()
}
interface
OnQuestionlItemClickListener
{
fun
onItemClick
(
string
:
LingxiWhichQuestionBean
,
position
:
Int
)
}
}
\ No newline at end of file
m-im/src/main/res/drawable/im_background_18dp_e8f5fe.xml
0 → 100644
View file @
5455aa49
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#e8f5fe"
/>
<corners
android:radius=
"@dimen/platform_dp_18"
/>
</shape>
m-im/src/main/res/layout/im_lingxi_which_question_item.xml
0 → 100644
View file @
5455aa49
<?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=
"婚姻家庭"
android:maxWidth=
"110dp"
android:minWidth=
"110dp"
android:textColor=
"@color/platform_color_1DA1F2"
android:gravity=
"center"
android:background=
"@drawable/im_background_18dp_e8f5fe"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_8"
android:id=
"@+id/tv_which_question"
android:layout_marginTop=
"@dimen/platform_dp_16"
android:layout_marginRight=
"@dimen/platform_dp_9"
>
</TextView>
\ No newline at end of file
m-im/src/main/res/layout/im_nim_lingxi_which_question.xml
0 → 100644
View file @
5455aa49
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:background=
"@drawable/im_custom_message_round_white_6dp_bg"
android:paddingLeft=
"@dimen/platform_dp_12"
android:paddingRight=
"@dimen/platform_dp_3"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/which_question_title"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
tools:text=
"您想要咨询下类哪类问题?"
android:textSize=
"@dimen/im_text_size_17"
android:textColor=
"@color/im_color_242424"
>
</TextView>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/which_question_rv"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintTop_toBottomOf=
"@id/which_question_title"
app:layout_constraintStart_toStartOf=
"@id/which_question_title"
tools:itemCount=
"6"
app:spanCount=
"2"
tools:listitem=
"@layout/im_lingxi_which_question_item"
app:layoutManager=
"androidx.recyclerview.widget.GridLayoutManager"
android:layout_marginBottom=
"@dimen/platform_dp_16"
app:layout_constraintBottom_toBottomOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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