Commit 971ddcf9 by 刘鹏

feat : UI优化

parent 5bfd50f8
......@@ -252,7 +252,7 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
addType71Request(et_input_problem.text.toString(), "")
}
tv_finish.visibility = View.VISIBLE
mackType2(lastAnswer)
mackType2(lastAnswer, "")
setFirstAndLatQuestion("我们根据您的情况安排了一位高级咨询顾问,帮助您匹配最合适的咨询服务,点击按钮现在去沟通~")
//滑动到底部
......@@ -536,16 +536,12 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
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!!,
......
......@@ -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:
//右侧文字
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);
......
......@@ -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;
......
......@@ -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>
......
......@@ -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="12dp">
android:padding="8dp">
<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"
......
......@@ -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="12dp">
android:padding="8dp">
<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"
......
......@@ -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>
......
......@@ -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">
......
......@@ -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,26 +102,20 @@
android:textSize="17sp"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/ll_send"
app:layout_constraintRight_toRightOf="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
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_cur_problem"
android:layout_width="wrap_content"
......@@ -129,10 +124,10 @@
android:drawableStart="@mipmap/ic_input_add"
android:drawablePadding="2dp"
android:gravity="center"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="8dp"
android:paddingTop="4dp"
android:paddingEnd="8dp"
android:paddingBottom="4dp"
android:text="当前问题"
android:textColor="@color/color_242424"
android:textSize="14sp" />
......@@ -167,19 +162,17 @@
android:textColor="@color/color_242424"
android:textSize="14sp" />
</LinearLayout>
</HorizontalScrollView>
<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>
......
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