From 983bb2837aa7cacc24bc920892856385d3a511f4 Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Wed, 4 Sep 2024 14:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/activity/LiveSwAnchorActivity.java | 2 +- .../yunbao/live/socket/SocketSwClient.java | 8 ++- .../yunbao/live/views/LiveEndViewHolder.java | 12 +++- .../yunbao/live/views/LiveRoomViewHolder.java | 62 +++++++++++-------- .../live/views/PortraitLiveManager.java | 8 +-- 5 files changed, 55 insertions(+), 37 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index 9ffffe5c7..4dbfe3cf9 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -834,7 +834,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveRoomViewHolder.setLiveInfo(mLiveUid, mStream, obj.getIntValue("userlist_time") * 1000); mLiveRoomViewHolder.setVotes(obj.getString("votestotal")); mLiveRoomViewHolder.setMedaRankNum(obj.getString("medalRankNum")); - mLiveRoomViewHolder.setShowTask(obj.getString("new_task_url"),obj.getIntValue("is_new_live")==1); + //mLiveRoomViewHolder.setShowTask(obj.getString("new_task_url"),obj.getIntValue("is_new_live")==1); mLiveRoomViewHolder.startFace(); UserBean u = CommonAppConfig.getInstance().getUserBean(); if (u != null) { diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index bf101f505..7a6120fa3 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -800,11 +800,15 @@ public class SocketSwClient { .setObject(WordUtil.isNewZh() ? item.getString("text") : item.getString("text_en"))); case Constants.SOCKET_SEND_NEW_TASK_PUSH: item = map.getJSONObject("ct"); - Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_AUTHOR_NEW_TASK_PUSH).setUid(item.getString("uid")).setHrefUrl(item.getString("href"))); + if(CommonAppConfig.getInstance().getUid().equals(item.getString("uid"))){ + Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_AUTHOR_NEW_TASK_PUSH).setUid(item.getString("uid")).setHrefUrl(item.getString("href"))); + } break; case Constants.SOCKET_SEND_NEW_TASK_IM: item = map.getJSONObject("ct"); - Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_AUTHOR_GIFT_PUSH).setUid(item.getString("uid")).setHrefUrl(item.getString("href"))); + if(CommonAppConfig.getInstance().getUid().equals(item.getString("uid"))){ + Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_AUTHOR_GIFT_PUSH).setUid(item.getString("uid")).setHrefUrl(item.getString("href"))); + } break; } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java index 9901eb018..53bf9d2be 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -377,6 +377,9 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList } if(anchor_level!=null){ long levelExp = Long.parseLong(next_level_exp); + if(Integer.parseInt(level_up)==0){ + levelExp = 0; + } String tips = mContext.getResources().getString(R.string.live_user_level_anchor) +"Lv."+level+" | "+(WordUtil.isNewZh()?"差 "+levelExp+" 經驗升級":levelExp+" experience points to level up"); anchor_level.setText(tips); @@ -411,8 +414,13 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList @Override public void run() { if(level_up!=null&&votestotal!=null){ - level_progress.setMax(Integer.parseInt(level_up)); - level_progress.setProgress(Integer.parseInt(votestotal)); + if(Integer.parseInt(level_up)==0){ + level_progress.setMax(1); + level_progress.setProgress(1); + }else{ + level_progress.setMax(Integer.parseInt(level_up)); + level_progress.setProgress(Integer.parseInt(votestotal)); + } } } }); 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 e815e1a9f..47a4b9afa 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1218,7 +1218,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void showH5Dialog() { Bundle bundle = new Bundle(); - bundle.putString("url", CommonAppConfig.HOST + "/h5/activity/pdlNewUes/index.html?uid="+CommonAppConfig.getInstance().getUid()+"&token="+CommonAppConfig.getInstance().getToken()); + bundle.putString("url", CommonAppConfig.HOST + "/h5/activity/pdlNewUes/index.html?uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()); LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle); fragment.show(((LiveActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); @@ -3125,7 +3125,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis });*/ } - public void showLiveRoomActivityBanner() { + public void showLiveRoomActivityBanner(boolean isNewPersonAn) { LiveNetManager.get(mContext).getLiveRoomActivityBanner(new com.yunbao.common.http.base.HttpCallback>() { @Override public void onSuccess(List data) { @@ -3142,6 +3142,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis bean.setShow_type(datum.getType()); mBannerList4.add(bean); } + if (isNewPersonAn) { + BannerBean bean = new BannerBean(); + bean.setActivityId(511); + mBannerList4.add(bean); + } showBanner4(); } @@ -5017,7 +5022,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis */ public void firstLook5MinLiveNotify() { if (mLiveRoomHandler != null) { - mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_LOOK_5_MIN_LIVE, getNextTime(1000 *60* 5)); + mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_LOOK_5_MIN_LIVE, getNextTime(1000 * 60 * 5)); } } @@ -5046,6 +5051,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis */ public void setNewPersonTask() { newPersonTask.setVisibility(View.VISIBLE); + } private long getNextTime(int time) { @@ -5530,30 +5536,34 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onBannerClick(List datas, int p) { - if (mBannerList4.get(p).getLink().equals("BattlePass") || mBannerList4.get(p).getType() == 888) { - RouteUtil.forwardBattlePass(); - return; - } - if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())) { - - Map map_ekv = new HashMap(); - map_ekv.put("link", mBannerList4.get(p).getLink()); - MobclickAgent.onEvent(mContext, "live_room_first_charge", map_ekv); - } - Log.i("debug", "onBannerClick: " + mBannerList4.get(p).toString()); - BannerBean bean = mBannerList4.get(p); - if (showLoadingDialog()) { - return; - } - if (bean.getActivityId() == -1) {//-1写死跳活动弹窗 - Bus.get().post(new LiveAudienceEvent().setActivity(true).setType(LiveAudienceEvent.LiveAudienceType.BOTTOM_COLLECTION)); - } else if (bean.getActivityId() == 0) { - openWebDialog(bean.getLink()); + if (mBannerList4.get(p).getActivityId() == 511) { + showH5Dialog(); } else { - LiveGameDialogFragment fragment = new LiveGameDialogFragment("1".equals(bean.getShow_type())); - fragment.setActivityId(bean.getActivityId()); - fragment.setRoomId(mLiveUid); - fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment"); + if (mBannerList4.get(p).getLink().equals("BattlePass") || mBannerList4.get(p).getType() == 888) { + RouteUtil.forwardBattlePass(); + return; + } + if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())) { + + Map map_ekv = new HashMap(); + map_ekv.put("link", mBannerList4.get(p).getLink()); + MobclickAgent.onEvent(mContext, "live_room_first_charge", map_ekv); + } + Log.i("debug", "onBannerClick: " + mBannerList4.get(p).toString()); + BannerBean bean = mBannerList4.get(p); + if (showLoadingDialog()) { + return; + } + if (bean.getActivityId() == -1) {//-1写死跳活动弹窗 + Bus.get().post(new LiveAudienceEvent().setActivity(true).setType(LiveAudienceEvent.LiveAudienceType.BOTTOM_COLLECTION)); + } else if (bean.getActivityId() == 0) { + openWebDialog(bean.getLink()); + } else { + LiveGameDialogFragment fragment = new LiveGameDialogFragment("1".equals(bean.getShow_type())); + fragment.setActivityId(bean.getActivityId()); + fragment.setRoomId(mLiveUid); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGameDialogFragment"); + } } } 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 6a58ce71b..d5f5640c0 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -2328,17 +2328,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void setNewTaskPush(String uid,String url) { if (mLiveRoomViewHolder != null) { - if(CommonAppConfig.getInstance().getUid().equals(uid)){ - mLiveRoomViewHolder.showTaskDetailsNotify1(url); - } + mLiveRoomViewHolder.showTaskDetailsNotify1(url); } } public void setNewTaskIM(String uid) { if (mLiveRoomViewHolder != null) { - if(CommonAppConfig.getInstance().getUid().equals(uid)){ - mLiveRoomViewHolder.showSendGiftTaskIMMsg(); - } + mLiveRoomViewHolder.showSendGiftTaskIMMsg(); } }