From f04a2865afe911ce4f2ce87ba28f32324c4fa80c Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 23 Mar 2024 16:47:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/GuardGetGuardUserInfoModel.java | 6 +- .../common/bean/GuardUserInfoModel.java | 24 ++-- .../yunbao/common/dialog/DragonRulePopup.java | 18 ++- .../common/dialog/GuardUpgradePopup.java | 22 ++-- .../com/yunbao/common/http/PDLiveApi.java | 2 +- .../common/http/live/LiveNetManager.java | 8 +- .../src/main/res/layout/dragon_rule_popup.xml | 122 ++++++++++++------ common/src/main/res/values-en-rUS/string.xml | 4 + common/src/main/res/values-zh-rHK/strings.xml | 3 + common/src/main/res/values-zh-rTW/strings.xml | 4 +- common/src/main/res/values-zh/strings.xml | 3 + common/src/main/res/values/strings.xml | 4 +- .../com/yunbao/live/bean/GuardUserModel.java | 6 +- .../live/dialog/DragonSendMoneyListPopup.java | 2 +- .../live/dialog/DragonSendsMoneyPopup.java | 2 +- .../live/dialog/LiveBuyGuardDialog.java | 11 +- .../yunbao/live/dialog/LiveGuardDialog.java | 2 + 17 files changed, 162 insertions(+), 81 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/GuardGetGuardUserInfoModel.java b/common/src/main/java/com/yunbao/common/bean/GuardGetGuardUserInfoModel.java index ce843ab70..7a8fcd48c 100644 --- a/common/src/main/java/com/yunbao/common/bean/GuardGetGuardUserInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/GuardGetGuardUserInfoModel.java @@ -29,7 +29,7 @@ public class GuardGetGuardUserInfoModel extends BaseModel { @SerializedName("guard_type") private int guardType; @SerializedName("exp") - private int exp; + private String exp; @SerializedName("level") private int level; @SerializedName("endtime") @@ -84,11 +84,11 @@ public class GuardGetGuardUserInfoModel extends BaseModel { return this; } - public int getExp() { + public String getExp() { return exp; } - public GuardGetGuardUserInfoModel setExp(int exp) { + public GuardGetGuardUserInfoModel setExp(String exp) { this.exp = exp; return this; } diff --git a/common/src/main/java/com/yunbao/common/bean/GuardUserInfoModel.java b/common/src/main/java/com/yunbao/common/bean/GuardUserInfoModel.java index 4f34f1006..07f46433f 100644 --- a/common/src/main/java/com/yunbao/common/bean/GuardUserInfoModel.java +++ b/common/src/main/java/com/yunbao/common/bean/GuardUserInfoModel.java @@ -27,13 +27,13 @@ public class GuardUserInfoModel extends BaseModel { @SerializedName("live_avatar") private String liveAvatar; @SerializedName("guard_type") - private int guardType; + private String guardType; @SerializedName("exp") - private int exp; + private String exp; @SerializedName("level") - private int level; + private String level; @SerializedName("endtime") - private int endtime; + private String endtime; @SerializedName("user_language") private String userLanguage; @SerializedName("live_language") @@ -75,38 +75,38 @@ public class GuardUserInfoModel extends BaseModel { return this; } - public int getGuardType() { + public String getGuardType() { return guardType; } - public GuardUserInfoModel setGuardType(int guardType) { + public GuardUserInfoModel setGuardType(String guardType) { this.guardType = guardType; return this; } - public int getExp() { + public String getExp() { return exp; } - public GuardUserInfoModel setExp(int exp) { + public GuardUserInfoModel setExp(String exp) { this.exp = exp; return this; } - public int getLevel() { + public String getLevel() { return level; } - public GuardUserInfoModel setLevel(int level) { + public GuardUserInfoModel setLevel(String level) { this.level = level; return this; } - public int getEndtime() { + public String getEndtime() { return endtime; } - public GuardUserInfoModel setEndtime(int endtime) { + public GuardUserInfoModel setEndtime(String endtime) { this.endtime = endtime; return this; } diff --git a/common/src/main/java/com/yunbao/common/dialog/DragonRulePopup.java b/common/src/main/java/com/yunbao/common/dialog/DragonRulePopup.java index 65678bb32..8babfe15e 100644 --- a/common/src/main/java/com/yunbao/common/dialog/DragonRulePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/DragonRulePopup.java @@ -1,6 +1,7 @@ package com.yunbao.common.dialog; import android.content.Context; +import android.widget.LinearLayout; import androidx.annotation.NonNull; @@ -9,8 +10,14 @@ import com.yunbao.common.R; import com.yunbao.common.views.weight.ViewClicksAntiShake; public class DragonRulePopup extends CenterPopupView { - public DragonRulePopup(@NonNull Context context) { + LinearLayout list_no; + LinearLayout list; + + boolean isList; + + public DragonRulePopup(@NonNull Context context, boolean isList) { super(context); + this.isList = isList; } // 返回自定义弹窗的布局 @@ -23,6 +30,15 @@ public class DragonRulePopup extends CenterPopupView { @Override protected void onCreate() { super.onCreate(); + list_no = findViewById(R.id.list_no); + list = findViewById(R.id.list); + if (!isList){ + list_no.setVisibility(VISIBLE); + list.setVisibility(GONE); + }else { + list_no.setVisibility(GONE); + list.setVisibility(VISIBLE); + } ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.dragon_close), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { diff --git a/common/src/main/java/com/yunbao/common/dialog/GuardUpgradePopup.java b/common/src/main/java/com/yunbao/common/dialog/GuardUpgradePopup.java index 07a486aa1..377ea49eb 100644 --- a/common/src/main/java/com/yunbao/common/dialog/GuardUpgradePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/GuardUpgradePopup.java @@ -68,15 +68,15 @@ public class GuardUpgradePopup extends CenterPopupView { leave_hint.setText(hintStringBuffer.toString()); if (mUpgradesModel.getRewards().size() > 0) { if (mUpgradesModel.getRewards().size() == 1) { - rewards_line1.setVisibility(GONE); + rewards_line1.setVisibility(INVISIBLE); rewards_line2.setVisibility(VISIBLE); - rewards_line3.setVisibility(GONE); + rewards_line3.setVisibility(INVISIBLE); RewardsModel rewardsModel = mUpgradesModel.getRewards().get(0); ImgLoader.display(getContext(), rewardsModel.getImagePath(), rewards_img2); rewards_text2.setText(rewardsModel.getRewardName()); } else if (mUpgradesModel.getRewards().size() == 2) { rewards_line1.setVisibility(VISIBLE); - rewards_line2.setVisibility(GONE); + rewards_line2.setVisibility(INVISIBLE); rewards_line3.setVisibility(VISIBLE); RewardsModel rewardsModel1 = mUpgradesModel.getRewards().get(0); RewardsModel rewardsModel3 = mUpgradesModel.getRewards().get(1); @@ -104,22 +104,22 @@ public class GuardUpgradePopup extends CenterPopupView { ImgLoader.display(getContext(), rewardsModel3.getImagePath(), rewards_img3); rewards_text3.setText(rewardsModel3.getRewardName()); } else { - rewards_line1.setVisibility(GONE); - rewards_line2.setVisibility(GONE); - rewards_line3.setVisibility(GONE); + rewards_line1.setVisibility(INVISIBLE); + rewards_line2.setVisibility(INVISIBLE); + rewards_line3.setVisibility(INVISIBLE); } } else { - rewards_line1.setVisibility(GONE); - rewards_line2.setVisibility(GONE); - rewards_line3.setVisibility(GONE); + rewards_line1.setVisibility(INVISIBLE); + rewards_line2.setVisibility(INVISIBLE); + rewards_line3.setVisibility(INVISIBLE); } ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.confirm), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { LiveNetManager.get(getContext()) - .guardGetRewards(mLiveUid,new HttpCallback() { + .guardGetRewards(mUpgradesModel.getLevel(), mLiveUid, new HttpCallback() { @Override - public void onSuccess(CheckUpgradesModel data) { + public void onSuccess(Object data) { dismiss(); } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 166786ecc..c656fedea 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -1190,5 +1190,5 @@ public interface PDLiveApi { @GET("/api/public/?service=Guard.checkUpgrades") Observable> checkUpgrades(@Query("liveuid") String liveUid); @GET("/api/public/?service=Guard.getRewards") - Observable> guardGetRewards(@Query("type") String type,@Query("liveuid") String liveUid); + Observable> guardGetRewards(@Query("guard_level") String guardLevel,@Query("liveuid") String liveUid); } diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 97d251db9..cc59dd6f7 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -3136,14 +3136,14 @@ public class LiveNetManager { } - public void guardGetRewards(String liveUid, HttpCallback callback) { + public void guardGetRewards(String guardLevel,String liveUid, HttpCallback callback) { API.get().pdLiveApi(mContext) - .guardGetRewards("2", liveUid) + .guardGetRewards(guardLevel, liveUid) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(new Consumer>() { + .subscribe(new Consumer>() { @Override - public void accept(ResponseModel listResponseModel) throws Exception { + public void accept(ResponseModel listResponseModel) throws Exception { if (callback != null) { callback.onSuccess(listResponseModel.getData().getInfo()); } diff --git a/common/src/main/res/layout/dragon_rule_popup.xml b/common/src/main/res/layout/dragon_rule_popup.xml index d83b99982..fbdffa72a 100644 --- a/common/src/main/res/layout/dragon_rule_popup.xml +++ b/common/src/main/res/layout/dragon_rule_popup.xml @@ -39,51 +39,97 @@ android:layout_height="wrap_content"> + android:layout_width="match_parent" + android:layout_height="wrap_content"> - + + + + + + + + + + + + android:orientation="vertical"> - + - + - + + + + diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 9f552bd6c..1718923b3 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -1479,6 +1479,7 @@ Limited ride And limited avatar frame "1. Dragon's Wealth is a benefit that you provide to the audience of the live room after activating the 【God Guardian】. You can choose to customize the number of golden beans and summon Dragon God to divide the profits among the fans of the live broadcast room (the number of golden beans is not less than 1000), or you can choose not to activate the activity; " "2. The consumption of gold beans this time will be included in the guardian contribution value and experience value growth. For every 10 gold beans provided, 1 contribution value will be obtained, which can be used to increase the guardian level; " "3. Users who follow the anchor and participate in activities will receive the benefits you provide after a five minute countdown; " + 4. The final interpretation of this activity belongs to PDLIVE. Participate Renew now to extend guardian privileges\n @@ -1496,4 +1497,7 @@ Limited ride And limited avatar frame Send benefits (The original protection level will be retained, and the remaining validity period will be added to the new protection validity period according to the rules) We are currently unable to activate this guard. Please try again after the current guard expires + 1.Dragon\'s Wealth is a free golden bean benefit provided to live stream viewers by users who have activated the 【God Guardian】 feature; + 2.Users who follow the anchor and participate in the activity will divide the gold beans of the activity after the countdown of five minutes ends; + 3.The final interpretation of this activity belongs to PDLIVE. diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 8d471916f..a87458cbf 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1495,4 +1495,7 @@ 發放福利 (原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中) 暫時無法開通該守護,請當前守護到期後嘗試 + 1.神龍送財是開通【神之守護】的用戶給予直播間觀眾的免費金豆福利; + 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; + 3.此活動的最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 0ec599fa3..3bf3b8c6f 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1494,5 +1494,7 @@ 發放福利 (原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中) 暫時無法開通該守護,請當前守護到期後嘗試 - + 1.神龍送財是開通【神之守護】的用戶給予直播間觀眾的免費金豆福利; + 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; + 3.此活動的最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index 2dd80b96e..89318d1f2 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1491,5 +1491,8 @@ 發放福利 (原有的守護等級將會保留,剩餘有效期將按規則補充至新守護有效期中) 暫時無法開通該守護,請當前守護到期後嘗試 + 1.神龍送財是開通【神之守護】的用戶給予直播間觀眾的免費金豆福利; + 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; + 3.此活動的最終解釋權歸PDLIVE所有。 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index be3703a27..781f9e1bd 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1500,5 +1500,7 @@ Limited ride And limited avatar frame Send benefits (The original protection level will be retained, and the remaining validity period will be added to the new protection validity period according to the rules) We are currently unable to activate this guard. Please try again after the current guard expires - + 1.Dragon\'s Wealth is a free golden bean benefit provided to live stream viewers by users who have activated the 【God Guardian】 feature; + 2.Users who follow the anchor and participate in the activity will divide the gold beans of the activity after the countdown of five minutes ends; + 3.The final interpretation of this activity belongs to PDLIVE. diff --git a/live/src/main/java/com/yunbao/live/bean/GuardUserModel.java b/live/src/main/java/com/yunbao/live/bean/GuardUserModel.java index f4aaaa0b5..798b29154 100644 --- a/live/src/main/java/com/yunbao/live/bean/GuardUserModel.java +++ b/live/src/main/java/com/yunbao/live/bean/GuardUserModel.java @@ -43,7 +43,7 @@ public class GuardUserModel extends BaseModel { @SerializedName("guard_type") private int guardType; @SerializedName("guard_exp") - private int guardExp; + private String guardExp; @SerializedName("guard_level") private int guardLevel; @SerializedName("guard_name") @@ -141,11 +141,11 @@ public class GuardUserModel extends BaseModel { return this; } - public int getGuardExp() { + public String getGuardExp() { return guardExp; } - public GuardUserModel setGuardExp(int guardExp) { + public GuardUserModel setGuardExp(String guardExp) { this.guardExp = guardExp; return this; } diff --git a/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java b/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java index 1b400ae38..090aae4bf 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonSendMoneyListPopup.java @@ -120,7 +120,7 @@ public class DragonSendMoneyListPopup extends AbsDialogPopupWindow { @Override public void onViewClicks() { new XPopup.Builder(getContext()) - .asCustom(new DragonRulePopup(getContext())) + .asCustom(new DragonRulePopup(getContext(),true)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java b/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java index 355f25941..6d4593949 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonSendsMoneyPopup.java @@ -56,7 +56,7 @@ public class DragonSendsMoneyPopup extends CenterPopupView { @Override public void onViewClicks() { new XPopup.Builder(getContext()) - .asCustom(new DragonRulePopup(getContext())) + .asCustom(new DragonRulePopup(getContext(),false)) .show(); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java index 383d25321..23c37da90 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java @@ -203,7 +203,9 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { }); buyGuardBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override - public void onPageScrolled(int i, float v, int i1) { + public void onPageScrolled(int position, float v, int i1) { + BuyGuardBannerModel guardBannerModel = buyGuardBannerModels.get(position); + Log.e("LiveBuyGuardDialog", "onPageScrolled name = " + guardBannerModel.getName() + " position=" + position); } @Override @@ -211,7 +213,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { BuyGuardBannerModel guardBannerModel = buyGuardBannerModels.get(position); dataTipModel = guardDataTipModels.get(position); price = dataTipModel.getPrice(); - Log.e("LiveBuyGuardDialog", "name = " + guardBannerModel.getName() + " position=" + position); + Log.e("LiveBuyGuardDialog", "onPageSelected BuyGuardBannerModel name = " + guardBannerModel.getName() + " position=" + position); if (position == 0) { MobclickAgent.onEvent(mContext, "star_guardian_people", "星之守护页面观看次数及人数"); bottomPanel.setBackgroundResource(R.drawable.bg_star_guard_bottom_panel); @@ -266,8 +268,9 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { } @Override - public void onPageScrollStateChanged(int i) { - + public void onPageScrollStateChanged(int position) { + BuyGuardBannerModel guardBannerModel = buyGuardBannerModels.get(position); + Log.e("LiveBuyGuardDialog", "onPageScrollStateChanged name = " + guardBannerModel.getName() + " position=" + position); } }); diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java index 021bf0750..dd2ddaea2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java @@ -269,6 +269,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { ViewClicksAntiShake.clicksAntiShake(guardianTask, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "my_guard_task_num", "守护任务页面访问次数和人数"); StringBuffer htmlUrl = new StringBuffer(); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); htmlUrl.append(CommonAppConfig.HOST) @@ -293,6 +294,7 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { ViewClicksAntiShake.clicksAntiShake(myGraudGrade, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + MobclickAgent.onEvent(mContext, "my_guard_level_num", "我的等级页面访问次数和人数"); dismiss(); StringBuffer htmlUrl = new StringBuffer(); IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();