From 4560c0081006a5be45b8eb2fce1026d5da97edbc Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 6 Sep 2022 16:18:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=A7=81=E8=81=8A=E6=B5=AE=E7=AA=97=E6=97=B6=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E6=96=B9=E7=A7=81=E8=81=8A=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=BA=A2?= =?UTF-8?q?=E7=82=B9=20fix:=E8=B0=83=E6=95=B4=E6=96=B0=E4=BA=BA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=B8=83=E5=B1=80=E9=97=B4=E8=B7=9D=20fix=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2=E6=A0=8F=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BC=9A=E7=A9=BA=E6=8C=87=E9=92=88=E9=97=AA?= =?UTF-8?q?=E9=80=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/views/LiveAudienceViewHolder.java | 3 ++- live/src/main/res/layout/view_live_room.xml | 11 ++++++----- .../main/fragment/SearchResultsItemFragment.java | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 0b4bd417b..f978d3171 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -37,6 +37,7 @@ import com.yunbao.common.http.HttpClient; import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; @@ -439,7 +440,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { public void onMessageIMEvent(MessageIMEvent event) { //判断消息中心红点是否已经展示,如果已经展示并且未读消息大于0则不再执行之后的逻辑 int number = event.getNumber(); - if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0) return; + if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0 || SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) return; if (number > 0) { v_msg_redpoint.setVisibility(View.VISIBLE); } else { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index e3181255f..87778a325 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -95,7 +95,7 @@ android:layout_height="80dp" android:layout_gravity="right" android:layout_marginRight="15dp" - android:layout_marginBottom="25dp" + android:layout_marginBottom="5dp" android:gravity="center_horizontal" android:orientation="vertical" android:visibility="gone"> @@ -110,15 +110,13 @@ app:indicator_width="8dp" /> - @@ -128,7 +126,10 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/live_turntable" /> - + + diff --git a/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java b/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java index fc08aebd3..cec504137 100644 --- a/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java +++ b/main/src/main/java/com/yunbao/main/fragment/SearchResultsItemFragment.java @@ -140,7 +140,7 @@ public class SearchResultsItemFragment extends BaseFragment { type, page, new HttpCallback>>() { @Override public void onSuccess(List> data) { - if (getActivity().isFinishing()) return; + if (getActivity()==null||getActivity().isFinishing()) return; if (data.get(0).size() == 0 && data.get(1).size() == 0) { @@ -155,7 +155,7 @@ public class SearchResultsItemFragment extends BaseFragment { @Override public void onError(String error) { - if (getActivity().isFinishing()) return; + if (getActivity()==null||getActivity().isFinishing()) return; emptyLayout.setVisibility(View.VISIBLE); searchList.setVisibility(View.GONE); } @@ -167,7 +167,7 @@ public class SearchResultsItemFragment extends BaseFragment { type, page, new HttpCallback>() { @Override public void onSuccess(List data) { - if (getActivity().isFinishing()) return; + if (getActivity()==null||getActivity().isFinishing()) return; List> listList = new ArrayList<>(); listList.add(data); if (page > 1) { @@ -189,7 +189,7 @@ public class SearchResultsItemFragment extends BaseFragment { @Override public void onError(String error) { - if (getActivity().isFinishing()) return; + if (getActivity()==null||getActivity().isFinishing()) return; emptyLayout.setVisibility(View.VISIBLE); searchList.setVisibility(View.GONE); }