diff --git a/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java b/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java index 7b30b9fe8..aed65c08f 100644 --- a/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java +++ b/live/src/main/java/com/yunbao/live/http/LiveHttpUtil.java @@ -906,4 +906,13 @@ public class LiveHttpUtil { .params("", anchor_id) .execute(callback); } + /** + * 获取用户贵族喇叭的数量 + */ + public static void getStarChallengeStatus(String liveUid,HttpCallback callback) { + HttpClient.getInstance().get("StarChallenge.getStarChallengeStatus", "StarChallengeStatus") + .params("liveUid", liveUid) + .execute(callback); + } + } 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 d546b2488..3d222bc1b 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -717,7 +717,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (!SpUtil.getInstance().getBooleanValue("private_chat_message_switch")) { msgLayout.setVisibility(View.GONE); } - if(!IMLoginManager.get(mContext).hintChat()){ + if (!IMLoginManager.get(mContext).hintChat()) { msgLayout.setVisibility(View.VISIBLE); } mHandler = new Handler() { @@ -1031,7 +1031,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 获取当前直播间星级 */ LiveNetManager.get(mContext) - .getStarChallengeStatus(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { + .getStarChallengeStatus(PortraitLiveManager.liveID, new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(StarChallengeStatusModel data1) { showStart(data1); @@ -1046,17 +1046,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void showStart(StarChallengeStatusModel data) { - boolean star = false; - if (mBannerList2 == null) { + boolean upData = false; + if (mBannerList2 == null || mBannerList2.size() == 0) { mBannerList2 = new ArrayList<>(); + BannerBean bannerBean = new BannerBean(); + bannerBean.setStart(true); + bannerBean.setModel(data); + mBannerList2.add(bannerBean); } else { for (BannerBean bean : mBannerList2) { if (bean.isStart()) { - star = true; bean.setModel(data); + upData = true; } } - if (!star) { + if (!upData) { BannerBean bannerBean = new BannerBean(); bannerBean.setStart(true); bannerBean.setModel(data); @@ -1064,7 +1068,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } - mBanner2.update(mBannerList2); + + Log.e("PortraitLiveManager", "mBanner2.isStart():::::::::::" + mBanner2.isStart()); + if (mBanner2.isStart()) { + mBanner2.update(mBannerList2); + } else { + showBanner2(); + } + } public void hideFloatMsg() { @@ -1073,11 +1084,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private void showBanner2() { if (mBannerList2 == null || mBannerList2.size() == 0 || mBanner2 == null) { + Log.e("PortraitLiveManager", "加载不了"); return; } btn_event2.setVisibility(View.VISIBLE); if (mBannerList2.size() == 1) { + mBanner2.setAutoPlay(false) .setPages(mBannerList2, new CustomViewHolder()) .setDelayTime(3000) 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 6452e5165..dcf1bc40a 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -49,7 +49,6 @@ import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; -import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DialogUitl; @@ -286,6 +285,15 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.initHourRankList(); } }); + +// LiveHttpUtil.getStarChallengeStatus(mLiveBean.getUid(), new HttpCallback() { +// @Override +// public void onSuccess(int code, String msg, String[] info) { +// Log.e("PortraitLiveManager",info[0]); +// StarChallengeStatusModel model = GsonUtils.fromJson(info[0], StarChallengeStatusModel.class); +// mLiveRoomViewHolder.showStart(model); +// } +// }); } @Override @@ -295,6 +303,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE); CommonHttpUtil.cancel(CommonHttpConsts.GET_BALANCE); CommonHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST); + CommonHttpUtil.cancel("StarChallengeStatus"); IMLoginManager.get(mContext).setisNewUserOne(false); //子线程执行退出操作 exitLiveRoom();