From 1d50f8e4f5987e8543f90ded31cc5ef3662673f1 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 16 Nov 2022 17:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E4=BF=AE=E6=94=B9,?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E5=85=B3=E6=92=AD=E9=A1=B5=E9=9D=A2BUg?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/utils/RouteUtil.java | 4 +- .../views/DrawerRecommendChildViewHolder.java | 2 +- .../views/DrawerRecommendViewHolder.java | 2 +- .../views/DrawerTaskChildViewHolder.java | 23 +++++++-- .../common/views/DrawerTaskViewHolder.java | 2 +- .../common/views/FunGamesChildViewHolder.java | 2 +- .../common/views/FunGamesViewHolder.java | 2 +- .../src/main/res/mipmap-xxhdpi/icon_012x.png | Bin 0 -> 1499 bytes .../src/main/res/mipmap-xxhdpi/icon_022x.png | Bin 0 -> 1243 bytes .../src/main/res/mipmap-xxhdpi/icon_032x.png | Bin 0 -> 1195 bytes .../src/main/res/mipmap-xxhdpi/icon_042x.png | Bin 0 -> 1253 bytes .../src/main/res/mipmap-xxhdpi/icon_052x.png | Bin 0 -> 1212 bytes config.gradle | 4 +- .../live/activity/LiveAudienceActivity.java | 5 +- .../live/activity/WebViewActivityMedal.java | 3 ++ .../com/yunbao/live/dialog/VoiceDialog.java | 43 ++++++++--------- .../live/event/LiveRoomChangeEvent.java | 10 ++++ .../live/views/LiveAudienceViewHolder.java | 44 +++++++++--------- .../yunbao/live/views/LiveEndViewHolder.java | 14 ++---- .../live/views/PortraitLiveManager.java | 43 ++++++++++++++--- live/src/main/res/layout/view_live_end.xml | 4 +- 21 files changed, 132 insertions(+), 75 deletions(-) create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_012x.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_022x.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_032x.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_042x.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_052x.png diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 738227174..9af0bfdd2 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -100,6 +100,7 @@ public class RouteUtil { } Constants.myUrl = url + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&t=" + System.currentTimeMillis(); ARouter.getInstance().build(PATH_MYWEBVIEWACTIVTITY) + .withString(Constants.URL,url) .navigation(); } @@ -118,7 +119,8 @@ public class RouteUtil { */ public static void forwardZhuangBanActivity(String url, boolean isFull) { ARouter.getInstance().build(PATH_ZHUANGBANACTIVITY) - .withString("title", "") + .withString("url", url) + .withBoolean("isFull", isFull) .navigation(); } diff --git a/common/src/main/java/com/yunbao/common/views/DrawerRecommendChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/DrawerRecommendChildViewHolder.java index 165bdcba6..147ec1713 100644 --- a/common/src/main/java/com/yunbao/common/views/DrawerRecommendChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DrawerRecommendChildViewHolder.java @@ -44,7 +44,7 @@ public class DrawerRecommendChildViewHolder extends RecyclerView.ViewHolder { IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); if (model.getSrc().contains("?")) { - htmlUrl.append(model.getSrc()) + htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc()) .append("&uid=") .append(userInfo.getId()) .append("&token=") diff --git a/common/src/main/java/com/yunbao/common/views/DrawerRecommendViewHolder.java b/common/src/main/java/com/yunbao/common/views/DrawerRecommendViewHolder.java index b5aecd681..38d2389e4 100644 --- a/common/src/main/java/com/yunbao/common/views/DrawerRecommendViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DrawerRecommendViewHolder.java @@ -52,7 +52,7 @@ public class DrawerRecommendViewHolder extends RecyclerView.ViewHolder { if (TextUtils.equals(model.getSrc(), "recharge")) { htmlUrl.append("recharge"); } else if (model.getSrc().contains("?")) { - htmlUrl.append(model.getSrc()) + htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc()) .append("&uid=") .append(userInfo.getId()) .append("&token=") diff --git a/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java index a41e297c2..f8aa7ee0f 100644 --- a/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DrawerTaskChildViewHolder.java @@ -38,7 +38,25 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder { } public void setData(CustomSidebarChildModel model, int index) { - ImgLoader.display2(itemView.getContext(), model.getIcon(), icon); + int iconImg = R.mipmap.icon_012x; + switch (model.getFlag()) { + case "send_coin_gift": + iconImg = R.mipmap.icon_012x; + break; + case "send_gold_gift": + iconImg = R.mipmap.icon_022x; + break; + case "attention": + iconImg = R.mipmap.icon_032x; + break; + case "bullet_screen": + iconImg = R.mipmap.icon_042x; + break; + case "illumine": + iconImg = R.mipmap.icon_052x; + break; + } + ImgLoader.display(itemView.getContext(), iconImg, icon); StringBuffer titleBuffer = new StringBuffer(); titleBuffer .append(model.getTitle()) @@ -70,7 +88,6 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder { public void onViewClicks() { - if (TextUtils.equals(model.getStatus(), "2")) { LiveNetManager.get(itemView.getContext()) .sendTaskGift(model.getFlag(), new HttpCallback() { @@ -86,7 +103,7 @@ public class DrawerTaskChildViewHolder extends RecyclerView.ViewHolder { ToastUtil.show(error); } }); - }else { + } else { Bus.get().post(new CustomDrawerPopupEvent() .setDisMiss(true)); } diff --git a/common/src/main/java/com/yunbao/common/views/DrawerTaskViewHolder.java b/common/src/main/java/com/yunbao/common/views/DrawerTaskViewHolder.java index 72218f3e6..d34fe9c1e 100644 --- a/common/src/main/java/com/yunbao/common/views/DrawerTaskViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/DrawerTaskViewHolder.java @@ -52,7 +52,7 @@ public class DrawerTaskViewHolder extends RecyclerView.ViewHolder { IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); if (model.getSrc().contains("?")) { - htmlUrl.append(model.getSrc()) + htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc()) .append("&uid=") .append(userInfo.getId()) .append("&token=") diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java index 2848413b3..e7bef052d 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesChildViewHolder.java @@ -54,7 +54,7 @@ public class FunGamesChildViewHolder extends RecyclerView.ViewHolder { IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); if (model.getSrc().contains("?")) { - htmlUrl.append(model.getSrc()) + htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc()) .append("&uid=") .append(userInfo.getId()) .append("&token=") diff --git a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java index 5da9ada68..9534274c4 100644 --- a/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/FunGamesViewHolder.java @@ -62,7 +62,7 @@ public class FunGamesViewHolder extends RecyclerView.ViewHolder { IMLoginModel userInfo = IMLoginManager.get(itemView.getContext()).getUserInfo(); StringBuffer htmlUrl = new StringBuffer(); if (model.getSrc().contains("?")) { - htmlUrl.append(model.getSrc()) + htmlUrl.append(CommonAppConfig.HOST).append("/").append(model.getSrc()) .append("&uid=") .append(userInfo.getId()) .append("&token=") diff --git a/common/src/main/res/mipmap-xxhdpi/icon_012x.png b/common/src/main/res/mipmap-xxhdpi/icon_012x.png new file mode 100644 index 0000000000000000000000000000000000000000..fc2d708728980c3e7d2bc91cf5d26c0cbdc608a6 GIT binary patch literal 1499 zcmV<11tj{3P)9iYmz9luQ!;2~atD2z z000DDNkls+t^2Pu*Kyge3tDUdEchoW-LAs8WyiBprKq32>ca3Jrx@-9Ut z6Pcj@go#|6L~hLs+Ff#_kl#YA#2te6k&}&AHkPq; zCu6jquq>5CKJhF>lir&dIum^m*`4Py%SQ(hX`Dx8CNUic;-SoVn&qCCbBqpVl9&9t z!%u?*9WEz$`rGqjI3^=Ml4IdtExJ4bqCe)zB_nNLBEi!i=TZs$<5%)gNmwcK3f=ZA zeEynQA?euo7Yyd=o_X_v^dIKi@;B;$B z{KfI4YSyc4)lHr^zh+3@;C#1r4pMJ_^G3)c26#4aDzMv7s0@!}E!RqOqup;44q~a- znB{2Ow%PKKtq!bb)oAqDVJ7lkza@6wnnm}HG=yxZfHk(NM%!Nf-q3UL{*e`>+JVTF zaaAAmpaSsf47_}MgQ`AOXv8d}^Y}-EQnD>%ca7@Eg-6}&w`l&VIi~qS-bUB8;9;|h z8BIblGX=skP@@MJs|#FXijh4v05r9#W3$)b7zvX?hMtrT$3RL`g}u6E&AZVDkTrr2 zS_+Pl9C~V&CBin4(Zwoqjal1Oke518T~)ls1HgWI+f7FS0lO|Hs&=HGPoD#(7XeqHMRPvx9b` zIYeYr!pB8Smt_X}BGaK;{C~TUzeM5RlGOMzQr6xE2PJtC4KB_LM|;ThVCq_|%qIo2 z?zgV_iF;@5afk@)-MHEJy!hCoCE%ZcZV)lloy}f3P)&4^r!r<}5;`74b@WSBn!r$@2-|)iV@WS8m!r$-1;PS)Y z@x$Qq!{G44;PAuY^1|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!t~4Of)c7@95>>*|Mvrmz0fNHy%v9 zhIo?ovj6}CV@X6oR9M5T)z@;`KokbxMcqOI)0?R_?%hu2EMi%MWSVVa`~4p#8wf*C zq?H8vZ*=#~X_`fWNpw5qqI51=;<;2Tce)9*R}xzF`bwk@C0PuB2^~}M>bk1!$~LtJ zNuJLg!n92oJC~>r;C`)LI8~CktL7&RlNQ8qvVIA*IIz{6ofR$*4ydp_xfL82G{C zbjA!hRH0pz$7_&}%Eh)2rbI(`wajZ@H-ZaIm1GLxtxKxkp@Nd(^jkL9zQI_aQ0A>({j+y4O8? z=>_LyXt|ayR+=mFq(H%geE%Hy=kwiz1X}2>$Vc6aWPNcKKk9pu`s4b{voVoGT%CLB zhC)mv(3{k9-Cmlw~nKl89wC%;yrp9MZD>!kaIL1X6nbbCm@A zNitomiv3!AEyeG}lty zYy#L~wEe*&FHMAuvykMkFeIEA2vx;6s|2x%Pz4}hmf!HtEMK{^WU2gSy^MAc24N`r zTW(7bSr#OaZ2JEnW9nua#8dacdFN&er9IV1yzyss<2Su=h{PY~x||04$NyXpU|)}2 zM1WmHcBun)soM_{upgw|HUP72n9c2dV%oLhdl+(a;}$#?C-^9VA$nJnum$s=_^{ol z5VzJ8Xi(@lL)%!R2C{AFIHRFEJn|yAc`QW&=j4|fb)t6Ysv5NB7R&xYYYrDOw^|KQ zV1|QSjzBs80}>d~EQpMW0|nA7kwJ(I*<+y4${;JN9+E%;loiDK3?SB>^}qj;(tnle zzwmWlORut)c3z%eGiRh>7asvQC>e-QP^8vy2_pT_VNi$ip(kn&kSQ_YAI9USd>D`N z!A80diBdjrOZo6Jtp~v=AF3Y&6ACEP9=5h%=L*@okUZ@{cydOK@Z<~tpV~@&ZfGm% P00000NkvXXu0mjfjd-;k literal 0 HcmV?d00001 diff --git a/common/src/main/res/mipmap-xxhdpi/icon_052x.png b/common/src/main/res/mipmap-xxhdpi/icon_052x.png new file mode 100644 index 0000000000000000000000000000000000000000..211307e2f3b6a41f6ae65c651384d9183990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YInf)Z$Qff69WD$GvG a^alX$9kF}Lg9!ux0000" + url); LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); @@ -300,6 +302,7 @@ public class WebViewActivityMedal extends AbsActivity { @Override protected void onDestroy() { + Bus.getOff(this); if (mWebView != null) { ViewGroup parent = (ViewGroup) mWebView.getParent(); if (parent != null) { diff --git a/live/src/main/java/com/yunbao/live/dialog/VoiceDialog.java b/live/src/main/java/com/yunbao/live/dialog/VoiceDialog.java index db1611661..5c934814c 100644 --- a/live/src/main/java/com/yunbao/live/dialog/VoiceDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/VoiceDialog.java @@ -1,5 +1,6 @@ package com.yunbao.live.dialog; +import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.text.SpannableStringBuilder; @@ -52,16 +53,16 @@ public class VoiceDialog extends AbsDialogFragment { @Override public void onStop() { super.onStop(); + + + } + + public String sendMessage() { if (mIat != null) { mIat.cancel(); mIat.destroy(); mIat = null; } - - } - - public String sendMessage() { - return WordsTypeUtil.changeTraditional(builder.toString()); } @@ -88,12 +89,6 @@ public class VoiceDialog extends AbsDialogFragment { params.height = WindowManager.LayoutParams.WRAP_CONTENT; params.gravity = Gravity.CENTER; window.setAttributes(params); - handler.postDelayed(new Runnable() { - @Override - public void run() { - - } - }, 30000); } @Override @@ -111,7 +106,6 @@ public class VoiceDialog extends AbsDialogFragment { voiceChat = (TextView) findViewById(R.id.voice_chat); fingersSlide = (TextView) findViewById(R.id.fingers_slide); gifView = (GifImageView) findViewById(R.id.gif_view); - startRecognize(); iconWithdraw.setVisibility(View.GONE); gifView.setVisibility(View.GONE); voiceFluctuations.setVisibility(View.VISIBLE); @@ -131,21 +125,24 @@ public class VoiceDialog extends AbsDialogFragment { * 上划取消 */ public void withdraw() { - mIat.stopListening(); - if (!isDetached()) { - voiceFluctuations.setVisibility(View.GONE); - gifView.setVisibility(View.GONE); - iconWithdraw.setVisibility(View.VISIBLE); - fingersSlide.setText(getString(R.string.release_cancel_send)); - isSend = false; + if (mIat != null) { + mIat.stopListening(); + if (!isDetached()) { + voiceFluctuations.setVisibility(View.GONE); + gifView.setVisibility(View.GONE); + iconWithdraw.setVisibility(View.VISIBLE); + fingersSlide.setText(getString(R.string.release_cancel_send)); + isSend = false; + } } + } /** * 上划取消 */ - public void notWithdraw() { - startRecognize(); + public void notWithdraw(Context context) { + startRecognize(context); if (!isDetached()) { if (TextUtils.isEmpty(sendMessage())) { if (gifView.getVisibility() != View.VISIBLE) @@ -227,9 +224,9 @@ public class VoiceDialog extends AbsDialogFragment { /** * 开始识别 */ - public void startRecognize() { + public void startRecognize(Context context) { if (null == mIat) { - mIat = SpeechRecognizer.createRecognizer(getContext(), mInitListener); + mIat = SpeechRecognizer.createRecognizer(context, mInitListener); } if (mIat.isListening()) { return; diff --git a/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java b/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java index 987045cba..fcdc291ac 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java @@ -11,6 +11,16 @@ public class LiveRoomChangeEvent { private LiveBean mLiveBean; private int mLiveType;//直播间的类型 普通 密码 门票 计时等 private int mLiveTypeVal;//收费价格,计时收费每次扣费的值 + private boolean isLiveEnd = false; + + public boolean isLiveEnd() { + return isLiveEnd; + } + + public LiveRoomChangeEvent setLiveEnd(boolean liveEnd) { + isLiveEnd = liveEnd; + return this; + } public LiveRoomChangeEvent(LiveBean bean, int liveType, int liveTypeVal) { mLiveBean = bean; 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 60e3303fc..f8e36d404 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -311,6 +311,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) { //按下 handler.postDelayed(mLongPressed, 500); + if (voiceDialog == null) { + voiceDialog = new VoiceDialog(); + voiceDialog.startRecognize(mContext); + } } else { mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() { @Override @@ -328,7 +332,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { } if ((downY - moveY < 100) && (downY - moveY > 30)) { if (voiceDialog != null && voiceDialog.isAdded()) - voiceDialog.notWithdraw(); + voiceDialog.notWithdraw(mContext); } } else if (event.getAction() == MotionEvent.ACTION_UP) { //松开 @@ -360,28 +364,26 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { Vibrator vibrator = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(100);//震动时间(ms) - if (voiceDialog == null) { - voiceDialog = new VoiceDialog(); - voiceDialog.setListener(new VoiceDialog.VoiceListener() { - @Override - public void timeout() { - //松开 - handler.removeCallbacks(mLongPressed); - Bus.get().post(new LiveAudienceEvent() - .setVoicePress(false) - .setType(LiveAudienceEvent.LiveAudienceType.VOICE_PRESS)); - if (voiceDialog != null) { - if (voiceDialog.isSend() && !TextUtils.isEmpty(voiceDialog.sendMessage())) { - ((LiveActivity) mContext).sendChatMessage(voiceDialog.sendMessage(), null, null); - } + voiceDialog.setListener(new VoiceDialog.VoiceListener() { + @Override + public void timeout() { + //松开 + handler.removeCallbacks(mLongPressed); + Bus.get().post(new LiveAudienceEvent() + .setVoicePress(false) + .setType(LiveAudienceEvent.LiveAudienceType.VOICE_PRESS)); - voiceDialog.dismiss(); - voiceDialog = null; + if (voiceDialog != null) { + if (voiceDialog.isSend() && !TextUtils.isEmpty(voiceDialog.sendMessage())) { + ((LiveActivity) mContext).sendChatMessage(voiceDialog.sendMessage(), null, null); } + + voiceDialog.dismiss(); + voiceDialog = null; } - }); - } + } + }); voiceDialog.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "VoiceDialog"); Bus.get().post(new LiveAudienceEvent() .setVoicePress(true) @@ -409,7 +411,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { handler.postDelayed(runnable = new Runnable() { @Override public void run() { - if(!liveUid.equals(mLiveUid)){ + if (!liveUid.equals(mLiveUid)) { return; } if (isattention == 0) { @@ -421,7 +423,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { LiveChatBean lvBean2 = new LiveChatBean(); lvBean2.setType(-2); LiveRoomViewHolder.insertChat(lvBean2, 1); - Log.i("chatMgs", liveUid+"|"+mLiveUid); + Log.i("chatMgs", liveUid + "|" + mLiveUid); } }, 10000);//3秒后执行Runnable中的run方法 } 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 8bf0729b3..0ee9fb147 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -17,6 +17,7 @@ import androidx.recyclerview.widget.RecyclerView; import com.alibaba.fastjson.JSON; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.event.CloseEvent; import com.yunbao.common.glide.ImgLoader; @@ -34,12 +35,13 @@ import com.yunbao.live.activity.LiveAnchorActivity; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.adapter.SearchRecommendBodyAdapter; -import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.JumpUserHomeEvent; +import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; +import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; @@ -317,15 +319,7 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList if (liveBean == null) { return; } - LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk); - if (mContext instanceof LiveAnchorActivity) { - ((LiveAnchorActivity) mContext).superBackPressed(); - } else if (mContext instanceof LiveAudienceActivity) { - ((LiveAudienceActivity) mContext).exitLiveRoom(); - } else if (mContext instanceof LiveRyAnchorActivity) { - ((LiveRyAnchorActivity) mContext).superBackPressed(); - - } + EventBus.getDefault().post(new LiveRoomChangeEvent(liveBean, liveType, liveTypeVal).setLiveEnd(true)); } }); 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 ccd5fb86e..50b4e3759 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -11,7 +11,6 @@ import android.content.Intent; import android.content.res.Configuration; import android.os.CountDownTimer; import android.os.Handler; -import android.os.Looper; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -258,7 +257,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveAudienceViewHolder.addToParent(); mLiveRoomViewHolder.addToParent(); mLiveAudienceViewHolder.subscribeActivityLifeCycle(); - }else{ + } else { mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape()); mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); @@ -321,6 +320,36 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } + public void removeLiveEnd() { + if (mLiveAudienceViewHolder != null) { + mLiveAudienceViewHolder.removeFromParent(); + mLiveAudienceViewHolder.removeCallbacks(); + mLiveAudienceViewHolder.release(); + } + //结束播放 + if (mLivePlayViewHolder != null) { + mLivePlayViewHolder.removeFromParent(); + mLivePlayViewHolder.stopPlay(); + mLivePlayViewHolder.release(); + } + if (mLiveRoomViewHolder != null) { + mLiveRoomViewHolder.removeFromParent(); + mLiveRoomViewHolder.clearData(); + mLiveRoomViewHolder.countDownTimerTrickery = null; + } + if (mLiveEndViewHolder != null) { + mLiveEndViewHolder.removeFromParent(); + mLiveEndViewHolder.release(); + } + mLiveEndViewHolder = null; + mLiveAudienceViewHolder = null; + mLivePlayViewHolder = null; + mLiveRoomViewHolder = null; + mLiveLinkMicPresenter = null; + mLiveLinkMicAnchorPresenter = null; + mLiveRyLinkMicPkPresenter = null; + } + @Override public void onRemove(boolean isQuit) { LiveHttpUtil.cancel(LiveHttpConsts.CHECK_LIVE); @@ -379,13 +408,13 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveEndViewHolder.removeFromParent(); mLiveEndViewHolder.release(); } + mLiveEndViewHolder = null; mLiveAudienceViewHolder = null; mLivePlayViewHolder = null; mLiveRoomViewHolder = null; - mLiveEndViewHolder = null; - mLiveLinkMicPresenter=null; - mLiveLinkMicAnchorPresenter=null; - mLiveRyLinkMicPkPresenter=null; + mLiveLinkMicPresenter = null; + mLiveLinkMicAnchorPresenter = null; + mLiveRyLinkMicPkPresenter = null; if (PermissionUtils.checkPermission(mContext) && !kick) { LiveFloatView.getInstance() .cacheLiveData(mLiveBean, mLiveType, mLiveSDK, mLiveTypeVal) @@ -929,7 +958,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe } @Override - public void onLinkMicPkStart(String pkUid, String pkhead, String pkname,String isLadders) { + public void onLinkMicPkStart(String pkUid, String pkhead, String pkname, String isLadders) { if (mLiveRyLinkMicPkPresenter != null && mLiveRoomViewHolder != null) { mLiveRyLinkMicPkPresenter.onLinkMicPkStart(pkUid, 1); Handler handler = new Handler(); diff --git a/live/src/main/res/layout/view_live_end.xml b/live/src/main/res/layout/view_live_end.xml index 5e5a188ab..aaf9be7c0 100644 --- a/live/src/main/res/layout/view_live_end.xml +++ b/live/src/main/res/layout/view_live_end.xml @@ -215,7 +215,6 @@ android:layout_height="wrap_content" android:layout_marginStart="2dp" android:layout_marginTop="14dp" - android:text=":" android:textColor="#70ffffff" android:textSize="13.33sp" /> @@ -224,7 +223,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="7dp" - android:layout_marginTop="17dp" + android:layout_marginTop="14dp" android:textColor="#70ffffff" android:textSize="13.33sp" /> @@ -400,6 +399,7 @@ android:id="@+id/live_duration_anchor" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="12dp" android:text="0" android:textColor="@color/white" android:textSize="16sp"