From 91743ecd3da67e546e71bfdfefddce2caf0ca76e Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 18 Oct 2022 13:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bean/StarChallengeStatusModel.java | 17 +++++++++++++ .../yunbao/live/socket/SocketRyChatUtil.java | 3 ++- .../live/views/LiveAudienceViewHolder.java | 7 ------ .../yunbao/live/views/LiveRoomViewHolder.java | 24 +++++++++++++------ .../live/views/PortraitLiveManager.java | 20 +--------------- .../yunbao/main/activity/MainActivity.java | 2 +- 6 files changed, 38 insertions(+), 35 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java b/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java index f86e33d81..c290bd4f4 100644 --- a/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java +++ b/common/src/main/java/com/yunbao/common/bean/StarChallengeStatusModel.java @@ -138,4 +138,21 @@ public class StarChallengeStatusModel extends BaseModel { this.assistSrc = assistSrc; return this; } + + @Override + public String toString() { + return "StarChallengeStatusModel{" + + "taskNum='" + taskNum + '\'' + + ", currentStarVal='" + currentStarVal + '\'' + + ", targetStarVal='" + targetStarVal + '\'' + + ", currentAssistNum='" + currentAssistNum + '\'' + + ", targetAssistNum='" + targetAssistNum + '\'' + + ", starSrc='" + starSrc + '\'' + + ", assistSrc='" + assistSrc + '\'' + + ", taskName1='" + taskName1 + '\'' + + ", taskName2='" + taskName2 + '\'' + + ", activityUrl='" + activityUrl + '\'' + + ", type='" + type + '\'' + + '}'; + } } 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 fa35d42f5..db030593c 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyChatUtil.java @@ -215,7 +215,8 @@ public class SocketRyChatUtil { } }); - SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + ""); + if (SocketRyClient.mSocketHandler != null) + SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + ""); } @Override 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 41879b027..625a8d5a1 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -239,9 +239,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { v_msg_redpoint = (View) findViewById(R.id.v_msg_redpoint); - //获取系统未读消息 - MessageIMManager.get(mContext).getSystemMessages(); - //底部改造 ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.total_image), new ViewClicksAntiShake.ViewClicksCallBack() { @Override @@ -452,8 +449,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { */ @SuppressLint("SetTextI18n") private Bitmap canvasBitmap(int icon, String name, String text) { -// Log.e("SVGADynamicEntity", "子布局宽度:" + name); -// Log.e("SVGADynamicEntity", "fu布局宽度:" + text); //计算设备分辨率 WindowManager manager = ((Activity) mContext).getWindowManager(); DisplayMetrics metrics = new DisplayMetrics(); @@ -477,8 +472,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { view.measure(measureWidth, measureHeight); //调用layout方法布局后,可以得到view的尺寸 view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); -// Log.e("SVGADynamicEntity", "子布局宽度:" + childrenView.getWidth()); -// Log.e("SVGADynamicEntity", "fu布局宽度:" + (width / 3 * 2 - 30)); Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas bitmapCanvas = new Canvas(bitmap); bitmapCanvas.drawColor(Color.TRANSPARENT); 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 0dc6ce3f6..d546b2488 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -42,7 +42,6 @@ import com.adjust.sdk.AdjustEvent; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.blankj.utilcode.util.GsonUtils; import com.bumptech.glide.Glide; import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.engine.GlideException; @@ -76,6 +75,7 @@ import com.yunbao.common.http.API; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; @@ -1021,18 +1021,28 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator()); //主播页面隐藏头部 if (mContext instanceof LiveRyAnchorActivity) { - // findViewById(R.id.hour_rank_layout).setVisibility(View.GONE); - // findViewById(R.id.live_wks_layout).setVisibility(View.GONE); - // findViewById(R.id.wish_list_layout).setVisibility(View.GONE); - // findViewById(R.id.hour_rank_layout).setEnabled(false); - /* findViewById(R.id.live_wks_layout).setEnabled(false); - findViewById(R.id.wish_list_layout).setEnabled(false);*/ findViewById(R.id.open_sidebar).setVisibility(View.GONE); findViewById(R.id.btn_follow).setVisibility(View.GONE); } else { configBanner3(); } reloadIM(); + /** + * 获取当前直播间星级 + */ + LiveNetManager.get(mContext) + .getStarChallengeStatus(mLiveUid, new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(StarChallengeStatusModel data1) { + showStart(data1); + Log.e("PortraitLiveManager", data1.toString()); + } + + @Override + public void onError(String error) { + Log.e("PortraitLiveManager", error); + } + }); } public void showStart(StarChallengeStatusModel data) { 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 1c8021341..6452e5165 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -212,7 +212,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } @Override - public void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { + public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) { openParametersModel = new OpenParametersModel(); mContext.runOnUiThread(new Runnable() { @Override @@ -286,24 +286,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.initHourRankList(); } }); - /** - * 获取当前直播间星级 - */ - LiveNetManager.get(mContext) - .getStarChallengeStatus(mLiveBean.getUid(), new com.yunbao.common.http.base.HttpCallback() { - @Override - public void onSuccess(StarChallengeStatusModel data) { - if (mLiveRoomViewHolder != null) { - activityUrl = data.getActivityUrl(); - mLiveRoomViewHolder.showStart(data); - } - } - - @Override - public void onError(String error) { - - } - }); } @Override diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index c9d2cd4a1..8820d83af 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -1251,7 +1251,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene if (event.isTime()) { new Handler().postDelayed(() -> LiveFloatView.getInstance() .cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK(), event.getmLiveTypeVal()) - .builderFloat(mContext, event.getmLiveBean().getPull()), 1500); + .builderFloat(mContext, event.getmLiveBean().getPull()), 800); } else { new Handler().post(() -> LiveFloatView.getInstance() .cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK(), event.getmLiveTypeVal())