From 30902825d6e8fcc0221281aa400b24fcce1d4003 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 28 Oct 2022 17:51:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E6=96=B0=E4=BA=BA=E7=89=B9?= =?UTF-8?q?=E6=83=A0=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=BB=8Ebanner=E8=BF=9B?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E9=9C=80=E8=A6=81=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=96=B0=E4=BA=BA=E7=89=B9=E6=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/views/LiveAudienceViewHolder.java | 31 ++++++++++++++++++- 1 file changed, 30 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 8d08fa345..046653d28 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -32,8 +32,10 @@ import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; +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.utils.Bus; @@ -60,6 +62,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. * 观众直播间逻辑 @@ -458,7 +463,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { */ public void openNewPeopleDialog() { if (newPeopleUrl == null) { -// getNewPeopleInfo(true); + getNewPeopleInfo(true); return; } Bundle bundle = new Bundle(); @@ -474,6 +479,30 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); } + public void getNewPeopleInfo(boolean show) { + 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); + if (peopleInfo.getLink().startsWith("http")) { + newPeopleUrl = peopleInfo.getLink() + "?"; + } else { + newPeopleUrl = CommonAppConfig.HOST + "/" + peopleInfo.getLink(); + } + setUserPreferentialRedDot(peopleInfo.getShowRed() == 1); + if (show) { + openNewPeopleDialog(); + } + } else { + liveNewPeople.setVisibility(View.GONE); + } + }, Throwable::printStackTrace).isDisposed(); + } + /** * 观众打开主播的整蛊惑单窗口 */