Quellcode durchsuchen

增加新版公告流程和样式

Pq vor 1 Woche
Ursprung
Commit
16ef336744
28 geänderte Dateien mit 910 neuen und 135 gelöschten Zeilen
  1. 3 5
      BaseLibrary/src/main/res/drawable/bg_orange_line_45_shape.xml
  2. 2 0
      BaseLibrary/src/main/res/values/colors.xml
  3. 5 0
      chatModule/src/main/AndroidManifest.xml
  4. 0 1
      chatModule/src/main/java/com/cooleshow/chatmodule/adapter/NoticeListAdapter.java
  5. 5 4
      chatModule/src/main/java/com/cooleshow/chatmodule/adapter/NoticePopuListAdapter.java
  6. 9 0
      chatModule/src/main/java/com/cooleshow/chatmodule/api/IMApi.java
  7. 25 0
      chatModule/src/main/java/com/cooleshow/chatmodule/constants/GroupNoticeMenu.java
  8. 1 0
      chatModule/src/main/java/com/cooleshow/chatmodule/constants/TCChatRouterPath.java
  9. 1 0
      chatModule/src/main/java/com/cooleshow/chatmodule/constants/TCMessageConstants.java
  10. 5 0
      chatModule/src/main/java/com/cooleshow/chatmodule/contract/NoticeContract.java
  11. 98 0
      chatModule/src/main/java/com/cooleshow/chatmodule/message/bean/TUIChatGroupNoticeMessageBean.java
  12. 55 0
      chatModule/src/main/java/com/cooleshow/chatmodule/message/holder/TUIChatGroupNoticeMessageHolder.java
  13. 18 0
      chatModule/src/main/java/com/cooleshow/chatmodule/presenter/NoticePresenter.java
  14. 31 21
      chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeActivity.java
  15. 222 0
      chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeDetailActivity.java
  16. 73 0
      chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeEditActivity.java
  17. 4 0
      chatModule/src/main/java/com/cooleshow/chatmodule/utils/helper/IMThemManager.java
  18. BIN
      chatModule/src/main/res/drawable-xhdpi/tc_icon_chat_group_notice_tag.png
  19. BIN
      chatModule/src/main/res/drawable-xhdpi/tc_icon_group_notice_content_tag.png
  20. BIN
      chatModule/src/main/res/drawable-xhdpi/tc_icon_group_notice_title_tag.png
  21. BIN
      chatModule/src/main/res/drawable-xxhdpi/tc_icon_chat_group_notice_tag.png
  22. BIN
      chatModule/src/main/res/drawable-xxhdpi/tc_icon_group_notice_content_tag.png
  23. BIN
      chatModule/src/main/res/drawable-xxhdpi/tc_icon_group_notice_title_tag.png
  24. 155 0
      chatModule/src/main/res/layout/tc_activity_notice_detail_layout.xml
  25. 59 44
      chatModule/src/main/res/layout/tc_activity_notice_edit.xml
  26. 64 0
      chatModule/src/main/res/layout/tc_chat_group_notice_layout.xml
  27. 51 50
      chatModule/src/main/res/layout/tc_notice_list_item.xml
  28. 24 10
      chatModule/src/main/res/layout/tc_notice_on_popu.xml

+ 3 - 5
BaseLibrary/src/main/res/drawable/bg_orange_line_45_shape.xml

@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-
-       android:shape="rectangle">
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
     <stroke
         android:width="@dimen/dp_1"
-        android:color="#FE2451"/>
-    <corners android:radius="@dimen/dp_45"/>
+        android:color="@color/color_ff5151"/>
+    <corners android:radius="@dimen/dp_10"/>
 </shape>

+ 2 - 0
BaseLibrary/src/main/res/values/colors.xml

@@ -214,4 +214,6 @@
     <color name="color_fada9b">#fada9b</color>
     <color name="color_1bb99b">#1BB99B</color>
     <color name="color_f44541">#F44541</color>
+    <color name="color_19b396">#19B396</color>
+    <color name="color_ff5151">#FF5151</color>
 </resources>

+ 5 - 0
chatModule/src/main/AndroidManifest.xml

@@ -23,6 +23,11 @@
             android:screenOrientation="portrait" />
 
         <activity
+            android:name=".ui.NoticeDetailActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden|fontScale|smallestScreenSize|screenLayout"
+            android:screenOrientation="portrait" />
+
+        <activity
             android:name=".ui.ImAppealActivity"
             android:configChanges="orientation|screenSize|keyboardHidden|fontScale|smallestScreenSize|screenLayout"
             android:windowSoftInputMode="adjustPan"

+ 0 - 1
chatModule/src/main/java/com/cooleshow/chatmodule/adapter/NoticeListAdapter.java

@@ -42,7 +42,6 @@ public class NoticeListAdapter extends BaseQuickAdapter<GroupNoticeBean.RowsBean
         ImageView ivSetting = helper.getView(R.id.iv_setting);
         TextView tvTitle = helper.getView(R.id.tv_title);
         TextView tvContent = helper.getView(R.id.tv_content);
-        TextView tvRead = helper.getView(R.id.tv_read);
         GlideUtils.INSTANCE.loadImage(getContext(), bean.avatar, ivPortrait, R.drawable.tc_icon_teacher_default_head);
         tvName.setText(bean.username);
         tvTime.setText(DateUtil.dateFormatDefault(TextUtils.isEmpty(bean.updateTime) ? bean.createTime : bean.updateTime));

+ 5 - 4
chatModule/src/main/java/com/cooleshow/chatmodule/adapter/NoticePopuListAdapter.java

@@ -6,6 +6,7 @@ import android.widget.TextView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
 import com.cooleshow.chatmodule.R;
+import com.cooleshow.chatmodule.constants.GroupNoticeMenu;
 
 import java.util.List;
 
@@ -15,17 +16,17 @@ import java.util.List;
  * @author Ryan
  * 类说明:
  */
-public class NoticePopuListAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
+public class NoticePopuListAdapter extends BaseQuickAdapter<GroupNoticeMenu, BaseViewHolder> {
 
-    public NoticePopuListAdapter(List<String> data) {
+    public NoticePopuListAdapter(List<GroupNoticeMenu> data) {
         super(R.layout.tc_notice_popu_list_item, data);
     }
 
 
     @Override
-    protected void convert(BaseViewHolder helper, String bean) {
+    protected void convert(BaseViewHolder helper, GroupNoticeMenu bean) {
         TextView tvTitle=helper.getView(R.id.tv_title);
-        tvTitle.setText(bean);
+        tvTitle.setText(bean.getDes());
         int pos = helper.getLayoutPosition();
         if (pos == getData().size() - 1) {
             helper.getView(R.id.view_line).setVisibility(View.GONE);

+ 9 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/api/IMApi.java

@@ -21,6 +21,7 @@ import retrofit2.http.FormUrlEncoded;
 import retrofit2.http.GET;
 import retrofit2.http.POST;
 import retrofit2.http.Path;
+import retrofit2.http.Query;
 
 import static com.cooleshow.base.common.BaseConstant.TEACHER_GROUP;
 
@@ -93,6 +94,14 @@ public interface IMApi {
     Observable<BaseResponse<String>> noticeDel(@Field("id") String id,@Path("group_name")String group_name);
 
     /**
+     * 群公告详情
+     *
+     * @return
+     */
+    @GET("{group_name}" + "/imGroupNotice/get/{id}")
+    Observable<BaseResponse<GroupNoticeBean.RowsBean>> noticeDetail(@Path("group_name") String group_name,@Path("id") String id);
+
+    /**
      * 新增群公告
      *
      * @param body

+ 25 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/constants/GroupNoticeMenu.java

@@ -0,0 +1,25 @@
+package com.cooleshow.chatmodule.constants;
+
+/**
+ * Author by pq, Date on 2024/8/30.
+ */
+public enum GroupNoticeMenu {
+    EDIT_NOTICE("编辑公告"),
+    SET_TOP_NOTICE("设为置顶"),
+    CANCEL_TOP_NOTICE("取消置顶"),
+    DEL_NOTICE("删除公告");
+
+    private String des;
+
+    public String getDes() {
+        return des;
+    }
+
+    public void setDes(String des) {
+        this.des = des;
+    }
+
+    GroupNoticeMenu(String value) {
+        this.des = value;
+    }
+}

+ 1 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/constants/TCChatRouterPath.java

@@ -16,4 +16,5 @@ public class TCChatRouterPath {
     public final static String CHAT_GROUP_MEMBER = "/tc/activity/GroupMemberActivity";
     public final static String CHAT_GROUP_JOIN_APPLY = "/tc/activity/JoinGroupApplyActivity";
     public final static String CHAT_SELECT_CONTACT = "/tc/activity/SelectContactActivity";
+    public final static String CHAT_GROUP_NOTICE_DETAIL = "/tc/activity/NoticeDetailActivity";
 }

+ 1 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/constants/TCMessageConstants.java

@@ -6,4 +6,5 @@ package com.cooleshow.chatmodule.constants;
 public class TCMessageConstants {
     public static final String TC_CHAT_SHARE_LIVE_MSG_TAG="TC_CHATSHARE_LIVE";//分享直播消息标识
     public static final String TC_CHAT_SHARE_MUSIC_MSG_TAG="TC_CHATSHARE_MUSIC";//分享曲目消息标识
+    public static final String TC_CHAT_GROUP_NOTICE_MSG_TAG="TC_GROUP_NOTICE";//群公告
 }

+ 5 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/contract/NoticeContract.java

@@ -18,6 +18,11 @@ public interface NoticeContract {
         void updateGroupNoticeSuccess();
 
         void delGroupNoticeSuccess();
+
+        void queryGroupNoticeDetailSuccess(GroupNoticeBean.RowsBean data);
+
+        void queryGroupNoticeDetailError();
+
     }
 
     interface Presenter {

+ 98 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/message/bean/TUIChatGroupNoticeMessageBean.java

@@ -0,0 +1,98 @@
+package com.cooleshow.chatmodule.message.bean;
+
+import com.tencent.imsdk.v2.V2TIMMessage;
+import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
+
+import org.json.JSONObject;
+
+/**
+ * Author by pq, Date on 2023/8/9.
+ */
+public class TUIChatGroupNoticeMessageBean extends TUIMessageBean {
+    private String msgContent;
+    private String msgTitle;
+    private String msgId;
+    private String teacherAvatar;
+    private String teacherName;
+
+    private String businessID;
+
+    public String getBusinessID() {
+        return businessID;
+    }
+
+    public void setBusinessID(String businessID) {
+        this.businessID = businessID;
+    }
+
+    public String getMsgContent() {
+        return msgContent;
+    }
+
+    public void setMsgContent(String msgContent) {
+        this.msgContent = msgContent;
+    }
+
+    public String getMsgTitle() {
+        return msgTitle;
+    }
+
+    public void setMsgTitle(String msgTitle) {
+        this.msgTitle = msgTitle;
+    }
+
+    public String getMsgId() {
+        return msgId;
+    }
+
+    public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+
+    public String getTeacherAvatar() {
+        return teacherAvatar;
+    }
+
+    public void setTeacherAvatar(String teacherAvatar) {
+        this.teacherAvatar = teacherAvatar;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    @Override
+    public String onGetDisplayString() {
+        return "[群公告]";
+    }
+
+    @Override
+    public void onProcessMessage(V2TIMMessage v2TIMMessage) {
+        String data = new String(v2TIMMessage.getCustomElem().getData());
+        try {
+            JSONObject jsonObject = new JSONObject(data);
+            if (jsonObject.has("msgContent")) {
+                msgContent = jsonObject.optString("msgContent");
+            }
+            if (jsonObject.has("msgTitle")) {
+                msgTitle = jsonObject.optString("msgTitle");
+            }
+            if (jsonObject.has("msgId")) {
+                msgId = jsonObject.optString("msgId");
+            }
+            if (jsonObject.has("teacherAvatar")) {
+                teacherAvatar = jsonObject.optString("teacherAvatar");
+            }
+            if (jsonObject.has("teacherName")) {
+                teacherName = jsonObject.optString("teacherName");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+}

+ 55 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/message/holder/TUIChatGroupNoticeMessageHolder.java

@@ -0,0 +1,55 @@
+package com.cooleshow.chatmodule.message.holder;
+
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.cooleshow.chatmodule.R;
+import com.cooleshow.chatmodule.constants.TCChatRouterPath;
+import com.cooleshow.chatmodule.message.bean.TUIChatGroupNoticeMessageBean;
+import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
+import com.tencent.qcloud.tuikit.timcommon.classicui.widget.message.MessageContentHolder;
+
+/**
+ * Author by pq, Date on 2023/8/9.
+ */
+public class TUIChatGroupNoticeMessageHolder extends MessageContentHolder {
+    public TUIChatGroupNoticeMessageHolder(View itemView) {
+        super(itemView);
+    }
+
+    @Override
+    public int getVariableLayout() {
+        return R.layout.tc_chat_group_notice_layout;
+    }
+
+    @Override
+    public void layoutVariableViews(TUIMessageBean msg, int position) {
+        if (msg.getMessageReactBean() == null || msg.getMessageReactBean().getReactSize() <= 0) {
+            msgArea.setBackground(null);
+            msgArea.setPadding(0, 0, 0, 0);
+        }
+        if (msg instanceof TUIChatGroupNoticeMessageBean) {
+            TUIChatGroupNoticeMessageBean noticeMessageBean = (TUIChatGroupNoticeMessageBean) msg;
+            TextView tv_title = itemView.findViewById(R.id.tv_title);
+            TextView tv_content = itemView.findViewById(R.id.tv_content);
+
+            tv_title.setText(noticeMessageBean.getMsgTitle());
+            tv_content.setText(noticeMessageBean.getMsgContent());
+
+            msgContentFrame.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (noticeMessageBean != null && !TextUtils.isEmpty(noticeMessageBean.getMsgId())) {
+                        String groupId = noticeMessageBean.getGroupId();
+                        ARouter.getInstance().build(TCChatRouterPath.CHAT_GROUP_NOTICE_DETAIL)
+                                .withString("targetId", groupId)
+                                .withString("targetMsgId", noticeMessageBean.getMsgId())
+                                .navigation();
+                    }
+                }
+            });
+        }
+    }
+}

+ 18 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/presenter/NoticePresenter.java

@@ -98,4 +98,22 @@ public class NoticePresenter extends BasePresenter<NoticeContract.NoticeView> im
         });
     }
 
+    public void queryDetail(String id) {
+        addSubscribe(create(IMApi.class).noticeDetail(BaseConstant.CLIENT_API_GROUP_NAME,id), new BaseObserver<GroupNoticeBean.RowsBean>(getView()) {
+            @Override
+            protected void onSuccess(GroupNoticeBean.RowsBean data) {
+                if (getView() != null) {
+                    getView().queryGroupNoticeDetailSuccess(data);
+                }
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().queryGroupNoticeDetailError();
+                }
+            }
+        });
+    }
 }

+ 31 - 21
chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeActivity.java

@@ -11,7 +11,6 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
 import com.cooleshow.base.common.BaseApplication;
 import com.cooleshow.base.constanst.Constants;
-import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.utils.LOG;
 import com.cooleshow.base.utils.PopupUtil;
@@ -22,12 +21,11 @@ import com.cooleshow.chatmodule.R;
 import com.cooleshow.chatmodule.adapter.NoticeListAdapter;
 import com.cooleshow.chatmodule.adapter.NoticePopuListAdapter;
 import com.cooleshow.chatmodule.bean.GroupNoticeBean;
+import com.cooleshow.chatmodule.constants.GroupNoticeMenu;
 import com.cooleshow.chatmodule.constants.TCChatRouterPath;
 import com.cooleshow.chatmodule.contract.NoticeContract;
-import com.cooleshow.chatmodule.databinding.TcActivityImAppealBinding;
 import com.cooleshow.chatmodule.databinding.TcActivityNoticeBinding;
 import com.cooleshow.chatmodule.presenter.NoticePresenter;
-import com.cooleshow.chatmodule.utils.helper.IMThemManager;
 import com.scwang.smart.refresh.footer.ClassicsFooter;
 import com.scwang.smart.refresh.layout.api.RefreshLayout;
 import com.scwang.smart.refresh.layout.listener.OnRefreshListener;
@@ -117,15 +115,15 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
         mAdapter.setmSettingClickListener(new NoticeListAdapter.SettingClickListener() {
             @Override
             public void onSettingClick(View v, GroupNoticeBean.RowsBean bean) {
-                List<String> popuList = new ArrayList<>();
-                popuList.clear();
-                popuList.add("编辑公告");
+                List<GroupNoticeMenu> popuList = new ArrayList<>();
+
+                popuList.add(GroupNoticeMenu.EDIT_NOTICE);
                 if (bean.topFlag) {
-                    popuList.add("取消置顶");
+                    popuList.add(GroupNoticeMenu.CANCEL_TOP_NOTICE);
                 } else {
-                    popuList.add("置顶");
+                    popuList.add(GroupNoticeMenu.SET_TOP_NOTICE);
                 }
-                popuList.add("删除");
+                popuList.add(GroupNoticeMenu.DEL_NOTICE);
                 initPopu(popuList, v, bean);
             }
         });
@@ -136,9 +134,9 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
         EmptyViewLayout emptyViewLayout = new EmptyViewLayout(this);
         Drawable conversationListEmptyDrawable = MessageProperties.getInstance().getConversationListEmptyDrawable();
         if (conversationListEmptyDrawable != null) {
-            emptyViewLayout.setContent(conversationListEmptyDrawable, "暂无群公告");
+            emptyViewLayout.setContent(conversationListEmptyDrawable, "暂无内容");
         } else {
-            emptyViewLayout.setContent(com.cooleshow.base.R.drawable.icon_empty_content, "暂无群公告");
+            emptyViewLayout.setContent(com.cooleshow.base.R.drawable.icon_empty_content, "暂无内容");
         }
         mAdapter.setEmptyView(emptyViewLayout);
     }
@@ -163,9 +161,9 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
         queryData();
     }
 
-    private void initPopu(List<String> popuList, View view, GroupNoticeBean.RowsBean bean) {
+    private void initPopu(List<GroupNoticeMenu> popuList, View view, GroupNoticeBean.RowsBean bean) {
         PopupUtil.showInDropWrapNObg(this, R.layout.tc_notice_on_popu, view,
-                SizeUtils.dp2px(20), SizeUtils.dp2px(20), (view1, popupWindow) -> {
+                -SizeUtils.dp2px(55), SizeUtils.dp2px(5), (view1, popupWindow) -> {
                     RecyclerView recyclerView = view1.findViewById(R.id.recyclerView);
                     LinearLayoutManager linearLayoutManager = new LinearLayoutManager(NoticeActivity.this);
                     recyclerView.setLayoutManager(linearLayoutManager);
@@ -174,7 +172,8 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
                     adapter.setOnItemClickListener(new OnItemClickListener() {
                         @Override
                         public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
-                            if (position == 0) {
+                            GroupNoticeMenu item = (GroupNoticeMenu) adapter.getItem(position);
+                            if (item == GroupNoticeMenu.EDIT_NOTICE) {
                                 ARouter.getInstance().build(TCChatRouterPath.CHAT_GROUP_NOTICE_EDIT)
                                         .withString("targetId", targetId)
                                         .withString("title", bean.title)
@@ -183,14 +182,15 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
                                         .withString("id", bean.id)
                                         .navigation();
                             }
-                            if (position == 1) {
-                                if (popuList.get(position).equals("置顶")) {
-                                    presenter.noticeUpdate(bean.id, targetId, bean.title, bean.content, true);
-                                } else {
-                                    presenter.noticeUpdate(bean.id, targetId, bean.title, bean.content, false);
-                                }
+                            if (item == GroupNoticeMenu.SET_TOP_NOTICE) {
+                                presenter.noticeUpdate(bean.id, targetId, bean.title, bean.content, true);
+                            }
+
+                            if (item == GroupNoticeMenu.CANCEL_TOP_NOTICE) {
+                                presenter.noticeUpdate(bean.id, targetId, bean.title, bean.content, false);
                             }
-                            if (position == 2) {
+
+                            if (item == GroupNoticeMenu.DEL_NOTICE) {
                                 presenter.noticeDel(String.valueOf(bean.id));
                             }
                             popupWindow.dismiss();
@@ -282,4 +282,14 @@ public class NoticeActivity extends BaseMVPActivity<TcActivityNoticeBinding, Not
         currentPage = 1;
         queryData();
     }
+
+    @Override
+    public void queryGroupNoticeDetailSuccess(GroupNoticeBean.RowsBean data) {
+
+    }
+
+    @Override
+    public void queryGroupNoticeDetailError() {
+
+    }
 }

+ 222 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeDetailActivity.java

@@ -0,0 +1,222 @@
+package com.cooleshow.chatmodule.ui;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.cooleshow.base.common.BaseApplication;
+import com.cooleshow.base.ui.activity.BaseMVPActivity;
+import com.cooleshow.base.utils.DateUtil;
+import com.cooleshow.base.utils.GlideImageLoaderUtils;
+import com.cooleshow.base.utils.PopupUtil;
+import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.chatmodule.R;
+import com.cooleshow.chatmodule.adapter.NoticePopuListAdapter;
+import com.cooleshow.chatmodule.bean.GroupNoticeBean;
+import com.cooleshow.chatmodule.constants.GroupNoticeMenu;
+import com.cooleshow.chatmodule.constants.TCChatRouterPath;
+import com.cooleshow.chatmodule.contract.NoticeContract;
+import com.cooleshow.chatmodule.databinding.TcActivityNoticeDetailLayoutBinding;
+import com.cooleshow.chatmodule.presenter.NoticePresenter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+/**
+ * 创建日期:2022/6/11 17:52
+ *
+ * @author Ryan
+ * 类说明:
+ */
+@Route(path = TCChatRouterPath.CHAT_GROUP_NOTICE_DETAIL)
+public class NoticeDetailActivity extends BaseMVPActivity<TcActivityNoticeDetailLayoutBinding, NoticePresenter> implements NoticeContract.NoticeView, View.OnClickListener {
+
+    private String targetMsgId = "";
+    private String targetGroupId = "";
+    private GroupNoticeBean.RowsBean bean;
+
+    @Override
+    public void onClick(View v) {
+    }
+
+
+    @Override
+    protected void initView() {
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "群公告");
+        if (BaseApplication.Companion.isTeacherClient()) {
+            viewBinding.ivSetting.setVisibility(View.VISIBLE);
+        }else{
+            viewBinding.ivSetting.setVisibility(View.GONE);
+        }
+        viewBinding.ivSetting.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (bean == null) {
+                    return;
+                }
+                List<GroupNoticeMenu> popuList = new ArrayList<>();
+                popuList.clear();
+                popuList.add(GroupNoticeMenu.EDIT_NOTICE);
+                if (bean.topFlag) {
+                    popuList.add(GroupNoticeMenu.CANCEL_TOP_NOTICE);
+                } else {
+                    popuList.add(GroupNoticeMenu.SET_TOP_NOTICE);
+                }
+                popuList.add(GroupNoticeMenu.DEL_NOTICE);
+                initPopu(popuList, v, bean);
+            }
+        });
+
+    }
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+
+    @Override
+    public void initData() {
+        super.initData();
+        targetGroupId = getIntent().getStringExtra("targetId");
+        targetMsgId = getIntent().getStringExtra("targetMsgId");
+        if (TextUtils.isEmpty(targetMsgId) || TextUtils.isEmpty(targetGroupId)) {
+            ToastUtil.getInstance().showShort("参数异常");
+            finish();
+            return;
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        queryData();
+    }
+
+    private void initPopu(List<GroupNoticeMenu> popuList, View view, GroupNoticeBean.RowsBean bean) {
+        PopupUtil.showInDropWrapNObg(this, R.layout.tc_notice_on_popu, view,
+                -SizeUtils.dp2px(55), SizeUtils.dp2px(5), (view1, popupWindow) -> {
+                    RecyclerView recyclerView = view1.findViewById(R.id.recyclerView);
+                    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(NoticeDetailActivity.this);
+                    recyclerView.setLayoutManager(linearLayoutManager);
+                    NoticePopuListAdapter adapter = new NoticePopuListAdapter(popuList);
+                    recyclerView.setAdapter(adapter);
+                    adapter.setOnItemClickListener(new OnItemClickListener() {
+                        @Override
+                        public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                            GroupNoticeMenu item = (GroupNoticeMenu) adapter.getItem(position);
+
+                            if (item == GroupNoticeMenu.EDIT_NOTICE) {
+                                ARouter.getInstance().build(TCChatRouterPath.CHAT_GROUP_NOTICE_EDIT)
+                                        .withString("targetId", targetGroupId)
+                                        .withString("title", bean.title)
+                                        .withString("notice", bean.content)
+                                        .withBoolean("isTop", bean.topFlag)
+                                        .withString("id", bean.id)
+                                        .navigation();
+                            }
+                            if (item == GroupNoticeMenu.SET_TOP_NOTICE) {
+                                presenter.noticeUpdate(bean.id, targetGroupId, bean.title, bean.content, true);
+                            }
+
+                            if (item == GroupNoticeMenu.CANCEL_TOP_NOTICE) {
+                                presenter.noticeUpdate(bean.id, targetGroupId, bean.title, bean.content, false);
+                            }
+
+                            if (item == GroupNoticeMenu.DEL_NOTICE) {
+                                presenter.noticeDel(String.valueOf(bean.id));
+                            }
+                            popupWindow.dismiss();
+                        }
+                    });
+
+
+                });
+    }
+
+
+    private void queryData() {
+        presenter.queryDetail(targetMsgId);
+    }
+
+    @Override
+    protected TcActivityNoticeDetailLayoutBinding getLayoutView() {
+        return TcActivityNoticeDetailLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected NoticePresenter createPresenter() {
+        return new NoticePresenter();
+    }
+
+
+    @Override
+    public void queryGroupNoticeSuccess(int page, GroupNoticeBean data) {
+
+    }
+
+    @Override
+    public void queryGroupNoticeError(int page) {
+
+    }
+
+    @Override
+    public void updateGroupNoticeSuccess() {
+        if (!checkActivityExist()) {
+            return;
+        }
+        queryData();
+    }
+
+    @Override
+    public void delGroupNoticeSuccess() {
+        if (!checkActivityExist()) {
+            return;
+        }
+        ToastUtil.getInstance().showShort("删除成功");
+        finish();
+    }
+
+    @Override
+    public void queryGroupNoticeDetailSuccess(GroupNoticeBean.RowsBean data) {
+        if (!checkActivityExist()) {
+            return;
+        }
+        bindData(data);
+    }
+
+    @Override
+    public void queryGroupNoticeDetailError() {
+        if (!checkActivityExist()) {
+            return;
+        }
+        finish();
+    }
+
+    private void bindData(GroupNoticeBean.RowsBean data) {
+        this.bean = data;
+        GlideImageLoaderUtils.getInstance().loadImage(this, bean.avatar, viewBinding.ivPortrait, R.drawable.tc_icon_teacher_default_head);
+        viewBinding.tvName.setText(bean.username);
+        viewBinding.tvTime.setText(DateUtil.dateFormatNoSecond(TextUtils.isEmpty(bean.updateTime) ? bean.createTime : bean.updateTime));
+        viewBinding.tvTitle.setText(bean.title);
+        viewBinding.tvContent.setText(bean.content);
+
+        if (bean.topFlag) {
+            viewBinding.tvRoof.setVisibility(View.VISIBLE);
+        } else {
+            viewBinding.tvRoof.setVisibility(View.GONE);
+        }
+    }
+}

+ 73 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/ui/NoticeEditActivity.java

@@ -2,7 +2,9 @@ package com.cooleshow.chatmodule.ui;
 
 import android.content.Intent;
 import android.os.Bundle;
+import android.text.Editable;
 import android.text.TextUtils;
+import android.text.TextWatcher;
 import android.view.View;
 import android.widget.Button;
 import android.widget.CheckBox;
@@ -18,6 +20,8 @@ import com.cooleshow.chatmodule.contract.NoticeEditContract;
 import com.cooleshow.chatmodule.databinding.TcActivityNoticeEditBinding;
 import com.cooleshow.chatmodule.presenter.NoticeEditPresenter;
 
+import java.util.Locale;
+
 import androidx.annotation.Nullable;
 
 /**
@@ -43,6 +47,41 @@ public class NoticeEditActivity extends BaseMVPActivity<TcActivityNoticeEditBind
     private boolean isTop;
     private String id;
 
+    private TextWatcher mTitleWatcher = new TextWatcher() {
+        @Override
+        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+        }
+
+        @Override
+        public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            formatTextNum();
+        }
+    };
+
+    private TextWatcher mContentWatcher = new TextWatcher() {
+        @Override
+        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+        }
+
+        @Override
+        public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            formatTextNum2();
+        }
+    };
+
+
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -71,6 +110,13 @@ public class NoticeEditActivity extends BaseMVPActivity<TcActivityNoticeEditBind
             cbRoof.setChecked(true);
         }
         etNotice.setText(notice);
+        initListener();
+
+    }
+
+    private void initListener() {
+        viewBinding.etTitle.addTextChangedListener(mTitleWatcher);
+        viewBinding.etNotice.addTextChangedListener(mContentWatcher);
         btnCommit.setOnClickListener(v -> {
             String title = etTitle.getText().toString().trim();
             if (TextUtils.isEmpty(title)) {
@@ -100,6 +146,19 @@ public class NoticeEditActivity extends BaseMVPActivity<TcActivityNoticeEditBind
         return new NoticeEditPresenter();
     }
 
+
+    private void formatTextNum() {
+        String text = etTitle.getText().toString().trim();
+        int cLength = text.length();
+        viewBinding.tvTitleTextNum.setText(String.format(Locale.getDefault(), "%d/25", cLength));
+    }
+
+    private void formatTextNum2() {
+        String text = viewBinding.etNotice.getText().toString().trim();
+        int cLength = text.length();
+        viewBinding.tvContentTextNum.setText(String.format(Locale.getDefault(), "%d/200", cLength));
+    }
+
     @Override
     public void updateGroupNoticeSuccess() {
         ToastUtil.getInstance().showShort("发布成功");
@@ -111,4 +170,18 @@ public class NoticeEditActivity extends BaseMVPActivity<TcActivityNoticeEditBind
         ToastUtil.getInstance().showShort("发布成功");
         finish();
     }
+
+
+    @Override
+    public void onDestroy() {
+        removeTextWatcher();
+        super.onDestroy();
+    }
+
+    private void removeTextWatcher() {
+        if (viewBinding != null) {
+            viewBinding.etTitle.removeTextChangedListener(mTitleWatcher);
+            viewBinding.etNotice.removeTextChangedListener(mContentWatcher);
+        }
+    }
 }

+ 4 - 0
chatModule/src/main/java/com/cooleshow/chatmodule/utils/helper/IMThemManager.java

@@ -17,8 +17,10 @@ import com.cooleshow.base.common.BaseApplication;
 import com.cooleshow.base.utils.SizeUtils;
 import com.cooleshow.chatmodule.R;
 import com.cooleshow.chatmodule.constants.TCMessageConstants;
+import com.cooleshow.chatmodule.message.bean.TUIChatGroupNoticeMessageBean;
 import com.cooleshow.chatmodule.message.bean.TUIChatShareLiveMessageBean;
 import com.cooleshow.chatmodule.message.bean.TUIChatShareMusicMessageBean;
+import com.cooleshow.chatmodule.message.holder.TUIChatGroupNoticeMessageHolder;
 import com.cooleshow.chatmodule.message.holder.TUIChatShareLiveMessageHolder;
 import com.cooleshow.chatmodule.message.holder.TUIChatShareMusicMessageHolder;
 import com.cooleshow.chatmodule.widget.CustomChatInputMusicExtension;
@@ -71,8 +73,10 @@ public class IMThemManager {
         //自定义消息
         TUIChatService.getInstance().addCustomMessageType(TCMessageConstants.TC_CHAT_SHARE_LIVE_MSG_TAG, TUIChatShareLiveMessageBean.class);
         TUIChatService.getInstance().addCustomMessageType(TCMessageConstants.TC_CHAT_SHARE_MUSIC_MSG_TAG, TUIChatShareMusicMessageBean.class);
+        TUIChatService.getInstance().addCustomMessageType(TCMessageConstants.TC_CHAT_GROUP_NOTICE_MSG_TAG, TUIChatGroupNoticeMessageBean.class);
         ClassicUIService.getInstance().addMessageType(TUIChatShareLiveMessageBean.class, TUIChatShareLiveMessageHolder.class);
         ClassicUIService.getInstance().addMessageType(TUIChatShareMusicMessageBean.class, TUIChatShareMusicMessageHolder.class);
+        ClassicUIService.getInstance().addMessageType(TUIChatGroupNoticeMessageBean.class, TUIChatGroupNoticeMessageHolder.class);
 
 
         MessageProperties instance = MessageProperties.getInstance();

BIN
chatModule/src/main/res/drawable-xhdpi/tc_icon_chat_group_notice_tag.png


BIN
chatModule/src/main/res/drawable-xhdpi/tc_icon_group_notice_content_tag.png


BIN
chatModule/src/main/res/drawable-xhdpi/tc_icon_group_notice_title_tag.png


BIN
chatModule/src/main/res/drawable-xxhdpi/tc_icon_chat_group_notice_tag.png


BIN
chatModule/src/main/res/drawable-xxhdpi/tc_icon_group_notice_content_tag.png


BIN
chatModule/src/main/res/drawable-xxhdpi/tc_icon_group_notice_title_tag.png


+ 155 - 0
chatModule/src/main/res/layout/tc_activity_notice_detail_layout.xml

@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include
+        android:id="@+id/toolbar_include"
+        layout="@layout/common_toolbar_layout"/>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="13dp"
+        android:layout_marginTop="@dimen/dp_12"
+        android:layout_marginEnd="13dp"
+        android:background="@drawable/bg_white_10dp"
+        android:paddingStart="12dp"
+        android:paddingEnd="12dp"
+        android:paddingBottom="12dp">
+
+
+        <de.hdodenhof.circleimageview.CircleImageView
+            android:id="@+id/iv_portrait"
+            android:layout_width="@dimen/dp_48"
+            android:layout_height="@dimen/dp_48"
+            android:layout_marginTop="12dp"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:qmui_corner_radius="5dp" />
+
+        <TextView
+            android:id="@+id/tv_name"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/dp_10"
+            android:ellipsize="end"
+            android:maxLines="1"
+            android:text=""
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_16"
+            android:textStyle="bold"
+            app:layout_constraintEnd_toStartOf="@+id/tv_group_tag"
+            app:layout_constraintHorizontal_bias="0"
+            app:layout_constraintHorizontal_chainStyle="packed"
+            app:layout_constraintStart_toEndOf="@id/iv_portrait"
+            app:layout_constraintTop_toTopOf="@id/iv_portrait"
+            app:layout_constraintWidth_default="wrap"
+            tools:text="陈老师" />
+
+        <TextView
+            android:id="@+id/tv_group_tag"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/dp_4"
+            android:layout_marginEnd="12dp"
+            android:gravity="center"
+            android:paddingStart="6dp"
+            android:paddingTop="1dp"
+            android:paddingEnd="6dp"
+            android:paddingBottom="1dp"
+            android:text="老师"
+            android:textColor="@color/white"
+            android:textSize="@dimen/sp_11"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_name"
+            app:layout_constraintLeft_toRightOf="@+id/tv_name"
+            app:layout_constraintRight_toLeftOf="@+id/iv_setting"
+            app:layout_constraintTop_toTopOf="@+id/tv_name"
+            tools:visibility="gone" />
+
+
+        <TextView
+            android:id="@+id/tv_time"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="@dimen/dp_10"
+            android:layout_marginTop="@dimen/dp_4"
+            android:text="    "
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/dp_13"
+            app:layout_constraintStart_toEndOf="@id/iv_portrait"
+            app:layout_constraintTop_toBottomOf="@id/tv_name"
+            tools:text="2023-07-24 15:34:26" />
+
+        <TextView
+            android:id="@+id/tv_roof"
+            android:layout_width="0dp"
+            android:layout_height="19dp"
+            android:layout_marginStart="@dimen/dp_6"
+            android:background="@drawable/bg_orange_line_45_shape"
+            android:paddingStart="@dimen/dp_8"
+            android:paddingEnd="@dimen/dp_8"
+            android:text="置顶"
+            android:gravity="center"
+            android:includeFontPadding="false"
+            android:textColor="@color/color_ff5151"
+            android:textSize="@dimen/dp_12"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+            app:layout_constraintStart_toEndOf="@id/tv_time"
+            app:layout_constraintTop_toTopOf="@+id/tv_time" />
+
+        <ImageView
+            android:id="@+id/iv_setting"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:src="@drawable/tc_ic_notice_setting"
+            android:visibility="visible"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_name"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="@+id/tv_name" />
+
+        <View
+            android:id="@+id/view_line"
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="12dp"
+            android:background="@color/color_f2f2f2"
+            app:layout_constraintTop_toBottomOf="@id/iv_portrait" />
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/dp_9"
+            android:ellipsize="end"
+            android:includeFontPadding="false"
+            android:maxLines="1"
+            android:text=""
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/dp_15"
+            android:textStyle="bold"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="@id/iv_portrait"
+            app:layout_constraintTop_toBottomOf="@id/view_line"
+            tools:text="今日作业" />
+
+        <TextView
+            android:id="@+id/tv_content"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/dp_6"
+            android:text=""
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/dp_14"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="@id/tv_title"
+            app:layout_constraintTop_toBottomOf="@id/tv_title"
+            tools:text="1、练习云教练-欢乐颂10分钟\n2、测评云教练-欢乐颂分数达到80分以上" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</LinearLayout>

+ 59 - 44
chatModule/src/main/res/layout/tc_activity_notice_edit.xml

@@ -12,111 +12,126 @@
         app:layout_constraintTop_toTopOf="parent" />
 
     <androidx.constraintlayout.widget.ConstraintLayout
-        android:layout_marginTop="14dp"
         android:id="@+id/cs_title"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@color/white"
+        android:layout_height="109dp"
+        android:layout_marginStart="12dp"
+        android:layout_marginTop="14dp"
+        android:layout_marginEnd="12dp"
+        android:background="@drawable/bg_white_10dp"
+        android:paddingStart="12dp"
         android:paddingTop="15dp"
+        android:paddingEnd="12dp"
         android:paddingBottom="15dp"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/toolbar_include">
 
-
-        <View
-            android:id="@+id/view_line1"
-            android:layout_width="4dp"
-            android:layout_height="14dp"
-            android:layout_marginStart="12dp"
-            android:background="@drawable/shape_59e5d5_to_2dc7aa"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_title"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/tv_title" />
-
         <TextView
             android:id="@+id/tv_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="7dp"
+            android:drawableStart="@drawable/tc_icon_group_notice_title_tag"
+            android:drawablePadding="6dp"
+            android:gravity="center_vertical"
+            android:includeFontPadding="false"
             android:text="标题"
             android:textColor="@color/color_333333"
-            android:textSize="@dimen/sp_17"
+            android:textSize="@dimen/sp_16"
             android:textStyle="bold"
-            app:layout_constraintLeft_toRightOf="@+id/view_line1"
+            app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <androidx.appcompat.widget.AppCompatEditText
             android:id="@+id/et_title"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
+            android:layout_height="0dp"
+            android:layout_marginTop="9dp"
             android:background="@color/white"
-            android:hint="请输入标题(1-25字)"
+            android:hint="请输入标题"
             android:maxLength="25"
-            android:paddingEnd="12dp"
-            android:paddingStart="@dimen/dp_12"
-            android:paddingTop="@dimen/dp_12"
-            android:paddingBottom="@dimen/dp_12"
+            android:gravity="start|top"
             android:textColor="@color/color_333333"
-            android:textSize="@dimen/dp_14"
+            android:textSize="@dimen/dp_15"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/tv_title" />
+
+        <TextView
+            android:id="@+id/tv_title_text_num"
+            android:layout_width="wrap_content"
+            android:layout_height="20dp"
+            android:gravity="center"
+            android:text="0/25"
+            android:textColor="@color/color_aaaaaa"
+            android:textSize="@dimen/sp_14"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
+
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/cs_content"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginStart="12dp"
         android:layout_marginTop="12dp"
-        android:background="@color/white"
+        android:layout_marginEnd="12dp"
+        android:background="@drawable/bg_white_10dp"
+        android:paddingStart="12dp"
         android:paddingTop="15dp"
+        android:paddingEnd="12dp"
         android:paddingBottom="15dp"
         app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintTop_toBottomOf="@+id/cs_title">
 
-        <View
-            android:id="@+id/view_line2"
-            android:layout_width="4dp"
-            android:layout_height="14dp"
-            android:layout_marginStart="12dp"
-            android:background="@drawable/shape_59e5d5_to_2dc7aa"
-            app:layout_constraintBottom_toBottomOf="@+id/tv_content"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/tv_content" />
 
         <TextView
             android:id="@+id/tv_content"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="7dp"
-            android:layout_marginTop="10dp"
+            android:drawableStart="@drawable/tc_icon_group_notice_content_tag"
+            android:drawablePadding="6dp"
             android:text="公告内容"
             android:textColor="@color/color_333333"
-            android:textSize="@dimen/sp_17"
+            android:textSize="@dimen/sp_16"
             android:textStyle="bold"
-            app:layout_constraintLeft_toRightOf="@+id/view_line2"
+            app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
         <EditText
             android:id="@+id/et_notice"
             android:layout_width="match_parent"
             android:layout_height="@dimen/dp_200"
+            android:layout_marginTop="9dp"
             android:background="@color/white"
             android:gravity="start|top"
-            android:hint="请填写群公告 (1-255字)"
-            android:maxLength="255"
-            android:padding="@dimen/dp_12"
+            android:hint="请填写群公告"
+            android:maxLength="200"
             android:textColor="@color/color_333333"
-            android:textSize="@dimen/dp_14"
+            android:textSize="@dimen/dp_15"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/tv_content" />
+
+        <TextView
+            android:id="@+id/tv_content_text_num"
+            android:layout_width="wrap_content"
+            android:layout_height="20dp"
+            android:gravity="center"
+            android:text="0/200"
+            android:textColor="@color/color_aaaaaa"
+            android:textSize="@dimen/sp_14"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintRight_toRightOf="parent" />
     </androidx.constraintlayout.widget.ConstraintLayout>
 
     <CheckBox
-        android:layout_marginTop="12dp"
         android:id="@+id/cb_roof"
         android:layout_width="match_parent"
         android:layout_height="@dimen/dp_50"
-        android:background="@color/white"
+        android:layout_marginStart="12dp"
+        android:layout_marginTop="12dp"
+        android:layout_marginEnd="12dp"
+        android:background="@drawable/bg_white_10dp"
         android:button="@null"
         android:checked="true"
         android:drawableEnd="@drawable/tc_switch_selector"

+ 64 - 0
chatModule/src/main/res/layout/tc_chat_group_notice_layout.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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="@dimen/chat_message_content_max_width"
+    android:layout_height="wrap_content">
+
+    <LinearLayout
+        android:orientation="vertical"
+        android:background="@drawable/bg_white_10dp"
+        android:paddingStart="12dp"
+        android:paddingTop="13dp"
+        android:paddingEnd="12dp"
+        android:paddingBottom="11dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/tv_tag"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:drawableStart="@drawable/tc_icon_chat_group_notice_tag"
+            android:drawablePadding="6dp"
+            android:includeFontPadding="false"
+            android:text="群公告"
+            android:textColor="@color/color_19b396"
+            android:textSize="@dimen/sp_15"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="11dp"
+            android:ellipsize="end"
+            android:includeFontPadding="false"
+            android:maxLines="8"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_15"
+            android:textStyle="bold"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_tag"
+            tools:text="今日作业" />
+
+        <TextView
+            android:id="@+id/tv_content"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            android:ellipsize="end"
+            android:includeFontPadding="false"
+            android:maxLines="8"
+            android:lineSpacingMultiplier="1.1"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_15"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_title"
+            tools:text="今日作业 1、练习云教练-小星星10分钟 2、测评云教练-小星星分数须达到80分以上" />
+    </LinearLayout>
+</LinearLayout>

+ 51 - 50
chatModule/src/main/res/layout/tc_notice_list_item.xml

@@ -1,18 +1,21 @@
 <?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="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginTop="@dimen/dp_10"
     android:layout_marginStart="13dp"
+    android:layout_marginTop="@dimen/dp_12"
     android:layout_marginEnd="13dp"
-    android:background="@drawable/shape_10dp_white">
+    android:paddingStart="12dp"
+    android:paddingEnd="12dp"
+    android:paddingBottom="12dp"
+    android:background="@drawable/bg_white_10dp">
 
     <de.hdodenhof.circleimageview.CircleImageView
         android:id="@+id/iv_portrait"
         android:layout_width="@dimen/dp_48"
         android:layout_height="@dimen/dp_48"
-        android:layout_marginStart="13dp"
         android:layout_marginTop="12dp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
@@ -22,82 +25,98 @@
         android:id="@+id/tv_name"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/dp_11"
-        android:layout_marginTop="@dimen/dp_8"
-        android:layout_marginEnd="10dp"
+        android:layout_marginStart="@dimen/dp_10"
         android:ellipsize="end"
         android:maxLines="1"
         android:text=""
-        android:textStyle="bold"
-        android:includeFontPadding="false"
         android:textColor="@color/color_333333"
-        android:textSize="@dimen/dp_16"
-        app:layout_constraintEnd_toStartOf="@id/iv_setting"
+        android:textSize="@dimen/sp_16"
+        android:textStyle="bold"
+        app:layout_constraintHorizontal_bias="0"
+        app:layout_constraintHorizontal_chainStyle="packed"
+        app:layout_constraintEnd_toStartOf="@+id/iv_group_tag"
         app:layout_constraintStart_toEndOf="@id/iv_portrait"
-        app:layout_constraintTop_toTopOf="@id/iv_portrait" />
+        app:layout_constraintTop_toTopOf="@id/iv_portrait"
+        app:layout_constraintWidth_default="wrap"
+        tools:text="陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师陈老师" />
+
+    <ImageView
+        android:id="@+id/iv_group_tag"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/dp_4"
+        android:layout_marginEnd="12dp"
+        android:gravity="center"
+        android:src="@drawable/icon_teacher_tag"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_name"
+        app:layout_constraintLeft_toRightOf="@+id/tv_name"
+        app:layout_constraintRight_toLeftOf="@+id/iv_setting"
+        app:layout_constraintTop_toTopOf="@+id/tv_name"
+        tools:visibility="visible" />
+
 
     <TextView
         android:id="@+id/tv_time"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginStart="@dimen/dp_11"
+        android:layout_marginStart="@dimen/dp_10"
         android:layout_marginTop="@dimen/dp_4"
-        android:layout_marginEnd="@dimen/dp_15"
         android:text="    "
-        android:includeFontPadding="false"
         android:textColor="@color/color_777777"
-        android:textSize="@dimen/dp_14"
+        android:textSize="@dimen/dp_13"
         app:layout_constraintStart_toEndOf="@id/iv_portrait"
-        app:layout_constraintTop_toBottomOf="@id/tv_name" />
+        app:layout_constraintTop_toBottomOf="@id/tv_name"
+        tools:text="2023-07-24 15:34:26" />
 
     <TextView
         android:id="@+id/tv_roof"
         android:layout_width="0dp"
         android:layout_height="19dp"
-        android:layout_marginStart="@dimen/dp_8"
+        android:layout_marginStart="@dimen/dp_6"
         android:background="@drawable/bg_orange_line_45_shape"
         android:paddingStart="@dimen/dp_8"
         android:paddingEnd="@dimen/dp_8"
-        android:text="置顶"
         android:gravity="center"
         android:includeFontPadding="false"
-        android:textColor="@color/color_fe2451"
+        android:text="置顶"
+        android:textColor="@color/color_ff5151"
         android:textSize="@dimen/dp_12"
         app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintTop_toTopOf="@+id/tv_time"
         app:layout_constraintStart_toEndOf="@id/tv_time"
-        app:layout_constraintTop_toTopOf="@id/tv_time" />
+        />
 
     <ImageView
         android:id="@+id/iv_setting"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/dp_12"
-        android:padding="@dimen/dp_15"
         android:src="@drawable/tc_ic_notice_setting"
         android:visibility="visible"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_name"
         app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
+        app:layout_constraintTop_toTopOf="@+id/tv_name" />
 
     <View
-        android:background="@color/color_f2f2f2"
         android:id="@+id/view_line"
-        android:layout_marginStart="12dp"
-        android:layout_marginEnd="12dp"
-        android:layout_marginTop="12dp"
-        app:layout_constraintTop_toBottomOf="@+id/iv_portrait"
         android:layout_width="match_parent"
-        android:layout_height="1dp"/>
+        android:layout_height="1px"
+        android:layout_marginTop="12dp"
+        android:background="@color/color_f2f2f2"
+        app:layout_constraintTop_toBottomOf="@id/iv_portrait" />
 
     <TextView
         android:id="@+id/tv_title"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/dp_12"
-        android:layout_marginEnd="@dimen/dp_13"
+        android:layout_marginTop="@dimen/dp_9"
         android:text=""
+        android:maxLines="1"
+        android:ellipsize="end"
         android:textColor="@color/color_333333"
         android:textSize="@dimen/dp_15"
         android:textStyle="bold"
+        tools:text="今日作业"
+        android:includeFontPadding="false"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@id/iv_portrait"
         app:layout_constraintTop_toBottomOf="@id/view_line" />
@@ -107,31 +126,13 @@
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/dp_6"
-        android:layout_marginEnd="@dimen/dp_13"
-        android:layout_marginBottom="@dimen/dp_15"
         android:text=""
         android:textColor="@color/color_777777"
         android:textSize="@dimen/dp_14"
+        tools:text="1、练习云教练-欢乐颂10分钟\n2、测评云教练-欢乐颂分数达到80分以上"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@id/tv_title"
         app:layout_constraintTop_toBottomOf="@id/tv_title" />
 
-    <TextView
-        android:id="@+id/tv_read"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginTop="@dimen/dp_20"
-        android:layout_marginEnd="@dimen/dp_15"
-        android:layout_marginBottom="@dimen/dp_18"
-        android:drawableStart="@drawable/tc_ic_notice_read"
-        android:drawablePadding="@dimen/dp_5"
-        android:text=""
-        android:textColor="#4B6F6C"
-        android:textSize="@dimen/dp_16"
-        android:visibility="gone"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="@id/tv_content"
-        app:layout_constraintTop_toBottomOf="@id/tv_content" />
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 24 - 10
chatModule/src/main/res/layout/tc_notice_on_popu.xml

@@ -1,15 +1,29 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="100dp"
+    android:layout_width="120dp"
     android:layout_height="wrap_content"
-    android:background="@drawable/tc_ic_already_on_popu"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical">
 
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/recyclerView"
-        android:layout_width="100dp"
-        android:layout_height="wrap_content"
-        android:overScrollMode="never"
-        tools:listitem="@layout/tc_notice_popu_list_item" />
-</LinearLayout>
+    <androidx.cardview.widget.CardView
+        app:cardBackgroundColor="@color/white"
+        app:cardElevation="3dp"
+        app:cardCornerRadius="12dp"
+        android:layout_marginStart="5dp"
+        android:layout_marginTop="5dp"
+        android:layout_marginEnd="5dp"
+        android:layout_marginBottom="5dp"
+        app:cardPreventCornerOverlap="true"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/recyclerView"
+            android:layout_width="120dp"
+            android:layout_height="wrap_content"
+            android:overScrollMode="never"
+            tools:listitem="@layout/tc_notice_popu_list_item" />
+
+    </androidx.cardview.widget.CardView>
+</FrameLayout>