From 5c369f7215ee2c3b511f82a22c33c1b02fd692ef Mon Sep 17 00:00:00 2001 From: ningwenqiang Date: Tue, 22 Oct 2024 17:10:08 +0800 Subject: [PATCH] =?UTF-8?q?initHourRankList=20UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/tmp/full-r8-config.txt | 24 ++++----- .../common/bean/NewPeopleTaskModel.java | 21 +++++++- .../yunbao/common/bean/SendFreeGiftBean.java | 37 ++++++++++++++ .../com/yunbao/common/http/LiveHttpUtil.java | 11 ++++ .../com/yunbao/common/http/PDLiveApi.java | 9 ++++ config.gradle | 4 +- .../yunbao/live/dialog/LiveGiftPopup2.java | 31 ++++++------ .../yunbao/live/socket/SocketRyChatUtil.java | 16 +++--- .../yunbao/live/socket/SocketSwChatUtil.java | 16 +++--- .../yunbao/live/views/LiveRoomViewHolder.java | 50 ++++++++++++------- .../live/views/PortraitLiveManager.java | 2 +- 11 files changed, 155 insertions(+), 66 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/SendFreeGiftBean.java diff --git a/app/tmp/full-r8-config.txt b/app/tmp/full-r8-config.txt index 35a209d00..b2e167dd7 100644 --- a/app/tmp/full-r8-config.txt +++ b/app/tmp/full-r8-config.txt @@ -1,4 +1,4 @@ -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1 +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1 # This is a configuration file for ProGuard. # http://proguard.sourceforge.net/index.html#manual/usage.html # @@ -95,8 +95,8 @@ # These classes are duplicated between android.jar and core-lambda-stubs.jar. -dontnote java.lang.invoke.** -# End of content from D:\AndroidProject\pandorapan\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1 -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\proguard-rules.pro +# End of content from D:\AndroidProject\pandorapanP\app\build\intermediates\default_proguard_files\global\proguard-android.txt-8.3.1 +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\proguard-rules.pro # Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in /Users/macpro/Library/Android/sdk/tools/proguard/proguard-android.txt @@ -420,8 +420,8 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; -ignorewarnings -# End of content from D:\AndroidProject\pandorapan\app\proguard-rules.pro -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt +# End of content from D:\AndroidProject\pandorapanP\app\proguard-rules.pro +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt -keep class androidx.core.app.CoreComponentFactory { (); } -keep class androidx.core.content.FileProvider { (); } -keep class androidx.core.content.FileProvider4Utils { (); } @@ -1094,10 +1094,10 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; -keepclassmembers class * { *** videoEditClick(android.view.View); } -# End of content from D:\AndroidProject\pandorapan\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt +# End of content from D:\AndroidProject\pandorapanP\app\build\intermediates\aapt_proguard_file\link_onlineRelease\processLink_onlineReleaseResources\aapt_rules.txt +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt -# End of content from D:\AndroidProject\pandorapan\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt +# End of content from D:\AndroidProject\pandorapanP\lib_faceunity\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt # The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\8d3e3177c15403546de73d87508067d6\transformed\jetified-XPopup-2.10.0\proguard.txt # Generated keep rule for Lifecycle observer adapter. -if class com.lxj.xpopup.core.BasePopupView { @@ -1157,9 +1157,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; # End of content from C:\Users\CVB88\.gradle\caches\transforms-3\a1df9a6aa192455030f7c9970b70e0e9\transformed\material-1.4.0\proguard.txt -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt -# End of content from D:\AndroidProject\pandorapan\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt +# End of content from D:\AndroidProject\pandorapanP\lib_google\build\intermediates\consumer_proguard_dir\link_onlineRelease\exportLink_onlineReleaseConsumerProguardFiles\lib0\proguard.txt # The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\2929985d9627ba3bb45a0ebd18eaf9d3\transformed\jetified-linesdk-5.0.1\proguard.txt -keepattributes *Annotation* @@ -1510,9 +1510,9 @@ rx.internal.util.atomic.LinkedQueueNode* consumerNode; public boolean isLayoutSuppressed(); } # End of content from C:\Users\CVB88\.gradle\caches\transforms-3\e9de7db2640f13ae2ab2a585dfd19337\transformed\recyclerview-1.2.1\proguard.txt -# The proguard configuration file for the following section is D:\AndroidProject\pandorapan\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt +# The proguard configuration file for the following section is D:\AndroidProject\pandorapanP\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt -# End of content from D:\AndroidProject\pandorapan\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt +# End of content from D:\AndroidProject\pandorapanP\TabLayout\build\intermediates\consumer_proguard_dir\release\exportReleaseConsumerProguardFiles\lib0\proguard.txt # The proguard configuration file for the following section is C:\Users\CVB88\.gradle\caches\transforms-3\bb5ec4ef561b90312eb1ca52da1f144d\transformed\jetified-facebook-applinks-15.2.0\proguard.txt # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. diff --git a/common/src/main/java/com/yunbao/common/bean/NewPeopleTaskModel.java b/common/src/main/java/com/yunbao/common/bean/NewPeopleTaskModel.java index 6d45fc3e2..372a5c3c4 100644 --- a/common/src/main/java/com/yunbao/common/bean/NewPeopleTaskModel.java +++ b/common/src/main/java/com/yunbao/common/bean/NewPeopleTaskModel.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import android.util.Log; + import com.google.gson.annotations.SerializedName; public class NewPeopleTaskModel extends BaseModel { @@ -10,9 +12,12 @@ public class NewPeopleTaskModel extends BaseModel { private GiftModel gift = new GiftModel(); @SerializedName("reward_all") private RewardAllModel rewardAll = new RewardAllModel(); - @SerializedName("reward_one") + private RewardAllModel rewardOne = new RewardAllModel(); + @SerializedName("is_free_gift") + private String isFreeGift = "1"; + public TaskModel getTask() { return task; } @@ -22,6 +27,20 @@ public class NewPeopleTaskModel extends BaseModel { return this; } + public String getIsFreeGift() { + return isFreeGift; + } + + public void setIsFreeGift(String isFreeGift) { + this.isFreeGift = isFreeGift; + } + + public boolean hasFreeGift(){ + Log.i("hasFreeGift",isFreeGift); + return isFreeGift.equals("0"); + } + + public GiftModel getGift() { return gift; } diff --git a/common/src/main/java/com/yunbao/common/bean/SendFreeGiftBean.java b/common/src/main/java/com/yunbao/common/bean/SendFreeGiftBean.java new file mode 100644 index 000000000..fab7d064b --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/SendFreeGiftBean.java @@ -0,0 +1,37 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class SendFreeGiftBean extends BaseModel{ + //"code":0,"msg":"","info":[]},"msg":"" + @SerializedName("code") + private int code; + @SerializedName("msg") + private String msg; + @SerializedName("info") + private String info; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getInfo() { + return info; + } + + public void setInfo(String info) { + this.info = info; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index a72e081cf..1010eb3fd 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -625,6 +625,17 @@ public class LiveHttpUtil { .execute(callback); } + /** + * 完成新手任務 + */ + public static void setFrontTaskNew(String liveuid, HttpCallback callback) { + HttpClient.getInstance().get("tasknew.sendFreeGift", "tasknew.sendFreeGift") + .params("liveuid", liveuid) + .params("token", true) + .params("uid", true) + .execute(callback); + } + /** * 修改心愿单列表 */ 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 0cc741ee4..cf984ecbc 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -215,6 +215,15 @@ public interface PDLiveApi { @GET("/api/public/?service=Live.getHourChartRank") Observable>> getHourChartRank(@Query("liveuid") String liveuid); + + /** + * 小时榜接口 + * + * @param liveuid 直播间id + */ + @GET("/api/public/?service=Tasknew.sendFreeGift") + Observable> sendFreeGift(@Query("liveuid") String liveuid); + /** * 清除系统消息的未读数 */ diff --git a/config.gradle b/config.gradle index 0f958c871..3e8ee0d92 100644 --- a/config.gradle +++ b/config.gradle @@ -4,7 +4,7 @@ ext { buildToolsVersion: "29.0.2", minSdkVersion : 23, targetSdkVersion : 34, - versionCode : 561, + versionCode : 607, versionName : "6.8.3", namespace : "com.pandoralive.shayu" ] @@ -12,7 +12,7 @@ ext { //正式、 serverHost : "https://napi.yaoulive.com", // 测试 - testServerHost : "https://ceshi.yaoulive.com", + testServerHost : "https://ceshi.yaoulive.com", // https://ceshi.yaoulive.com https://ceshi.poyoshow.com buildTime : new Date().format("MM-dd HH:mm", TimeZone.getTimeZone("GMT+8")), //百度语音识别 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java index 9466818a7..a23399c0c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java @@ -61,6 +61,7 @@ import com.yunbao.common.event.GiftNumberEvent; import com.yunbao.common.event.LiveGiftDialogEvent; import com.yunbao.common.event.SendBlindGiftEvent; 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.http.LiveHttpUtil; @@ -108,6 +109,9 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + /** * 直播间新送礼弹窗 */ @@ -380,14 +384,14 @@ public class LiveGiftPopup2 extends AbsDialogFragment { } if (number == 0) { iterator.remove(); - }else { + } else { bean.setChecked(false); } } if (mWrapGiftList != null && !mWrapGiftList.isEmpty()) { //mWrapGiftList.get(0).setChecked(true); - mFrameGiftNewAdapter = new FrameGiftNewAdapter(mWrapGiftList, mStream, mLiveUid, "",true); + mFrameGiftNewAdapter = new FrameGiftNewAdapter(mWrapGiftList, mStream, mLiveUid, "", true); giftRecyclerView.setAdapter(mFrameGiftNewAdapter); emptyGroup.setVisibility(View.GONE); // mWrapGiftList.get(0).setChecked(true); @@ -419,7 +423,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(liveGiftSend, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - if(!liveGiftSend.isSelected()){ + if (!liveGiftSend.isSelected()) { return; } MobclickAgent.onEvent(mContext, "gif_list_seed_gif", "用户送礼物"); @@ -539,7 +543,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(giftSendBgV, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - if (liveGiftModel.getType() == 7 ) return; + if (liveGiftModel.getType() == 7) return; new XPopup.Builder(getContext()) .enableDrag(false) .asCustom(new GiftNumberPopup(getContext())) @@ -750,19 +754,14 @@ public class LiveGiftPopup2 extends AbsDialogFragment { } if (liveGiftModel.getTag() != null) { if (mCount.equals("1")) { - LiveHttpUtil.setFrontTask("sendgift", mLiveUid, new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - EventBus.getDefault().post("stop_svga_new_user_gif"); - EventBus.getDefault().post("stop_new_user_gif"); - if (code == 0) { - EventBus.getDefault().post("stop_new_user_gif1"); - } - dismiss(); + API.get().pdLiveApi(mContext).sendFreeGift(mLiveUid).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(listResponseModel -> { + EventBus.getDefault().post("stop_svga_new_user_gif"); + EventBus.getDefault().post("stop_new_user_gif"); + if (listResponseModel.getData() != null && listResponseModel.getData().getCode() == 0) { + EventBus.getDefault().post("stop_new_user_gif1"); } - }); - } else { - ToastUtil.show(mContext.getString(com.yunbao.live.R.string.only_one)); + dismiss(); + }, Throwable::printStackTrace).isDisposed(); } } else { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || liveGiftModel == null) { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java index e081551a4..9e84ec077 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -210,14 +210,14 @@ public class SocketRyChatUtil { } }); - LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - EventBus.getDefault().post("stop_svga_new_user_double1"); - } - } - }); +// LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// if (code == 0) { +// EventBus.getDefault().post("stop_svga_new_user_double1"); +// } +// } +// }); if (SocketRyClient.mSocketHandler != null) SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + ""); } diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwChatUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketSwChatUtil.java index 759833414..672703608 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwChatUtil.java @@ -210,14 +210,14 @@ public class SocketSwChatUtil { } }); - LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - EventBus.getDefault().post("stop_svga_new_user_double1"); - } - } - }); +// LiveHttpUtil.setFrontTask("illumine", new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// if (code == 0) { +// EventBus.getDefault().post("stop_svga_new_user_double1"); +// } +// } +// }); if (SocketSwClient.mSocketHandler != null) SocketSwClient.mSocketHandler.processBroadcast(msg.mResult.toString() + ""); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 5a820c1ba..afd2da45f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -554,7 +554,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { if ("svga_new_user_gif".equals(str)) { - svga_new_user_gif(); + // svga_new_user_gif(); } else if ("svga_new_user_double".equals(str)) { svga_new_user_double(); } else if ("svga_new_user_follow".equals(str)) { @@ -4832,15 +4832,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis EventBus.getDefault().post("stop_svga_new_user_follow"); - LiveHttpUtil.setFrontTask("attent", new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - isAttention = 1; - EventBus.getDefault().post("stop_svga_new_user_follow1"); - } - } - }); +// LiveHttpUtil.setFrontTask("attent", new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// if (code == 0) { +// isAttention = 1; +// EventBus.getDefault().post("stop_svga_new_user_follow1"); +// } +// } +// }); if (TextUtils.isEmpty(mLiveUid)) { return; @@ -5836,6 +5836,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void configBanner3(NewPeopleTaskModel newPeopleTask) { TaskModel taskModel = newPeopleTask.getTask(); + if (newPeopleTask.hasFreeGift()) { + IMLoginManager.get(mContext).setNewUserGif(true); + svga_new_user_gif(); + EventBus.getDefault().post("svga_new_user_gif"); + }else { + IMLoginManager.get(mContext).setNewUserGif(false); + } + if (taskModel != null) { GiftModel giftModel = newPeopleTask.getGift(); if (giftModel != null) { @@ -5850,15 +5858,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bean1.setName(giftModel.getGiftname()); bean1.setTag("1"); bean1.setPrice(WordUtil.isNewZh() ? "免费" : "free"); - if (!IMLoginManager.get(mContext).isisNewUserOne()) { - if (TextUtils.equals(taskModel.getSendgift(), "0")) { - IMLoginManager.get(mContext).setNewUserGif(true); - EventBus.getDefault().post("svga_new_user_gif"); - } - } + +// if (!IMLoginManager.get(mContext).isisNewUserOne()) { +// +// } +// if (newPeopleTask.hasFreeGift()) { +// IMLoginManager.get(mContext).setNewUserGif(true); +// svga_new_user_gif(); +// EventBus.getDefault().post("svga_new_user_gif"); +// }else { +// IMLoginManager.get(mContext).setNewUserGif(false); +// } + BannerBean banner3Bean = new BannerBean(); banner3Bean.setImageUrl("https://downs.yaoulive.com/live_Mission_box.png"); - banner3Bean.setLink(taskModel.getSendgift()); + banner3Bean.setLink(newPeopleTask.getIsFreeGift()); mBannerList3.add(banner3Bean); @@ -5872,7 +5886,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis banner3Bean2.setLink(taskModel.getIllumine()); mBannerList3.add(banner3Bean2); - if (TextUtils.equals(taskModel.getSendgift(), "0") && !IMLoginManager.get(mContext).isisNewUserOne()) { + if (newPeopleTask.hasFreeGift() && !IMLoginManager.get(mContext).isisNewUserOne()) { showBanner3(bean1); } else if (TextUtils.equals(taskModel.getAttent(), "0") && !IMLoginManager.get(mContext).isisNewUserOne()) { showBanner3(bean1); diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index f0049be33..07f88c72a 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -924,7 +924,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.firstLookLiveNotify(); } //判断是否有免费礼物 - if("0".equals(data.getNewPeopleTask().getTask().getSendgift())){ + if(data.getNewPeopleTask().hasFreeGift()){ mLiveRoomViewHolder.firstLook5MinLiveNotify(); } //观看200秒之后,推送活动入口im消息