From fce2907b8f74af4a5b9baff9db35a7e39729fff0 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 23 Aug 2022 16:05:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?add:=E7=82=B9=E5=87=BB=E6=96=B0=E4=BA=BA?= =?UTF-8?q?=E7=89=B9=E6=83=A0=E6=8C=89=E9=92=AE=E5=BC=B9=E7=AA=97=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=9B=BA=E5=AE=9A=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/views/LiveAudienceViewHolder.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 42d550077..62c9d7718 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -191,6 +191,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { svga_station_horn = (SVGAImageView) findViewById(R.id.svga_station_horn); viewFlipper = (ViewFlipper) findViewById(R.id.viewflipper_banner); stationHornBanner = findViewById(R.id.station_horn_banner); + liveNewPeople.setOnClickListener(this); svga_new_user_double.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -384,6 +385,13 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { openZGListWindow(); } else if (i == R.id.lt_trickery) { showTrickeryDialog(); + }else if (i==R.id.live_new_people){ + Bundle bundle=new Bundle(); + bundle.putString("url", "https://ceshi.yaoulive.com/h5/activity/1diamondLottery/index.html"); + bundle.putInt("show_type", 0); + LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); + liveHDDialogFragment.setArguments(bundle); + liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); } } From 23f765230b2fc590c1c6d2f916db6a556eb51b8d Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 23 Aug 2022 16:45:14 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=96=B0=E4=BA=BA?= =?UTF-8?q?=E7=89=B9=E6=83=A0=E9=A1=B5=E9=9D=A2=E6=B2=A1=E6=9C=89=E4=BC=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/views/LiveAudienceViewHolder.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 62c9d7718..d35ce79da 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -387,7 +387,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { showTrickeryDialog(); }else if (i==R.id.live_new_people){ Bundle bundle=new Bundle(); - bundle.putString("url", "https://ceshi.yaoulive.com/h5/activity/1diamondLottery/index.html"); + String url= CommonAppConfig.HOST+"/h5/activity/1diamondLottery/index.html?g=Appapi&m=Turntable&a=tricky"; + url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; + bundle.putString("url", url); bundle.putInt("show_type", 0); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); liveHDDialogFragment.setArguments(bundle); From 7f762189df4e2c6571d99a4f9180b7f6727b2b10 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 23 Aug 2022 17:38:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?update:=E9=BB=98=E8=AE=A4=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E6=96=B0=E4=BA=BA=E7=89=B9=E6=83=A0=E5=85=A5=E5=8F=A3=20update?= =?UTF-8?q?:=E6=9B=B4=E6=96=B0=E6=96=B0=E4=BA=BA=E7=89=B9=E6=83=A0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/NewPeopleInfo.java | 62 +++++++++++++++++++ .../com/yunbao/common/http/PDLiveApi.java | 8 +++ .../live/views/LiveAudienceViewHolder.java | 25 +++++++- .../main/res/layout/view_live_audience.xml | 2 + 4 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/NewPeopleInfo.java diff --git a/common/src/main/java/com/yunbao/common/bean/NewPeopleInfo.java b/common/src/main/java/com/yunbao/common/bean/NewPeopleInfo.java new file mode 100644 index 000000000..e5a548232 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/NewPeopleInfo.java @@ -0,0 +1,62 @@ +package com.yunbao.common.bean; + +import androidx.annotation.NonNull; + +import com.google.gson.annotations.SerializedName; + +/** + * 直播间新人特惠入口信息 + */ +public class NewPeopleInfo extends BaseModel{ + @SerializedName("charge_hidden") + private int chargeHidden; + @SerializedName("one_coin_show") + private int oneCoinShow; + @SerializedName("is_show") + private int isShow;//是否展示入口 + @SerializedName("link") + private String link;//入口地址 + + public boolean getChargeHidden() { + return chargeHidden==1; + } + + public void setChargeHidden(int chargeHidden) { + this.chargeHidden = chargeHidden; + } + + public boolean getOneCoinShow() { + return oneCoinShow==1; + } + + public void setOneCoinShow(int oneCoinShow) { + this.oneCoinShow = oneCoinShow; + } + + public boolean getIsShow() { + return isShow==1; + } + + public void setIsShow(int isShow) { + this.isShow = isShow; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + + @NonNull + @Override + public String toString() { + return "NewPeopleInfo{" + + "chargeHidden=" + chargeHidden + + ", oneCoinShow=" + oneCoinShow + + ", isShow=" + isShow + + ", link='" + link + '\'' + + '}'; + } +} 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 ce10c9128..97998d2db 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -7,6 +7,7 @@ import com.yunbao.common.bean.ContributeModel; import com.yunbao.common.bean.FaceBookUpModel; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LiveInfoModel; +import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SetAttentsModel; @@ -162,4 +163,11 @@ public interface PDLiveApi { */ @GET("/api/public/?service=Contribute.index") Observable> getRanksList(@Query("uid")String uid); + + /** + * 直播间新人特惠信息 + * @return 新人特惠数据 + */ + @GET("/api/public/?service=Live.newUserPreferential") + Observable> getNewPeopleInfo(); } 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 d35ce79da..4ea8cb93e 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -33,9 +33,10 @@ import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.MsgModel; -import com.yunbao.live.event.LiveAudienceEvent; +import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.event.MessageIMEvent; 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.imrongcloud.MessageIMManager; @@ -50,6 +51,7 @@ import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.dialog.LiveHDDialogFragment; import com.yunbao.live.dialog.LiveMicUserDialogFragment; import com.yunbao.live.dialog.LivePromotionDialogFragment; +import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpUtil; import org.greenrobot.eventbus.EventBus; @@ -58,6 +60,9 @@ import org.greenrobot.eventbus.ThreadMode; import java.util.Locale; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; + /** * Created by cxf on 2018/10/9. * 观众直播间逻辑 @@ -78,6 +83,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { private int icon = 0; private String nobleName, nobleTtext; private ImageView giftImage, liveNewPeople; + private String newPeopleUrl=null; public LiveAudienceViewHolder(Context context, ViewGroup parentView) { super(context, parentView); @@ -356,7 +362,20 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { LiveRoomViewHolder.insertChat(lvBean2, 1); } }, 10000);//3秒后执行Runnable中的run方法 - + getNewPeopleInfo(); + } + public void getNewPeopleInfo(){ + API.get().pdLiveApi(mContext) + .getNewPeopleInfo() + .subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(stringResponseModel -> { + NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo(); + if(peopleInfo.getIsShow()){ + liveNewPeople.setVisibility(View.VISIBLE); + newPeopleUrl=peopleInfo.getLink(); + } + }).isDisposed(); } @Override @@ -387,7 +406,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { showTrickeryDialog(); }else if (i==R.id.live_new_people){ Bundle bundle=new Bundle(); - String url= CommonAppConfig.HOST+"/h5/activity/1diamondLottery/index.html?g=Appapi&m=Turntable&a=tricky"; + String url= newPeopleUrl+"?g=Appapi&m=Turntable&a=tricky"; url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid; bundle.putString("url", url); diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index deeef0d45..8a0bbe024 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -1,6 +1,7 @@ @@ -460,6 +461,7 @@ android:layout_marginEnd="16dp" android:layout_toStartOf="@id/gift_image" android:padding="4dp" + android:visibility="gone" android:src="@mipmap/live_icon_newpeople_en" /> From c9344c2080e9aac9b5b92be564e0ad0b19c7b49e Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 23 Aug 2022 17:46:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?del=EF=BC=9A=E7=A7=BB=E9=99=A4xml=E4=B8=8A?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E7=9A=84=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/view_live_audience.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/live/src/main/res/layout/view_live_audience.xml b/live/src/main/res/layout/view_live_audience.xml index 8a0bbe024..a37447338 100644 --- a/live/src/main/res/layout/view_live_audience.xml +++ b/live/src/main/res/layout/view_live_audience.xml @@ -1,7 +1,6 @@