From c7ba98acb461c1fababf63051c0bcb81d07bfab0 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 21 Mar 2024 16:17:17 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=B1=8F=E8=94=BDpush=E5=88=97=E8=A1=A8?= =?UTF-8?q?=20update=20=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E6=96=87?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/shayu/phonelive/AppContext.java | 5 +- .../utils/MessageChatNotifyManager.java | 11 +- .../activity/PDLiveConversationActivity.java | 2 +- .../MessageChatTopImageListAdapter.java | 1 - .../src/main/res/layout/view_main_message.xml | 132 ++++++++++-------- main/src/main/res/values-zh/strings.xml | 2 +- 6 files changed, 83 insertions(+), 70 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 85297aef6..d5fb0b326 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -241,6 +241,10 @@ public class AppContext extends CommonAppContext { RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatTipsItemProvider(getApplicationContext())); RongConfigCenter.conversationConfig().addMessageProvider(new MessageChatCardItemProvider(getApplicationContext())); + //注册屏蔽push弹窗的类 + MessageChatNotifyManager.getInstance().addShieldClass(CompleteUserInfoActivity.class); + MessageChatNotifyManager.getInstance().addShieldClass(PDLiveConversationActivity.class); + RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() { @Override public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) { @@ -277,7 +281,6 @@ public class AppContext extends CommonAppContext { if (AppManager.getInstance().getLastActivity() instanceof CompleteUserInfoActivity) { return false; } - MessageChatNotifyManager.getInstance().setShieldClass(CompleteUserInfoActivity.class); MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() , message.getTargetId(), content.getContent() diff --git a/common/src/main/java/com/yunbao/common/utils/MessageChatNotifyManager.java b/common/src/main/java/com/yunbao/common/utils/MessageChatNotifyManager.java index 733feea7e..ec426cd2e 100644 --- a/common/src/main/java/com/yunbao/common/utils/MessageChatNotifyManager.java +++ b/common/src/main/java/com/yunbao/common/utils/MessageChatNotifyManager.java @@ -13,7 +13,7 @@ import java.util.List; public class MessageChatNotifyManager { private static MessageChatNotifyManager instance; private List startListNotifyList = new ArrayList<>(); - Class clazz; + List clazzList = new ArrayList<>(); public static MessageChatNotifyManager getInstance() { if (instance == null) { @@ -22,8 +22,10 @@ public class MessageChatNotifyManager { return instance; } - public void setShieldClass(Class clazz) { - this.clazz = clazz; + public void addShieldClass(Class clazz) { + if (!clazzList.contains(clazz.getSimpleName())) { + clazzList.add(clazz.getSimpleName()); + } } public void push(Context mContext, MessageUserInfoBean userInfo) { @@ -36,7 +38,8 @@ public class MessageChatNotifyManager { } private void notifyLiveFlot(Context mContext) { - if (AppManager.getInstance().getLastActivity().getClass().getSimpleName().equals(clazz.getSimpleName())) { + String simpleName = AppManager.getInstance().getLastActivity().getClass().getSimpleName(); + if (clazzList.contains(simpleName)) { ToastUtil.showDebug("屏蔽类,不展示"); return; } diff --git a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java index fb27a6912..8572f2089 100644 --- a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationActivity.java @@ -275,7 +275,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_green); } else { ViewUtils.findViewById(card, R.id.user_status, TextView.class).setText(R.string.activity_msg_chat_top_status_offline); - ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_green); + ViewUtils.findViewById(card, R.id.userStatusIcon, ImageView.class).setImageResource(R.mipmap.icon_gray); } showBanner(); showTag(); diff --git a/main/src/main/java/com/yunbao/main/adapter/MessageChatTopImageListAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MessageChatTopImageListAdapter.java index bb16a335d..dde815f46 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MessageChatTopImageListAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MessageChatTopImageListAdapter.java @@ -19,7 +19,6 @@ public class MessageChatTopImageListAdapter extends RecyclerView.Adapter urls = new ArrayList<>(); public void setUrls(List urls) { - ToastUtil.show("照片数量:"+urls.size()); this.urls = urls; notifyDataSetChanged(); } diff --git a/main/src/main/res/layout/view_main_message.xml b/main/src/main/res/layout/view_main_message.xml index d6ae8ba19..919ea127f 100644 --- a/main/src/main/res/layout/view_main_message.xml +++ b/main/src/main/res/layout/view_main_message.xml @@ -1,24 +1,26 @@ - + + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="horizontal"> + + android:orientation="vertical"> + + app:layout_constraintTop_toTopOf="parent" /> + + android:layout_height="6.3dp" + android:scaleType="fitXY" + android:src="@mipmap/icon_index" /> @@ -51,21 +53,22 @@ android:drawableStart="@mipmap/ic_home_game_search" android:drawablePadding="8dp" android:gravity="center_vertical" - android:lines="1" android:hint="@string/activity_msg_search_hint" + android:lines="1" + android:maxLines="1" android:padding="10dp" android:visibility="visible" /> @@ -78,9 +81,9 @@ android:layout_marginEnd="16dp" android:layout_marginBottom="16dp" android:layout_weight="0.1" - tools:visibility="visible" android:src="@mipmap/btn_more_black" - android:visibility="gone" /> + android:visibility="gone" + tools:visibility="visible" /> @@ -100,43 +103,43 @@ android:id="@+id/img_news_notice" android:layout_width="match_parent" android:layout_height="70dp" - android:layout_marginBottom="20dp" + android:layout_alignBottom="@+id/tv_news_notice" android:layout_alignParentStart="true" android:layout_alignParentEnd="true" - android:layout_alignBottom="@+id/tv_news_notice" + android:layout_marginBottom="20dp" android:src="@mipmap/ic_msg_notice" /> + app:autoSizeTextType="uniform" /> + android:visibility="gone" + tools:visibility="visible" /> + + app:autoSizeTextType="uniform" /> + + + app:autoSizeTextType="uniform" /> + + app:autoSizeTextType="uniform" /> + + android:layout_height="1dp" + android:layout_marginStart="16dp" + android:layout_marginTop="20dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="20dp" + android:background="#FFE9F6" /> + android:layout_height="match_parent" + android:layout_marginBottom="50dp" /> 系統通知 互動消息 在線客服 - 搜索昵稱或聊天記錄 + 搜索 包含: 聯繫人 聊天記錄