diff --git a/live/src/main/java/com/yunbao/live/views/LiveFloatView.java b/live/src/main/java/com/yunbao/live/views/LiveFloatView.java index e2d8ba290..3f4117eaa 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveFloatView.java +++ b/live/src/main/java/com/yunbao/live/views/LiveFloatView.java @@ -47,15 +47,12 @@ public class LiveFloatView implements Function1 { return instance; } - public void builderFloat(Activity mContext, String url,String tag) { - if (TextUtils.isEmpty(tag)){ - tag = TAG; - } + public void builderFloat(Activity mContext, String url) { liveOnInvokeView = new LiveOnInvokeView(); this.mContext = mContext; this.url = url; EasyFloat.with(mContext) - .setTag(tag) + .setTag(TAG) .setLayout(R.layout.view_flaot_live, liveOnInvokeView) .setShowPattern(ShowPattern.CURRENT_ACTIVITY) .setGravity(Gravity.END | Gravity.CENTER_VERTICAL, 0, 200) 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 12f0e7e80..1c8021341 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -384,7 +384,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mContext.finish(); } else { EventBus.getDefault() - .postSticky(new LiveFloatEvent() + .post(new LiveFloatEvent() .setmLiveBean(mLiveBean) .setmLiveSDK(mLiveSDK) .setmLiveType(mLiveType) @@ -400,7 +400,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void onCancel() { EventBus.getDefault() - .postSticky(new LiveFloatEvent() + .post(new LiveFloatEvent() .setmLiveBean(mLiveBean) .setmLiveSDK(mLiveSDK) .setmLiveType(mLiveType) 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 85e4c173d..1519f5387 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -40,7 +40,6 @@ import com.google.firebase.messaging.FirebaseMessaging; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.jakewharton.rxbinding3.view.RxView; -import com.lzf.easyfloat.EasyFloat; import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMManager; import com.tencent.imsdk.v2.V2TIMSDKConfig; @@ -1246,11 +1245,11 @@ 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(), "Main"), 1500); + .builderFloat(mContext, event.getmLiveBean().getPull()), 1500); } else { new Handler().post(() -> LiveFloatView.getInstance() .cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK(), event.getmLiveTypeVal()) - .builderFloat(mContext, event.getmLiveBean().getPull(), "Main")); + .builderFloat(mContext, event.getmLiveBean().getPull())); } diff --git a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java index a61736459..1209c17a2 100644 --- a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java @@ -612,32 +612,8 @@ public class PDLiveConversationListActivity extends AbsActivity implements View. } - @Subscribe(threadMode = ThreadMode.MAIN) - public void onRecommendLiveRoomEvent(RecommendLiveRoomEvent event) { - LiveHttpUtil.getLiveInfo(event.getLiveuid(), new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0 && info.length > 0) { - LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); - LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { - if (liveBean1 == null) { - return; - } - LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk); - }); - mCheckLivePresenter.checkLive(liveBean); - } else { - RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0); - } - } - }); - } - @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) - public void onLiveFloatEvent(LiveFloatEvent event) { - new Handler().post(() -> LiveFloatView.getInstance() - .cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK(), event.getmLiveTypeVal()) - .builderFloat(mContext, event.getmLiveBean().getPull(),"PDLiveConversationList")); - } + + } diff --git a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java index 998074409..95dcf48f8 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMessageViewHolder.java @@ -29,18 +29,24 @@ import com.opensource.svgaplayer.SVGAParser; import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.bean.ImUserInfoModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.manager.imrongcloud.MessageIMManager; import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.SystemMessageActivity; import com.yunbao.live.bean.ImUserBean; +import com.yunbao.live.event.RecommendLiveRoomEvent; import com.yunbao.live.http.ImHttpUtil; +import com.yunbao.live.http.LiveHttpUtil; +import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.adapter.SystemMessageAdapter; @@ -400,4 +406,25 @@ public class MainMessageViewHolder extends AbsMainViewHolder { MessageIMManager.get(mContext).setSystemNumber(systemNumber); } + + @Subscribe(threadMode = ThreadMode.MAIN) + public void onRecommendLiveRoomEvent(RecommendLiveRoomEvent event) { + LiveHttpUtil.getLiveInfo(event.getLiveuid(), new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0 && info.length > 0) { + LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); + LiveRoomCheckLivePresenter mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, (liveBean1, liveType, liveTypeVal, liveSdk) -> { + if (liveBean1 == null) { + return; + } + LiveAudienceActivity.forward(mContext, liveBean1, liveType, liveTypeVal, "", 0, liveSdk); + }); + mCheckLivePresenter.checkLive(liveBean); + } else { + RouteUtil.forwardUserHome(mContext, event.getLiveuid(), 0); + } + } + }); + } } diff --git a/main/src/main/res/layout/view_main_message.xml b/main/src/main/res/layout/view_main_message.xml index bb86e3c20..de0adb09b 100644 --- a/main/src/main/res/layout/view_main_message.xml +++ b/main/src/main/res/layout/view_main_message.xml @@ -2,6 +2,7 @@