From f94b3f27e371cb0c5c23f673da4eb310b3a64896 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 22 Mar 2024 14:53:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=88=E6=8A=A4=E5=9B=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/manager/IMLoginManager.java | 27 +++++++++++++--- .../utils/JavascriptInterfaceUtils.java | 13 ++++++-- .../common/views/FunGamesChildViewHolder.java | 12 +++++-- .../views/NewRoleFunGamesChildViewHolder.java | 9 ++++-- .../res/layout/view_fun_games_child_view.xml | 31 ++++++++++++++++--- ...iew_live_new_role_fun_games_child_view.xml | 31 ++++++++++++++++--- .../live/activity/LiveAudienceActivity.java | 7 +++-- .../yunbao/live/dialog/LiveGuardDialog.java | 1 + .../live/views/LiveAudienceViewHolder.java | 20 ++++++++++++ .../live/views/PortraitLiveManager.java | 5 +++ .../main/res/layout/view_live_audience.xml | 29 ++++++++++++----- .../yunbao/main/views/MainMeViewHolder.java | 2 +- 12 files changed, 155 insertions(+), 32 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 cb7684922..62585d204 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -62,7 +62,24 @@ public class IMLoginManager extends BaseCacheManager { public boolean getRedPoint() { return !TextUtils.isEmpty(getString("RedPoint")) || !TextUtils.equals(getString("RedPoint"), "1"); } - public void setQuickGiftIfFirst() { + + public void setGuardRedPoint() { + put("GuardRedPoint", "1"); + } + + public boolean getGuardRedPoint() { + String GuardRedPoint = getString("GuardRedPoint"); + if (TextUtils.isEmpty(GuardRedPoint)) { + return true; + } + if (!TextUtils.equals(GuardRedPoint, "1")) { + return true; + } + + return false; + } + + public void setQuickGiftIfFirst() { put("quick_gift_if_first", "1"); } @@ -511,7 +528,8 @@ public class IMLoginManager extends BaseCacheManager { } }); } - public void updateUserCoin(){ + + public void updateUserCoin() { HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance") .execute(new HttpCallback() { @Override @@ -528,14 +546,15 @@ public class IMLoginManager extends BaseCacheManager { } }); } - public void updateUserCoin(OnItemClickListener listener){ + + public void updateUserCoin(OnItemClickListener listener) { HttpClient.getInstance().get("User.getUserBalance", "User.getUserBalance") .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0) { JSONObject obj = JSONObject.parseObject(info[0]); - listener.onItemClick(obj,0); + listener.onItemClick(obj, 0); String golds = obj.getString("gold"); String coins = obj.getString("coin"); String yuanbaos = obj.getString("yuanbao"); diff --git a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java index b28aa2dd1..cec2c3fd4 100644 --- a/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java @@ -9,7 +9,6 @@ import android.app.Dialog; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; -import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.webkit.JavascriptInterface; @@ -378,6 +377,13 @@ public class JavascriptInterfaceUtils { RouteUtil.forwardZhuangBanActivity(url); } + @JavascriptInterface + public void openWebViewNew(String url) { + Bus.get().post(new JavascriptInterfaceEvent().setMethod("openWebView").setData(url)); + Constants.isTitle = false; + RouteUtil.forwardZhuangBanActivity(CommonAppConfig.HOST + url); + } + @JavascriptInterface public void openWebViewTitle(String url) { Constants.isTitle = true; @@ -694,10 +700,11 @@ public class JavascriptInterfaceUtils { public void androidtoCommunityVideo() { RouteUtil.forwardCommunityActivity(); } + @JavascriptInterface - public void getRewards(String checkUpgradesJson){ + public void getRewards(String checkUpgradesJson) { try { - CheckUpgradesModel upgradesModel = new Gson().fromJson(checkUpgradesJson,CheckUpgradesModel.class); + CheckUpgradesModel upgradesModel = new Gson().fromJson(checkUpgradesJson, CheckUpgradesModel.class); if (!TextUtils.isEmpty(upgradesModel.getLevel())) new XPopup.Builder(mWebView.getContext()) .asCustom(new GuardUpgradePopup(mWebView.getContext(), "", upgradesModel)) diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java index 13023f15c..49c5342a3 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java @@ -22,11 +22,13 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake; public class FunGamesChildViewHolder extends RecyclerView.ViewHolder { private ImageView funGamePic; private TextView funGameName; + private View total_image_red_point; public FunGamesChildViewHolder(@NonNull View itemView) { super(itemView); funGamePic = itemView.findViewById(R.id.fun_game_pic); funGameName = itemView.findViewById(R.id.fun_game_name); + total_image_red_point = itemView.findViewById(R.id.total_image_red_point); } public void setData(CustomSidebarChildModel model, boolean rigts) { @@ -38,7 +40,11 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder { funGameName.setText(model.getTitle()); - + if (TextUtils.equals(model.getTitle(), WordUtil.getNewString(com.yunbao.common.R.string.guard_guard)) && IMLoginManager.get(itemView.getContext()).getGuardRedPoint()) { + total_image_red_point.setVisibility(View.VISIBLE); + } else { + total_image_red_point.setVisibility(View.GONE); + } ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { @@ -59,7 +65,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder { .append("&uid=") .append(userInfo.getId()) .append("&token=") - .append(userInfo.getToken()) .append("&isZh=") + .append(userInfo.getToken()).append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } else { htmlUrl.append(CommonAppConfig.HOST) @@ -68,7 +74,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder { .append("?uid=") .append(userInfo.getId()) .append("&token=") - .append(userInfo.getToken()) .append("&isZh=") + .append(userInfo.getToken()).append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } Bus.get().post(new CustomDrawerPopupEvent() diff --git a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java index 3a6b460ad..8dc3ee7fa 100644 --- a/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/NewRoleFunGamesChildViewHolder.java @@ -26,13 +26,14 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder { private TextView funGameName; private View red_point; private boolean showRed = false; - + private View total_image_red_point; public NewRoleFunGamesChildViewHolder(@NonNull View itemView, boolean showRed) { super(itemView); this.showRed = showRed; funGamePic = itemView.findViewById(R.id.fun_game_pic); funGameName = itemView.findViewById(R.id.fun_game_name); red_point = itemView.findViewById(R.id.red_point); + total_image_red_point = itemView.findViewById(R.id.total_image_red_point); } public void setData(CustomSidebarChildModel model, boolean rigts) { @@ -49,7 +50,11 @@ public class NewRoleFunGamesChildViewHolder extends RecyclerView.ViewHolder { } funGameName.setText(model.getTitle()); - + if (TextUtils.equals(model.getTitle(), WordUtil.getNewString(com.yunbao.common.R.string.guard_guard)) && IMLoginManager.get(itemView.getContext()).getGuardRedPoint()) { + total_image_red_point.setVisibility(View.VISIBLE); + } else { + total_image_red_point.setVisibility(View.GONE); + } ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { diff --git a/common/src/main/res/layout/view_fun_games_child_view.xml b/common/src/main/res/layout/view_fun_games_child_view.xml index eebec3aef..4ac669274 100644 --- a/common/src/main/res/layout/view_fun_games_child_view.xml +++ b/common/src/main/res/layout/view_fun_games_child_view.xml @@ -1,16 +1,37 @@ - + + + + + + + - + + + + + + + - - + + + + + + + diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index 506dfb17f..9df646f63 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -548,7 +548,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi String url = CommonAppConfig.HOST + "/h5/Noble/index.html?nickname=" + u.getUserNiceName() + "&usernobId=" + u.getNoble_id() + "&token=" + CommonAppConfig.getInstance().getToken() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0"); ZhuangBanActivity.forward(mContext, url, false); } else if (i == R.id.lt_guard) { - MobclickAgent.onEvent(mContext, "my_guard", "个人中心点守護"); + MobclickAgent.onEvent(mContext, "my_guard_btn", "我的-守护点击次数及人数"); Constants.isTitle = true; UserBean u = CommonAppConfig.getInstance().getUserBean(); String url = CommonAppConfig.HOST + "/h5/Guard/index.html?token=" + CommonAppConfig.getInstance().getToken()