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
971ddcf9
Commit
971ddcf9
authored
Jul 09, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : UI优化
parent
5bfd50f8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
110 additions
and
96 deletions
+110
-96
CmsExamQuestionPaperActivity.kt
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
+7
-9
QuestionAdapter.java
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionAdapter.java
+23
-10
QuestionMultiItem.java
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionMultiItem.java
+1
-0
item_left_describe_layout.xml
m-im/src/main/res/layout/item_left_describe_layout.xml
+7
-4
item_left_more_check_layout.xml
m-im/src/main/res/layout/item_left_more_check_layout.xml
+6
-1
item_left_one_check_layout.xml
m-im/src/main/res/layout/item_left_one_check_layout.xml
+4
-1
item_right_text_layout.xml
m-im/src/main/res/layout/item_right_text_layout.xml
+1
-1
left_one_check_layout_item.xml
m-im/src/main/res/layout/left_one_check_layout_item.xml
+3
-5
im_view_question_infomation.xml
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
+58
-65
No files found.
m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
View file @
971ddcf9
...
...
@@ -252,7 +252,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
addType71Request
(
et_input_problem
.
text
.
toString
(),
""
)
}
tv_finish
.
visibility
=
View
.
VISIBLE
mackType2
(
lastAnswer
)
mackType2
(
lastAnswer
,
""
)
setFirstAndLatQuestion
(
"我们根据您的情况安排了一位高级咨询顾问,帮助您匹配最合适的咨询服务,点击按钮现在去沟通~"
)
//滑动到底部
...
...
@@ -531,21 +531,17 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
private
fun
sendAnswerText
(
list
:
List
<
OptionsBean
>,
otherInput
:
String
)
{
var
answerStr
=
""
list
.
forEach
{
answerStr
=
"$answerStr#${it.name} "
answerStr
=
"$answerStr#${it.name}
"
}
if
(
"#其他"
==
answerStr
)
{
answerStr
=
"其他"
}
else
{
if
(
otherInput
.
isNotEmpty
())
{
answerStr
=
"$answerStr \n \n $otherInput"
}
if
(!
answerStr
.
contains
(
"其他"
)||
otherInput
.
isEmpty
())
{
if
(!
answerStr
.
contains
(
"其他"
)
||
otherInput
.
isEmpty
())
{
answerStr
=
answerStr
.
substring
(
1
).
replace
(
"#"
,
"、"
)
}
}
mackType2
(
answerStr
.
trim
())
mackType2
(
answerStr
.
trim
()
,
otherInput
)
//刷新已回答问题,将多选设置成不可再选
mData
.
forEachIndexed
{
index
,
_
->
...
...
@@ -561,9 +557,10 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
*
* @param answerStr 用户展示的文字回复
* */
private
fun
mackType2
(
answerStr
:
String
)
{
private
fun
mackType2
(
answerStr
:
String
,
other
:
String
)
{
val
questionMultiItem
=
QuestionMultiItem
()
questionMultiItem
.
type2Text
=
answerStr
questionMultiItem
.
type2Other
=
other
questionMultiItem
.
viewType
=
2
mData
.
add
(
questionMultiItem
)
mQuestionAdapter
.
notifyDataSetChanged
()
...
...
@@ -742,6 +739,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
.
subscribe
()
},
100L
)
Handler
().
postDelayed
({
IMChatUtil
.
startChatSessionByCms
(
toUid
!!
,
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionAdapter.java
View file @
971ddcf9
...
...
@@ -3,6 +3,7 @@ package com.yidianling.uikit.business.session.view.question;
import
android.graphics.Color
;
import
android.text.SpannableString
;
import
android.text.Spanned
;
import
android.text.TextUtils
;
import
android.text.style.ForegroundColorSpan
;
import
android.view.View
;
import
android.widget.ImageView
;
...
...
@@ -18,6 +19,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.im.R
;
import
com.yidianling.im.helper.SpanUtils
;
import
com.yidianling.im.router.ImIn
;
import
com.yidianling.uikit.custom.http.response.question.OptionsBean
;
...
...
@@ -60,7 +62,11 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
break
;
case
2
:
//右侧文字
helper
.
setText
(
R
.
id
.
tv_right_text
,
item
.
type2Text
);
if
(
TextUtils
.
isEmpty
(
item
.
type2Other
))
{
helper
.
setText
(
R
.
id
.
tv_right_text
,
item
.
type2Text
);
}
else
{
SpanUtils
.
with
(
helper
.
getView
(
R
.
id
.
tv_right_text
)).
append
(
item
.
type2Text
).
append
(
"\r\n\n"
).
setFontSize
(
10
).
append
(
item
.
type2Other
).
create
();
}
ImageView
iv_header
=
helper
.
getView
(
R
.
id
.
iv_header
);
String
header
=
ImIn
.
INSTANCE
.
getUserInfo
().
getHead
();
if
(
header
!=
null
)
{
...
...
@@ -109,7 +115,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
}
}
helper
.
setGone
(
R
.
id
.
tv_one_list
,
item
.
type6CanClick
);
helper
.
setGone
(
R
.
id
.
tv_one_list
,
item
.
type6CanClick
);
GridLayoutManager
gridLayoutManager
=
new
GridLayoutManager
(
AVChatKit
.
getContext
(),
oneMaxSize
>
mTextMaxSize
?
1
:
2
);
OneRecycle
.
setLayoutManager
(
gridLayoutManager
);
...
...
@@ -142,13 +148,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
View
type5_line
=
helper
.
getView
(
R
.
id
.
type5_line
);
TextView
example
=
helper
.
getView
(
R
.
id
.
example
);
if
(
example
.
getVisibility
()
==
View
.
GONE
)
{
type5_line
.
setVisibility
(
View
.
VISIBLE
);
example
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
type5_line
.
setVisibility
(
View
.
GONE
);
example
.
setVisibility
(
View
.
GONE
);
}
if
(
item
.
type5Open
)
{
type5_line
.
setVisibility
(
View
.
VISIBLE
);
example
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -166,6 +166,19 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
helper
.
addOnClickListener
(
R
.
id
.
tv_notes
);
}
helper
.
getView
(
R
.
id
.
tv_notes
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
if
(
example
.
getVisibility
()
==
View
.
GONE
)
{
type5_line
.
setVisibility
(
View
.
VISIBLE
);
example
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
type5_line
.
setVisibility
(
View
.
GONE
);
example
.
setVisibility
(
View
.
GONE
);
}
}
});
}
/**
...
...
@@ -271,7 +284,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
oneMaxSize
=
option
.
name
.
length
();
}
}
helper
.
setGone
(
R
.
id
.
tv_one_list
,
item
.
type3CanClick
);
helper
.
setGone
(
R
.
id
.
tv_one_list
,
item
.
type3CanClick
);
GridLayoutManager
gridLayoutManager
=
new
GridLayoutManager
(
AVChatKit
.
getContext
(),
oneMaxSize
>
mTextMaxSize
?
1
:
2
);
OneRecycle
.
setLayoutManager
(
gridLayoutManager
);
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionMultiItem.java
View file @
971ddcf9
...
...
@@ -14,6 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity {
public
String
type1Text
;
public
String
type2Text
;
public
String
type2Other
;
/***type 3 单选 type 4 多选 type 6 */
public
QuestionsBean
questionsBean
;
public
boolean
type3CanClick
=
true
;
...
...
m-im/src/main/res/layout/item_left_describe_layout.xml
View file @
971ddcf9
...
...
@@ -18,7 +18,6 @@
<LinearLayout
android:layout_width=
"0dp"
app:layout_constraintHorizontal_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"8dp"
android:layout_marginEnd=
"8dp"
...
...
@@ -26,6 +25,7 @@
android:orientation=
"vertical"
android:padding=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toRightOf=
"@id/iv_header"
app:layout_constraintRight_toLeftOf=
"@id/iv_right"
app:layout_constraintTop_toTopOf=
"parent"
>
...
...
@@ -51,11 +51,13 @@
<View
android:id=
"@+id/type5_line"
android:layout_width=
"
239dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"@dimen/platform_dp_05"
android:layout_marginTop=
"8dp"
android:layout_marginBottom=
"8dp"
android:background=
"@color/im_color_EBEBEB"
android:visibility=
"gone"
/>
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/example"
...
...
@@ -64,7 +66,8 @@
android:textColor=
"@color/im_color_242424"
android:textSize=
"@dimen/platform_dp_14"
android:visibility=
"gone"
tools:text=
"例:大学毕业后不知道该找什么工作,去年七月当过一次超市导购员,每天都要给顾客推荐这推荐那,感觉这不是我了,一想到上班后每天过着自己都排斥的日子我就越不敢继续找工作,就好像工作剥夺了我什么东西是的。"
/>
tools:text=
"例:大学毕业后不知道该找什么工作,去年七月当过一次超市导购员,每天都要给顾客推荐这推荐那,感觉这不是我了,一想到上班后每天过着自己都排斥的日子我就越不敢继续找工作,就好像工作剥夺了我什么东西是的。"
tools:visibility=
"visible"
/>
</LinearLayout>
...
...
m-im/src/main/res/layout/item_left_more_check_layout.xml
View file @
971ddcf9
...
...
@@ -31,12 +31,15 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/im_custom_message_round_white_6dp_bg"
android:padding=
"
12
dp"
>
android:padding=
"
8
dp"
>
<TextView
android:id=
"@+id/more_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:layout_marginLeft=
"4dp"
android:layout_marginRight=
"4dp"
android:textColor=
"@color/im_color_242424"
android:textSize=
"@dimen/im_text_size_17"
app:layout_constraintLeft_toLeftOf=
"parent"
...
...
@@ -57,6 +60,8 @@
tools:visibility=
"visible"
/>
<TextView
android:layout_marginBottom=
"4dp"
android:layout_marginRight=
"4dp"
android:id=
"@+id/tv_more_define"
android:layout_width=
"110dp"
android:layout_height=
"wrap_content"
...
...
m-im/src/main/res/layout/item_left_one_check_layout.xml
View file @
971ddcf9
...
...
@@ -31,9 +31,12 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/im_custom_message_round_white_6dp_bg"
android:padding=
"
12
dp"
>
android:padding=
"
8
dp"
>
<TextView
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"4dp"
android:layout_marginLeft=
"4dp"
android:id=
"@+id/multiple_choice_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
m-im/src/main/res/layout/item_right_text_layout.xml
View file @
971ddcf9
...
...
@@ -53,7 +53,7 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintRight_toLeftOf=
"@id/cv_header"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"你好,为了更好的。"
/>
tools:text=
"你好,为了更好的。
你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。
"
/>
</LinearLayout>
...
...
m-im/src/main/res/layout/left_one_check_layout_item.xml
View file @
971ddcf9
...
...
@@ -4,13 +4,11 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_16"
android:layout_marginRight=
"@dimen/platform_dp_9"
android:layout_marginRight=
"4dp"
android:layout_marginLeft=
"4dp"
android:background=
"@drawable/im_background_18dp_e8f5fe"
android:gravity=
"center"
android:paddingLeft=
"@dimen/platform_dp_8"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingRight=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_8"
android:padding=
"@dimen/platform_dp_8"
android:text=
"婚姻家庭婚姻混"
android:textColor=
"@color/platform_color_1DA1F2"
>
...
...
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
View file @
971ddcf9
...
...
@@ -66,6 +66,7 @@
android:id=
"@+id/cl_input"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
@@ -101,85 +102,77 @@
android:textSize=
"17sp"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_to
LeftOf=
"@id/ll_send
"
app:layout_constraintRight_to
RightOf=
"parent
"
app:layout_constraintTop_toBottomOf=
"@id/tv_problem"
/>
<HorizontalScrollView
<LinearLayout
android:id=
"@+id/hsv_problem_tips"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:paddingRight=
"85dp"
android:layout_marginBottom=
"14dp"
android:background=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
android:paddingLeft=
"12dp"
android:orientation=
"horizontal"
app:layout_constraintHorizontal_weight=
"1"
app:layout_constraintTop_toBottomOf=
"@id/et_input_problem"
tools:visibility=
"visible"
>
<LinearLayout
<TextView
android:id=
"@+id/tv_cur_problem"
android:layout_width=
"wrap_content"
android:layout_height=
"28dp"
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingStart=
"8dp"
android:paddingTop=
"4dp"
android:paddingEnd=
"8dp"
android:paddingBottom=
"4dp"
android:text=
"当前问题"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_duration"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"28dp"
android:layout_marginStart=
"12dp"
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:text=
"持续时间"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_problem_impact"
android:layout_width=
"wrap_content"
android:layout_height=
"28dp"
android:layout_marginStart=
"12dp"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_cur_problem"
android:layout_width=
"wrap_content"
android:layout_height=
"28dp"
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingTop=
"4dp"
android:paddingBottom=
"4dp"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:text=
"当前问题"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_duration"
android:layout_width=
"wrap_content"
android:layout_height=
"28dp"
android:layout_marginStart=
"12dp"
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:text=
"持续时间"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/tv_problem_impact"
android:layout_width=
"wrap_content"
android:layout_height=
"28dp"
android:layout_marginStart=
"12dp"
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:text=
"问题影响"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
</LinearLayout>
</HorizontalScrollView>
android:background=
"@drawable/bg_shape_f8f8f8_r4"
android:drawableStart=
"@mipmap/ic_input_add"
android:drawablePadding=
"2dp"
android:gravity=
"center"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:text=
"问题影响"
android:textColor=
"@color/color_242424"
android:textSize=
"14sp"
/>
</LinearLayout>
<LinearLayout
android:layout_marginBottom=
"16dp"
android:id=
"@+id/ll_send"
android:layout_width=
"86dp"
android:layout_height=
"0dp"
app:layout_constraintVertical_weight=
"1"
android:background=
"@color/white"
android:layout_height=
"28dp"
android:gravity=
"center|bottom"
android:paddingBottom=
"12dp"
app:layout_constraintBottom_toBottomOf=
"@id/et_input_problem"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/et_input_problem"
>
app:layout_constraintTop_toBottomOf=
"@id/et_input_problem"
app:layout_constraintVertical_weight=
"1"
>
<TextView
android:id=
"@+id/tv_send"
...
...
@@ -189,7 +182,7 @@
android:gravity=
"center"
android:text=
"发送"
android:textColor=
"@color/white"
android:textSize=
"15sp"
/>
android:textSize=
"15sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
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