From 000929fd022f08f3cc0dc1ae27b276465574e1b9 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 11 Oct 2023 15:40:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/manager/IMLoginManager.java | 10 ++++++++-- .../com/yunbao/live/activity/LiveAudienceActivity.java | 7 ++++++- .../com/yunbao/live/views/LiveAudienceViewHolder.java | 6 ++++-- live/src/main/res/layout/item_live_task.xml | 6 ++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index a1918f71a..430117466 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -8,7 +8,6 @@ import android.text.TextUtils; import androidx.annotation.NonNull; -import com.alibaba.fastjson.JSONArray; import com.google.gson.Gson; import com.lzf.easyfloat.EasyFloat; import com.umeng.analytics.MobclickAgent; @@ -54,12 +53,19 @@ public class IMLoginManager extends BaseCacheManager { private final String KEY_LANGUAGE = "language"; private final String KEY_GAME = "key_game"; + public void setRedPoint() { + put("RedPoint", "1"); + } + + public boolean getRedPoint() { + return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1"); + } + public void setSudGame(String sudGameJson) { put(KEY_GAME, sudGameJson); } - public String getSudGame() { return getString(KEY_GAME); } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 05f7c6b73..cfc90402e 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -1733,7 +1733,12 @@ public class LiveAudienceActivity extends LiveActivity { if (isShow) { manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE); } else { - manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.GONE); + if (IMLoginManager.get(mContext).getRedPoint()) { + manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.VISIBLE); + }else { + manager.mLiveAudienceViewHolder.mRedPointPrivilege.setVisibility(View.GONE); + } + } } 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 4d5f04185..90152b196 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -35,6 +35,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.API; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.ProcessResultUtil; import com.yunbao.common.utils.SpUtil; @@ -409,7 +410,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { Bundle bundle = new Bundle(); String url = newPeopleUrl + (newPeopleUrl.contains("?") ? "&" : "?") + "g=Appapi&m=Turntable&a=tricky"; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); bundle.putString("url", url); bundle.putInt("show_type", 0); //bundle.putInt("height", DpUtil.dp2px(1)); @@ -448,7 +449,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { public void openZGListWindow() { String url = CommonAppConfig.HOST + "/index.php?g=Appapi&m=Turntable&a=tricky"; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" - + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid+ "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid + "&isZh=" + (WordUtil.isNewZh() ? "1" : 0); Log.i("tag", url); Bundle bundle1 = new Bundle(); bundle1.putString("url", url); @@ -461,6 +462,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { * 身份特权 */ public void openRoleDialog() { + IMLoginManager.get(mContext).setRedPoint(); // LiveRoleDialogFragment fragment = new LiveRoleDialogFragment(); // Bundle bundle = new Bundle(); // bundle.putBoolean("showRed", mRedPointPrivilege.getVisibility() == View.VISIBLE); diff --git a/live/src/main/res/layout/item_live_task.xml b/live/src/main/res/layout/item_live_task.xml index 8208faf8f..57cbe7814 100644 --- a/live/src/main/res/layout/item_live_task.xml +++ b/live/src/main/res/layout/item_live_task.xml @@ -10,12 +10,14 @@