Commit 5d3f7619 by YKai

feat:自定义跳转倾诉列表云信消息

parent 83595157
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
public class CustomAttachLingXiJumpConfideList extends CustomAttachment{
public CustomAttachLingXiJumpConfideList() {
super(CustomAttachmentType.TYPE_LINGXI_JUMP_CONFIDE_LIST);
}
@Override
protected void parseData(JSONObject data) {
}
@Override
protected JSONObject packData() {
return new JSONObject();
}
}
......@@ -137,16 +137,19 @@ public class CustomAttachParser implements MsgAttachmentParser {
attachment = new CustomAttachmentFilter();
break;
case CustomAttachmentType.TYPE_CONFIRM_ORDER://38 确认订单消息
attachment=new CustomAttachmentConfirmOrder();
attachment = new CustomAttachmentConfirmOrder();
break;
case CustomAttachmentType.TYPE_ORDER_ALREADY_DONE://39 订单已完成
attachment=new CustomAttachmentOrderAlreadyDone();
attachment = new CustomAttachmentOrderAlreadyDone();
break;
case CustomAttachmentType.TYPE_LINGXI_WHICH_QUESTION://灵犀2.0-您想要咨询下列哪些问题
attachment=new CustomAttachLingxiWhichQuestion();
attachment = new CustomAttachLingxiWhichQuestion();
break;
case CustomAttachmentType.TYPE_LINGXI_ANSWER_QUESTION://灵犀2.0-回答问题
attachment=new CustomAttachLingxiAnswerQuestion();
attachment = new CustomAttachLingxiAnswerQuestion();
break;
case CustomAttachmentType.TYPE_LINGXI_JUMP_CONFIDE_LIST: // 跳转倾诉列表
attachment = new CustomAttachLingXiJumpConfideList();
break;
default:
attachment = new DefaultCustomAttachment();
......
......@@ -47,6 +47,7 @@ public interface CustomAttachmentType {
int TYPE_LINGXI_WHICH_QUESTION=55;//试卷消息
int TYPE_LINGXI_ANSWER_QUESTION=56;//回答消息
int TYPE_LINGXI_TEST_QUESTION=60;//测评结果
int TYPE_LINGXI_JUMP_CONFIDE_LIST = 73; // 跳转倾诉列表
}
package com.yidianling.im.session.viewholder;
import android.widget.TextView;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.router.IYDLRouterConstant;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachLingXiJumpConfideList;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
public class MsgViewHolderLingXiJumpConfideList extends MsgViewHolderBase {
private TextView tvJump;
CustomAttachLingXiJumpConfideList customAttachLingXiJumpConfideList;
public MsgViewHolderLingXiJumpConfideList(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_nim_lingxi_jump_confide_list;
}
@Override
protected void inflateContentView() {
tvJump = findViewById(R.id.tv_jump_confide_list);
}
@Override
protected void bindContentView() {
customAttachLingXiJumpConfideList = ((CustomAttachLingXiJumpConfideList) message.getAttachment());
tvJump.setOnClickListener(view -> {
YDLRouterManager.Companion.router(IYDLRouterConstant.ROUTER_CONFIDE_HOME);
});
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="256dp"
android:layout_height="wrap_content"
android:background="@drawable/im_custom_message_round_white_6dp_bg"
android:paddingLeft="@dimen/platform_dp_12"
android:paddingTop="@dimen/platform_dp_15"
android:paddingRight="@dimen/platform_dp_12"
android:paddingBottom="@dimen/platform_dp_12"
tools:ignore="MissingConstraints">
<ImageView
android:id="@+id/iv_jump_confide"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginTop="@dimen/platform_dp_1"
android:src="@mipmap/im_ic_jump_confide"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_12"
android:includeFontPadding="false"
android:text="壹点灵倾诉服务"
android:textColor="@color/platform_color_242424"
android:textSize="17sp"
app:layout_constraintStart_toEndOf="@id/iv_jump_confide" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_4"
android:includeFontPadding="false"
android:text="倾听您的声音"
android:textSize="@dimen/im_sp_14"
app:layout_constraintStart_toStartOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<View
android:id="@+id/v_line"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_1"
android:layout_marginTop="@dimen/platform_dp_11"
android:background="@color/platform_color_EBEBEB"
app:layout_constraintTop_toBottomOf="@id/tv_content" />
<TextView
android:id="@+id/tv_jump_confide_list"
android:layout_width="90dp"
android:layout_height="32dp"
android:layout_marginTop="@dimen/platform_dp_12"
android:background="@drawable/im_custom_159cef_22bfff"
android:gravity="center"
android:text="立即前往"
android:textColor="@color/white"
android:textSize="@dimen/im_text_size_15"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/v_line" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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