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); }