Commit 971ddcf9 by 刘鹏

feat : UI优化

parent 5bfd50f8
...@@ -252,7 +252,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -252,7 +252,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
addType71Request(et_input_problem.text.toString(), "") addType71Request(et_input_problem.text.toString(), "")
} }
tv_finish.visibility = View.VISIBLE tv_finish.visibility = View.VISIBLE
mackType2(lastAnswer) mackType2(lastAnswer, "")
setFirstAndLatQuestion("我们根据您的情况安排了一位高级咨询顾问,帮助您匹配最合适的咨询服务,点击按钮现在去沟通~") setFirstAndLatQuestion("我们根据您的情况安排了一位高级咨询顾问,帮助您匹配最合适的咨询服务,点击按钮现在去沟通~")
//滑动到底部 //滑动到底部
...@@ -531,21 +531,17 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -531,21 +531,17 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
private fun sendAnswerText(list: List<OptionsBean>, otherInput: String) { private fun sendAnswerText(list: List<OptionsBean>, otherInput: String) {
var answerStr = "" var answerStr = ""
list.forEach { list.forEach {
answerStr = "$answerStr#${it.name} " answerStr = "$answerStr#${it.name} "
} }
if ("#其他" == answerStr) { if ("#其他" == answerStr) {
answerStr = "其他" answerStr = "其他"
} else { } else {
if (otherInput.isNotEmpty()) { if (!answerStr.contains("其他") || otherInput.isEmpty()) {
answerStr = "$answerStr \n \n $otherInput"
}
if (!answerStr.contains("其他")||otherInput.isEmpty()) {
answerStr = answerStr.substring(1).replace("#", "、") answerStr = answerStr.substring(1).replace("#", "、")
} }
} }
mackType2(answerStr.trim()) mackType2(answerStr.trim(), otherInput)
//刷新已回答问题,将多选设置成不可再选 //刷新已回答问题,将多选设置成不可再选
mData.forEachIndexed { index, _ -> mData.forEachIndexed { index, _ ->
...@@ -561,9 +557,10 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -561,9 +557,10 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
* *
* @param answerStr 用户展示的文字回复 * @param answerStr 用户展示的文字回复
* */ * */
private fun mackType2(answerStr: String) { private fun mackType2(answerStr: String, other: String) {
val questionMultiItem = QuestionMultiItem() val questionMultiItem = QuestionMultiItem()
questionMultiItem.type2Text = answerStr questionMultiItem.type2Text = answerStr
questionMultiItem.type2Other = other
questionMultiItem.viewType = 2 questionMultiItem.viewType = 2
mData.add(questionMultiItem) mData.add(questionMultiItem)
mQuestionAdapter.notifyDataSetChanged() mQuestionAdapter.notifyDataSetChanged()
...@@ -742,6 +739,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -742,6 +739,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
.subscribe() .subscribe()
}, 100L) }, 100L)
Handler().postDelayed({ Handler().postDelayed({
IMChatUtil.startChatSessionByCms( IMChatUtil.startChatSessionByCms(
toUid!!, toUid!!,
......
...@@ -3,6 +3,7 @@ package com.yidianling.uikit.business.session.view.question; ...@@ -3,6 +3,7 @@ package com.yidianling.uikit.business.session.view.question;
import android.graphics.Color; import android.graphics.Color;
import android.text.SpannableString; import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
...@@ -18,6 +19,7 @@ import com.chad.library.adapter.base.BaseViewHolder; ...@@ -18,6 +19,7 @@ import com.chad.library.adapter.base.BaseViewHolder;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.yidianling.avchatkit.AVChatKit; import com.yidianling.avchatkit.AVChatKit;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.helper.SpanUtils;
import com.yidianling.im.router.ImIn; import com.yidianling.im.router.ImIn;
import com.yidianling.uikit.custom.http.response.question.OptionsBean; import com.yidianling.uikit.custom.http.response.question.OptionsBean;
...@@ -60,7 +62,11 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem ...@@ -60,7 +62,11 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
break; break;
case 2: 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); ImageView iv_header = helper.getView(R.id.iv_header);
String header = ImIn.INSTANCE.getUserInfo().getHead(); String header = ImIn.INSTANCE.getUserInfo().getHead();
if (header != null) { if (header != null) {
...@@ -109,7 +115,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem ...@@ -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); GridLayoutManager gridLayoutManager = new GridLayoutManager(AVChatKit.getContext(), oneMaxSize > mTextMaxSize ? 1 : 2);
OneRecycle.setLayoutManager(gridLayoutManager); OneRecycle.setLayoutManager(gridLayoutManager);
...@@ -142,13 +148,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem ...@@ -142,13 +148,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
View type5_line = helper.getView(R.id.type5_line); View type5_line = helper.getView(R.id.type5_line);
TextView example = helper.getView(R.id.example); 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) { if (item.type5Open) {
type5_line.setVisibility(View.VISIBLE); type5_line.setVisibility(View.VISIBLE);
example.setVisibility(View.VISIBLE); example.setVisibility(View.VISIBLE);
...@@ -166,6 +166,19 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem ...@@ -166,6 +166,19 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
helper.addOnClickListener(R.id.tv_notes); 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 ...@@ -271,7 +284,7 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
oneMaxSize = option.name.length(); 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); GridLayoutManager gridLayoutManager = new GridLayoutManager(AVChatKit.getContext(), oneMaxSize > mTextMaxSize ? 1 : 2);
OneRecycle.setLayoutManager(gridLayoutManager); OneRecycle.setLayoutManager(gridLayoutManager);
......
...@@ -14,6 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity { ...@@ -14,6 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity {
public String type1Text; public String type1Text;
public String type2Text; public String type2Text;
public String type2Other;
/***type 3 单选 type 4 多选 type 6 */ /***type 3 单选 type 4 多选 type 6 */
public QuestionsBean questionsBean; public QuestionsBean questionsBean;
public boolean type3CanClick = true; public boolean type3CanClick = true;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
app:layout_constraintHorizontal_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
...@@ -26,6 +25,7 @@ ...@@ -26,6 +25,7 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="12dp" android:padding="12dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/iv_header" app:layout_constraintLeft_toRightOf="@id/iv_header"
app:layout_constraintRight_toLeftOf="@id/iv_right" app:layout_constraintRight_toLeftOf="@id/iv_right"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
...@@ -51,11 +51,13 @@ ...@@ -51,11 +51,13 @@
<View <View
android:id="@+id/type5_line" android:id="@+id/type5_line"
android:layout_width="239dp" android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_05" android:layout_height="@dimen/platform_dp_05"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@color/im_color_EBEBEB" android:background="@color/im_color_EBEBEB"
android:visibility="gone" /> android:visibility="gone"
tools:visibility="visible" />
<TextView <TextView
android:id="@+id/example" android:id="@+id/example"
...@@ -64,7 +66,8 @@ ...@@ -64,7 +66,8 @@
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="@dimen/platform_dp_14" android:textSize="@dimen/platform_dp_14"
android:visibility="gone" android:visibility="gone"
tools:text="例:大学毕业后不知道该找什么工作,去年七月当过一次超市导购员,每天都要给顾客推荐这推荐那,感觉这不是我了,一想到上班后每天过着自己都排斥的日子我就越不敢继续找工作,就好像工作剥夺了我什么东西是的。" /> tools:text="例:大学毕业后不知道该找什么工作,去年七月当过一次超市导购员,每天都要给顾客推荐这推荐那,感觉这不是我了,一想到上班后每天过着自己都排斥的日子我就越不敢继续找工作,就好像工作剥夺了我什么东西是的。"
tools:visibility="visible" />
</LinearLayout> </LinearLayout>
......
...@@ -31,12 +31,15 @@ ...@@ -31,12 +31,15 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/im_custom_message_round_white_6dp_bg" android:background="@drawable/im_custom_message_round_white_6dp_bg"
android:padding="12dp"> android:padding="8dp">
<TextView <TextView
android:id="@+id/more_title" android:id="@+id/more_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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:textColor="@color/im_color_242424"
android:textSize="@dimen/im_text_size_17" android:textSize="@dimen/im_text_size_17"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
...@@ -57,6 +60,8 @@ ...@@ -57,6 +60,8 @@
tools:visibility="visible" /> tools:visibility="visible" />
<TextView <TextView
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:id="@+id/tv_more_define" android:id="@+id/tv_more_define"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/im_custom_message_round_white_6dp_bg" android:background="@drawable/im_custom_message_round_white_6dp_bg"
android:padding="12dp"> android:padding="8dp">
<TextView <TextView
android:layout_marginTop="4dp"
android:layout_marginRight="4dp"
android:layout_marginLeft="4dp"
android:id="@+id/multiple_choice_title" android:id="@+id/multiple_choice_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toLeftOf="@id/cv_header" app:layout_constraintRight_toLeftOf="@id/cv_header"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="你好,为了更好的。" /> tools:text="你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。你好,为了更好的。" />
</LinearLayout> </LinearLayout>
......
...@@ -4,13 +4,11 @@ ...@@ -4,13 +4,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_16" 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:background="@drawable/im_background_18dp_e8f5fe"
android:gravity="center" android:gravity="center"
android:paddingLeft="@dimen/platform_dp_8" android:padding="@dimen/platform_dp_8"
android:paddingTop="@dimen/platform_dp_8"
android:paddingRight="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8"
android:text="婚姻家庭婚姻混" android:text="婚姻家庭婚姻混"
android:textColor="@color/platform_color_1DA1F2"> android:textColor="@color/platform_color_1DA1F2">
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
android:id="@+id/cl_input" android:id="@+id/cl_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
...@@ -101,85 +102,77 @@ ...@@ -101,85 +102,77 @@
android:textSize="17sp" android:textSize="17sp"
app:layout_constraintHorizontal_weight="1" app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/ll_send" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_problem" /> app:layout_constraintTop_toBottomOf="@id/tv_problem" />
<HorizontalScrollView
<LinearLayout
android:id="@+id/hsv_problem_tips" android:id="@+id/hsv_problem_tips"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="85dp" android:paddingLeft="12dp"
android:layout_marginBottom="14dp" android:orientation="horizontal"
android:background="@color/white" app:layout_constraintHorizontal_weight="1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_input_problem" app:layout_constraintTop_toBottomOf="@id/et_input_problem"
tools:visibility="visible"> 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_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:layout_marginStart="12dp"
android:orientation="horizontal"> android:background="@drawable/bg_shape_f8f8f8_r4"
android:drawableStart="@mipmap/ic_input_add"
<TextView android:drawablePadding="2dp"
android:id="@+id/tv_cur_problem" android:gravity="center"
android:layout_width="wrap_content" android:paddingStart="8dp"
android:layout_height="28dp" android:paddingEnd="8dp"
android:background="@drawable/bg_shape_f8f8f8_r4" android:text="问题影响"
android:drawableStart="@mipmap/ic_input_add" android:textColor="@color/color_242424"
android:drawablePadding="2dp" android:textSize="14sp" />
android:gravity="center" </LinearLayout>
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>
<LinearLayout <LinearLayout
android:layout_marginBottom="16dp"
android:id="@+id/ll_send" android:id="@+id/ll_send"
android:layout_width="86dp" android:layout_width="86dp"
android:layout_height="0dp" android:layout_height="28dp"
app:layout_constraintVertical_weight="1"
android:background="@color/white"
android:gravity="center|bottom" android:gravity="center|bottom"
android:paddingBottom="12dp" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toBottomOf="@id/et_input_problem"
app:layout_constraintEnd_toEndOf="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 <TextView
android:id="@+id/tv_send" android:id="@+id/tv_send"
...@@ -189,7 +182,7 @@ ...@@ -189,7 +182,7 @@
android:gravity="center" android:gravity="center"
android:text="发送" android:text="发送"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="15sp"/> android:textSize="15sp" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment