diff --git a/common/build.gradle b/common/build.gradle index 9a7759865..07e4653ee 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -187,4 +187,6 @@ dependencies { api 'com.google.firebase:firebase-analytics:21.1.0' // api 'com.huawei.hms:push:4.0.2.300' implementation 'com.github.tajchert:WaitingDots:0.6.1' + //悬浮窗 + api 'com.github.princekin-f:EasyFloat:2.0.4' } diff --git a/live/src/main/java/com/yunbao/live/bean/LiveBean.java b/common/src/main/java/com/yunbao/common/bean/LiveBean.java similarity index 99% rename from live/src/main/java/com/yunbao/live/bean/LiveBean.java rename to common/src/main/java/com/yunbao/common/bean/LiveBean.java index 8eab993af..d4f527a3a 100644 --- a/live/src/main/java/com/yunbao/live/bean/LiveBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveBean.java @@ -1,13 +1,12 @@ -package com.yunbao.live.bean; +package com.yunbao.common.bean; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import com.alibaba.fastjson.annotation.JSONField; -import com.yunbao.common.bean.WeekListBean; +import com.yunbao.common.R; import com.yunbao.common.utils.WordUtil; -import com.yunbao.live.R; import java.util.ArrayList; import java.util.List; diff --git a/common/src/main/java/com/yunbao/common/event/LiveFloatEvent.java b/common/src/main/java/com/yunbao/common/event/LiveFloatEvent.java new file mode 100644 index 000000000..f66639ecb --- /dev/null +++ b/common/src/main/java/com/yunbao/common/event/LiveFloatEvent.java @@ -0,0 +1,50 @@ +package com.yunbao.common.event; + +import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.LiveBean; + +/** + * 悬浮窗直播通知 + */ +public class LiveFloatEvent extends BaseModel { + private LiveBean mLiveBean; + private int mLiveType; + private int mLiveSDK; + private int mLiveTypeVal; + + public LiveBean getmLiveBean() { + return mLiveBean; + } + + public LiveFloatEvent setmLiveBean(LiveBean mLiveBean) { + this.mLiveBean = mLiveBean; + return this; + } + + public int getmLiveType() { + return mLiveType; + } + + public LiveFloatEvent setmLiveType(int mLiveType) { + this.mLiveType = mLiveType; + return this; + } + + public int getmLiveSDK() { + return mLiveSDK; + } + + public LiveFloatEvent setmLiveSDK(int mLiveSDK) { + this.mLiveSDK = mLiveSDK; + return this; + } + + public int getmLiveTypeVal() { + return mLiveTypeVal; + } + + public LiveFloatEvent setmLiveTypeVal(int mLiveTypeVal) { + this.mLiveTypeVal = mLiveTypeVal; + return this; + } +} 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 7b4638fc5..cd00ba2e7 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -7,6 +7,7 @@ import com.alibaba.android.arouter.launcher.ARouter; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; +import com.yunbao.common.bean.LiveBean; /** * Created by cxf on 2019/2/25. @@ -26,6 +27,7 @@ public class RouteUtil { public static final String PATH_FACEBOOKACTIVITY = "/baidu/FacebookLoginActivity"; public static final String PATH_MAIN = "/main/MainActivity"; public static final String PATH_ENTRY = "/main/EntryActivity"; + public static final String PATH_LIVE_AUDIENCE = "/live/LiveAudienceActivity"; /** * 启动页 @@ -112,6 +114,18 @@ public class RouteUtil { .navigation(); } + /** + * 打开直播页面 + */ + public static void forwardLiveAudienceActivity(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) { + ARouter.getInstance().build(PATH_LIVE_AUDIENCE) + .withParcelable(Constants.LIVE_BEAN, mLiveBean) + .withInt(Constants.LIVE_TYPE, mLiveType) + .withInt(Constants.LIVE_SDK, mLiveSDK) + .withInt(Constants.LIVE_TYPE_VAL, mLiveTypeVal) + .navigation(); + } + /** * 举报个人 */ diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index c21bb7b84..a4a5938b6 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -31,7 +31,6 @@ import com.yunbao.common.event.FollowEvent; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.KeyBoardHeightChangeListener; -import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.KeyBoardHeightUtil2; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessImageUtil; @@ -41,7 +40,7 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.live.R; import com.yunbao.live.bean.GuardUserBean; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveDanMuBean; @@ -68,7 +67,6 @@ import com.yunbao.live.dialog.LiveRedPackSendDialogFragment; import com.yunbao.live.dialog.LiveShareDialogFragment; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.dialog.LiveUserMoreDialogFragment; -import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index 19782f23b..f2fe4670a 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -39,7 +39,7 @@ import com.yunbao.common.utils.LogUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.dialog.LiveBeautyDialogFragment; @@ -56,7 +56,6 @@ import com.yunbao.live.music.LiveMusicDialogFragment; import com.yunbao.live.presenter.LiveLinkMicAnchorPresenter; import com.yunbao.live.presenter.LiveLinkMicPkPresenter; import com.yunbao.live.presenter.LiveLinkMicPresenter; -import com.yunbao.live.socket.SocketChatUtil; import com.yunbao.live.socket.SocketClient; import com.yunbao.live.socket.SocketSendBean; import com.yunbao.live.views.AbsLivePushViewHolder; diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 9c68fc0ad..a011b0d1e 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -21,12 +21,14 @@ import androidx.viewpager.widget.ViewPager; import com.adjust.sdk.Adjust; import com.adjust.sdk.AdjustEvent; +import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.blankj.utilcode.util.GsonUtils; import com.facebook.appevents.AppEventsLogger; import com.google.firebase.analytics.FirebaseAnalytics; +import com.lzf.easyfloat.EasyFloat; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.HtmlConfig; @@ -56,12 +58,13 @@ import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessResultUtil; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.weight.VerticalViewPager; import com.yunbao.live.R; import com.yunbao.live.adapter.VerticalPagerAdapter; import com.yunbao.live.bean.ImUserBean; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.dialog.LiveFansFragment; import com.yunbao.live.dialog.LiveGiftDialogFragment; @@ -94,7 +97,7 @@ import java.util.Map; * Created by cxf on 2018/10/10. * 看直播 */ - +@Route(path = RouteUtil.PATH_LIVE_AUDIENCE) public class LiveAudienceActivity extends LiveActivity { private static final String TAG = "LiveAudienceActivity"; @@ -170,6 +173,10 @@ public class LiveAudienceActivity extends LiveActivity { verticalViewPager = findViewById(R.id.view_pager); verticalViewPager.setEnableScroll(IMLoginManager.get(mContext).isSlide()); + //判断是否有直播悬浮窗,有直接关闭 + if (EasyFloat.isShow("LiveFloatView")){ + EasyFloat.dismiss("LiveFloatView",true); + } } @@ -303,31 +310,28 @@ public class LiveAudienceActivity extends LiveActivity { if (liveBean1 == null) { return; } - runOnUiThread(new Runnable() { - @Override - public void run() { - mLiveSDK = liveSdk; - mLiveType = liveType; - mLiveTypeVal = liveTypeVal; - mLiveBean = liveBean1; - mLiveUid = liveBean1.getUid(); - mStream = liveBean1.getStream(); - mAncherName = liveBean1.getUserNiceName(); - mAncherIcon = liveBean1.getAvatar(); - Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid); - //加载当前页面数据 - View rootView = manager.getRootView(); - if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) { - ((ViewGroup) (rootView.getParent())).removeView(rootView); - manager.onRemove(false); - } - mViewGroup.addView(manager.getRootView()); - - manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk); - //加载完页面后再后台静默下载礼物svga - downloadAllGift(); - over(); + runOnUiThread(() -> { + mLiveSDK = liveSdk; + mLiveType = liveType; + mLiveTypeVal = liveTypeVal; + mLiveBean = liveBean1; + mLiveUid = liveBean1.getUid(); + mStream = liveBean1.getStream(); + mAncherName = liveBean1.getUserNiceName(); + mAncherIcon = liveBean1.getAvatar(); + Log.e(TAG, "mLiveUid--------------------------->" + mLiveUid); + //加载当前页面数据 + View rootView = manager.getRootView(); + if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) { + ((ViewGroup) (rootView.getParent())).removeView(rootView); + manager.onRemove(false); } + mViewGroup.addView(manager.getRootView()); + + manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk); + //加载完页面后再后台静默下载礼物svga + downloadAllGift(); + over(); }); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 634c695e6..d53dc39e5 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -55,14 +55,13 @@ import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.WishlistModel; import com.yunbao.live.dialog.LiveBeautyDialogFragment; import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; -import com.yunbao.live.dialog.LiveMicUserDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; diff --git a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java index 3fdc0d10b..b55f3cc7d 100644 --- a/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/PDLIiveChatActivity.java @@ -25,7 +25,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.live.R; import com.yunbao.live.adapter.SystemChatMessageAdapter; import com.yunbao.live.bean.ImUserBean; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.event.RecommendLiveRoomEvent; import com.yunbao.live.http.LiveHttpUtil; diff --git a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java index 363157f60..df4dffae0 100644 --- a/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java +++ b/live/src/main/java/com/yunbao/live/activity/WebViewActivityMedal.java @@ -34,7 +34,7 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveRoomScrollAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveRoomScrollAdapter.java index df52ccb13..52a80cf81 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveRoomScrollAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveRoomScrollAdapter.java @@ -13,7 +13,7 @@ import android.widget.ImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.live.R; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import java.util.List; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java index 37aae4c70..50b1a75e9 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveHDDialogFragment.java @@ -44,7 +44,7 @@ import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.activity.ZhuangBanActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java index 2dd565291..f66e86edc 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveTotalDialog.java @@ -16,7 +16,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.adapter.FunGamesAdapter; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveAudienceEvent; import org.greenrobot.eventbus.Subscribe; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java index 48b056bcc..989be5ac0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveUserDialogFragment.java @@ -43,7 +43,7 @@ import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.live.bean.ImpressBean; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.custom.MyTextView; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpConsts; diff --git a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java index 4b41a2ffc..aecb11117 100644 --- a/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java +++ b/live/src/main/java/com/yunbao/live/dialog/SidebarLiveAudience.java @@ -30,7 +30,7 @@ import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.RouteUtil; import com.yunbao.live.R; import com.yunbao.live.adapter.SidebarAdapter; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index f6b66a7b1..55d09883e 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -5,7 +5,7 @@ import com.yunbao.common.bean.AiAutomaticSpeechModel; import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.BaseModel; import com.yunbao.common.bean.MsgModel; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.OpenParametersModel; public class LiveAudienceEvent extends BaseModel { 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 6e2930f6e..987045cba 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveRoomChangeEvent.java @@ -1,6 +1,6 @@ package com.yunbao.live.event; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; /** * Created by cxf on 2019/6/27. diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index 91ece6f48..8ce58270f 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -50,7 +50,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.LiveGiftPrizePoolWinBean; import com.yunbao.live.bean.LiveLuckGiftWinBean; import com.yunbao.live.bean.LiveReceiveGiftBean; diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java index 5b34a73a4..1bc0616cf 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRoomCheckLivePresenter.java @@ -16,7 +16,7 @@ import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; diff --git a/live/src/main/java/com/yunbao/live/utils/LiveStorge.java b/live/src/main/java/com/yunbao/live/utils/LiveStorge.java index ad77b0850..7cce3cb94 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveStorge.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveStorge.java @@ -1,7 +1,7 @@ package com.yunbao.live.utils; import com.yunbao.common.CommonAppConfig; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import java.util.HashMap; import java.util.List; diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index 9d07832d3..3f1103bd2 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -152,14 +152,15 @@ public class LiveTextRender { String mContext = content; for (String name : userNames) { name = "@" + name; - while (mContext.contains(name) && !TextUtils.isEmpty(mContext)) { + if (mContext.contains(name) && !TextUtils.isEmpty(mContext)) { int index = mContext.indexOf(name); int end = index + name.length(); + startIndex = index + startIndex; int endIndex = startIndex + name.length(); spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor("#fffe9b")), startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); - mContext = mContext.substring(end + 1, mContext.length()); - startIndex = startIndex + end + 1; + mContext = mContext.substring(end, mContext.length()); + startIndex = endIndex; } } @@ -364,7 +365,7 @@ public class LiveTextRender { if (levelBean == null) { if (textView != null) { SpannableStringBuilder builder = createPrefix(null, bean); - int color = 0xffffdd00; + int color = 0xffffdd00; switch (bean.getType()) { case LiveChatBean.GIFT: @@ -376,7 +377,7 @@ public class LiveTextRender { } textView.setText(builder); } - }else { + } else { ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { 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 48d23e9ea..8bf0729b3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveEndViewHolder.java @@ -27,7 +27,6 @@ import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.StringUtil; -import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.common.views.weight.ClipPathCircleImage; import com.yunbao.live.R; @@ -35,7 +34,7 @@ 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.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.JumpUserHomeEvent; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; diff --git a/live/src/main/java/com/yunbao/live/views/LiveFloatView.java b/live/src/main/java/com/yunbao/live/views/LiveFloatView.java new file mode 100644 index 000000000..6d4da4631 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/LiveFloatView.java @@ -0,0 +1,142 @@ +package com.yunbao.live.views; + +import android.app.Activity; +import android.util.Log; +import android.view.Gravity; +import android.view.View; + +import com.lzf.easyfloat.EasyFloat; +import com.lzf.easyfloat.enums.ShowPattern; +import com.lzf.easyfloat.interfaces.FloatCallbacks; +import com.lzf.easyfloat.interfaces.OnInvokeView; +import com.tencent.live2.V2TXLivePlayer; +import com.tencent.live2.impl.V2TXLivePlayerImpl; +import com.tencent.rtmp.ui.TXCloudVideoView; +import com.yunbao.common.bean.LiveBean; +import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; +import com.yunbao.live.R; + +import kotlin.Unit; +import kotlin.jvm.functions.Function0; +import kotlin.jvm.functions.Function1; + +/** + * 直播间悬浮窗管理 + */ +public class LiveFloatView implements Function1 { + + private static LiveFloatView instance; + private LiveOnInvokeView liveOnInvokeView = null; + private Activity mContext; + private String url; + private LiveBean mLiveBean; + private int mLiveType; + private int mLiveSDK; + private int mLiveTypeVal; + private FloatCallbacks.Builder builder; + private String TAG = "LiveFloatView"; + private V2TXLivePlayer mPlayer; + + public static LiveFloatView getInstance() { + if (instance == null) { + instance = new LiveFloatView(); + } + + return instance; + } + + public void builderFloat(Activity mContext, String url) { + liveOnInvokeView = new LiveOnInvokeView(); + this.mContext = mContext; + this.url = url; + EasyFloat.with(mContext) + .setTag(TAG) + .setLayout(R.layout.view_flaot_live, liveOnInvokeView) + .setShowPattern(ShowPattern.CURRENT_ACTIVITY) + .setGravity(Gravity.END | Gravity.CENTER_VERTICAL, 0, 200) + .registerCallback(this) + .show(); + } + + public void builderSystemFloat(Activity mContext, String url) { + liveOnInvokeView = new LiveOnInvokeView(); + this.mContext = mContext; + this.url = url; + EasyFloat.with(mContext) + .setTag(TAG) + .setLayout(R.layout.view_flaot_live, liveOnInvokeView) + .setShowPattern(ShowPattern.ALL_TIME) + .setGravity(Gravity.END | Gravity.CENTER_VERTICAL, 0, 200) + .registerCallback(this) + .show(); + } + + public LiveFloatView cacheLiveData(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) { + this.mLiveBean = mLiveBean; + this.mLiveType = mLiveType; + this.mLiveSDK = mLiveSDK; + this.mLiveTypeVal = mLiveTypeVal; + return instance; + } + + @Override + public Unit invoke(FloatCallbacks.Builder builder) { + this.builder = builder; + builder.createResult((aBoolean, s, view) -> { + Log.e("LiveFloatView", "aBoolean:" + aBoolean + "---------------------s:" + s); + if (callback != null) { + callback.invoke(aBoolean); + } + builder.dismiss(new Function0() { + @Override + public Unit invoke() { + if (mPlayer != null && mPlayer.isPlaying() == 1) { + mPlayer.stopPlay(); + } + return null; + } + }); + return null; + }); + return null; + } + + /** + * 悬浮窗布局管理 + */ + private class LiveOnInvokeView implements OnInvokeView { + + @Override + public void invoke(View view) { + TXCloudVideoView videoView = view.findViewById(R.id.video_view); + mPlayer = new V2TXLivePlayerImpl(mContext); + mPlayer.setRenderView(videoView); + mPlayer.startPlay(url); + ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + mPlayer.stopPlay(); + EasyFloat.dismiss("LiveFloatView", true); + } + }); + ViewClicksAntiShake.clicksAntiShake(videoView, () -> { + mPlayer.stopPlay(); + RouteUtil.forwardLiveAudienceActivity(mLiveBean, mLiveType, mLiveSDK, mLiveTypeVal); + }); + } + } + + private LiveFloatViewCallback callback; + + public LiveFloatView setCallback(LiveFloatViewCallback callback) { + this.callback = callback; + return this; + } + + public interface LiveFloatViewCallback { + void invoke(Boolean aBoolean); + + } + +} diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayListener.java b/live/src/main/java/com/yunbao/live/views/LivePlayListener.java index d2b7f21cc..befa67854 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayListener.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayListener.java @@ -2,7 +2,7 @@ package com.yunbao.live.views; import android.view.ViewGroup; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; public interface LivePlayListener extends LiveActivityLifeCallback { 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 a38fda842..943478030 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -42,6 +42,7 @@ 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; @@ -65,6 +66,7 @@ import com.yunbao.common.bean.BannerBean; import com.yunbao.common.bean.HourRank; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.bean.LevelBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveGiftBean; import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.StarChallengeStatusModel; @@ -102,7 +104,6 @@ import com.yunbao.live.adapter.LiveChatAdapter; import com.yunbao.live.adapter.LiveRoomFastMessageRecyclerViewAdapter; import com.yunbao.live.adapter.LiveUserAdapter; import com.yunbao.live.bean.DrPkbean; -import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveDanMuBean; 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 5524b1d90..2f2fdadfa 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -30,17 +30,20 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.blankj.utilcode.util.GsonUtils; import com.facebook.appevents.AppEventsLogger; +import com.lzf.easyfloat.permission.PermissionUtils; import com.tencent.imsdk.v2.V2TIMCallback; import com.tencent.imsdk.v2.V2TIMManager; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.Constants; import com.yunbao.common.bean.AiAutomaticSpeechModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.UserBean; import com.yunbao.common.custom.MyViewPager; import com.yunbao.common.event.FollowEvent; +import com.yunbao.common.event.LiveFloatEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.CommonHttpConsts; import com.yunbao.common.http.CommonHttpUtil; @@ -58,7 +61,6 @@ import com.yunbao.common.utils.formatBigNum; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveDanMuBean; @@ -216,8 +218,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe @Override public void run() { Log.e("ImgLoader1", data.getAvatar()); - - mLiveBean = data; mLiveSDK = liveSdk; mLiveType = liveType; @@ -228,12 +228,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe .setParametersModel(openParametersModel .setmLiveType(mLiveType) .setmLiveTypeVal(mLiveTypeVal))); - mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, mIntent.getIntExtra("landscape", 0)); mLivePlayViewHolder.addToParent(); mLivePlayViewHolder.subscribeActivityLifeCycle(); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); - mLiveRoomViewHolder.subscribeActivityLifeCycle(); mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); mLiveAudienceViewHolder.addToParent(); @@ -368,8 +366,46 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRyLinkMicPkPresenter.release(); } if (isQuit) { - if (mContext instanceof LiveAudienceActivity) { - mContext.finish(); + if (PermissionUtils.checkPermission(mContext)) { + + } else { + if (mContext instanceof LiveAudienceActivity) { + DialogUitl.showSimpleDialog(mContext, null, "您未打开悬浮窗权限,是否打开", false, new DialogUitl.SimpleCallback3() { + @Override + public void onConfirmClick(Dialog dialog) { + LiveFloatView.getInstance() + .setCallback(new LiveFloatView.LiveFloatViewCallback() { + @Override + public void invoke(Boolean aBoolean) { + if (aBoolean) { + mContext.finish(); + } else { + EventBus.getDefault() + .post(new LiveFloatEvent() + .setmLiveBean(mLiveBean) + .setmLiveSDK(mLiveSDK) + .setmLiveType(mLiveType) + .setmLiveTypeVal(mLiveTypeVal)); + mContext.finish(); + } + } + }) + .cacheLiveData(mLiveBean, mLiveType, mLiveSDK, mLiveTypeVal) + .builderSystemFloat(mContext, mLiveBean.getPull()); + } + + @Override + public void onCancel() { + EventBus.getDefault() + .post(new LiveFloatEvent() + .setmLiveBean(mLiveBean) + .setmLiveSDK(mLiveSDK) + .setmLiveType(mLiveType) + .setmLiveTypeVal(mLiveTypeVal)); + mContext.finish(); + } + }); + } } } } @@ -458,7 +494,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe Log.e("ry", "发送成功"); liveImDeletUtil.deleteMessages(message.getTargetId(), message.getMessageId()); if (isBackPressed) { - ((LiveAudienceActivity)mContext).closeRoom(); + ((LiveAudienceActivity) mContext).closeRoom(); } else { EventBus.getDefault().post(new LiveRoomChangeEvent(bean, liveType, liveTypeVal)); } @@ -524,7 +560,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe if (isBackPressed) { Micing = 0; - ((LiveAudienceActivity)mContext).closeRoom(); + ((LiveAudienceActivity) mContext).closeRoom(); } else { EventBus.getDefault().post(new LiveRoomChangeEvent(bean, liveType, liveTypeVal)); } @@ -1475,8 +1511,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.playLightAnim(); } } - public void resetLight(){ - mLighted=false; + + public void resetLight() { + mLighted = false; } public void setCoinNotEnough(boolean coinNotEnough) { diff --git a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java index e437ccaf7..3acd1b543 100644 --- a/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java +++ b/live/src/main/java/com/yunbao/live/views/SidebarViewHoler.java @@ -15,7 +15,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.views.SlideInBannerViewHolder; import com.yunbao.live.R; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/live/src/main/res/layout/view_flaot_live.xml b/live/src/main/res/layout/view_flaot_live.xml new file mode 100644 index 000000000..c33afb9c1 --- /dev/null +++ b/live/src/main/res/layout/view_flaot_live.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_play_ksy.xml b/live/src/main/res/layout/view_live_play_ksy.xml index a35a52ab0..a9d4c4e45 100644 --- a/live/src/main/res/layout/view_live_play_ksy.xml +++ b/live/src/main/res/layout/view_live_play_ksy.xml @@ -42,8 +42,7 @@ android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="right" - android:layout_marginBottom="20dp" - /> + android:layout_marginBottom="20dp" /> diff --git a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java index c3307ea63..0b9fd5630 100644 --- a/main/src/main/java/com/yunbao/main/activity/EntryActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/EntryActivity.java @@ -92,7 +92,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; diff --git a/main/src/main/java/com/yunbao/main/activity/LiveClassActivity.java b/main/src/main/java/com/yunbao/main/activity/LiveClassActivity.java index 10ee54281..9782dbc98 100644 --- a/main/src/main/java/com/yunbao/main/activity/LiveClassActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LiveClassActivity.java @@ -13,7 +13,7 @@ import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.utils.LiveStorge; import com.yunbao.main.R; import com.yunbao.main.adapter.MainHomeFollowAdapter; diff --git a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java index e7e0f27e8..489a950e0 100644 --- a/main/src/main/java/com/yunbao/main/activity/LoginActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/LoginActivity.java @@ -46,7 +46,7 @@ import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; 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 c0f3b76f5..ea9aa880b 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -54,11 +54,13 @@ import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.ChatRemarksBean; import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.IMLoginModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveSvgGiftBean; import com.yunbao.common.bean.UpdataListBean; import com.yunbao.common.custom.TabButtonGroup; import com.yunbao.common.dialog.InstructorOperationDialog; import com.yunbao.common.event.InstructorOperationEvent; +import com.yunbao.common.event.LiveFloatEvent; import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.NoviceInstructorEvent; import com.yunbao.common.event.RongIMConnectionStatusEvent; @@ -84,12 +86,12 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.live.utils.LiveStorge; import com.yunbao.live.views.ChatListViewHolder; +import com.yunbao.live.views.LiveFloatView; import com.yunbao.main.R; import com.yunbao.main.dialog.MainStartDialogFragment; import com.yunbao.main.dialog.ReturnUserDialog; @@ -1244,4 +1246,27 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene findViewById(R.id.banner_click).setVisibility(View.VISIBLE); } + @Subscribe(threadMode = ThreadMode.MAIN) + public void onLiveFloatEvent(LiveFloatEvent event) { + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + LiveFloatView.getInstance() + .setCallback(new LiveFloatView.LiveFloatViewCallback() { + @Override + public void invoke(Boolean aBoolean) { +// if (aBoolean) { +// mContext.finish(); +// } else { +// ToastUtil.show("未打开悬浮窗权限"); +// } + } + }) + .cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK(), event.getmLiveTypeVal()) + .builderFloat(mContext, event.getmLiveBean().getPull()); + } + },1500); + + } + } diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java index ff7f88a9c..c5f34a200 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity.java @@ -54,8 +54,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveReportActivity; -import com.yunbao.live.activity.PDLiveConversationActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.ReportCommunityBean; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; diff --git a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity2.java b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity2.java index f2ac9cbf8..14ed6c6c0 100644 --- a/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity2.java +++ b/main/src/main/java/com/yunbao/main/activity/MyWebViewActivity2.java @@ -41,7 +41,7 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveReportActivity; import com.yunbao.live.activity.SystemMessageActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.ReportCommunityBean; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; 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 64a6459b1..901d59d24 100644 --- a/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/PDLiveConversationListActivity.java @@ -54,7 +54,7 @@ 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.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.RecommendLiveRoomEvent; import com.yunbao.live.http.ImHttpUtil; import com.yunbao.live.http.LiveHttpUtil; diff --git a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java index e9b9abce7..2530af985 100644 --- a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java @@ -50,7 +50,7 @@ import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; diff --git a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java index 061575449..0359b644b 100644 --- a/main/src/main/java/com/yunbao/main/activity/SearchActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/SearchActivity.java @@ -24,7 +24,7 @@ import com.yunbao.common.manager.SearchHistoryRecordManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.RouteUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.main.R; import com.yunbao.main.event.JumpUserHomeEvent; diff --git a/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java index 36036bb1b..17cd55ab5 100644 --- a/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/WeekWebViewActivity.java @@ -8,7 +8,7 @@ import android.net.Uri; import android.os.Build; import android.provider.MediaStore; import androidx.annotation.RequiresApi; -import androidx.appcompat.app.AppCompatActivity; + import android.os.Bundle; import android.text.TextUtils; import android.view.View; @@ -35,7 +35,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.WebViewActivityMedal; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.dialog.LiveUserDialogFragment; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java index b7ef4a8aa..d7cbd14fd 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeFollowAdapter.java @@ -13,7 +13,7 @@ import com.yunbao.common.Constants; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.glide.ImgLoader; import com.yunbao.main.R; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.utils.MainIconUtil; /** diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java index e06415ee2..777b47a2d 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeLiveAdapter.java @@ -29,7 +29,7 @@ import com.yunbao.common.bean.WeekListBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.SVGAViewUtils; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.views.MainHomeLiveItemViewHolder; import com.yunbao.main.views.MainHomeLiveWeekItemViewHolder; diff --git a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java index 1a43e9696..a9bc1426b 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainHomeRemFollLiveAdapter.java @@ -20,7 +20,7 @@ import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.custom.RatioRoundImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.formatBigNum; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.MainIconUtil; diff --git a/main/src/main/java/com/yunbao/main/adapter/MainNearNearAdapter.java b/main/src/main/java/com/yunbao/main/adapter/MainNearNearAdapter.java index 0fdf6b977..9b41c4c43 100644 --- a/main/src/main/java/com/yunbao/main/adapter/MainNearNearAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/MainNearNearAdapter.java @@ -11,7 +11,7 @@ import android.widget.TextView; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.glide.ImgLoader; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.MainIconUtil; diff --git a/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java b/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java index d58e89dd0..cec95d4d2 100644 --- a/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java +++ b/main/src/main/java/com/yunbao/main/adapter/SearchAdapter.java @@ -22,7 +22,7 @@ import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.SearchUserBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java index 451c3a780..00658ea39 100644 --- a/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java +++ b/main/src/main/java/com/yunbao/main/dialog/OneLoginDialog.java @@ -26,11 +26,10 @@ import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; -import com.yunbao.main.activity.EntryActivity; import com.yunbao.main.activity.MainActivity; import static com.yunbao.common.CommonAppContext.home_zdy_img_cn; diff --git a/main/src/main/java/com/yunbao/main/presenter/CheckLivePresenter.java b/main/src/main/java/com/yunbao/main/presenter/CheckLivePresenter.java index 506faf542..0a240545d 100644 --- a/main/src/main/java/com/yunbao/main/presenter/CheckLivePresenter.java +++ b/main/src/main/java/com/yunbao/main/presenter/CheckLivePresenter.java @@ -14,7 +14,7 @@ import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.main.R; diff --git a/main/src/main/java/com/yunbao/main/views/AbsMainHomeChildViewHolder.java b/main/src/main/java/com/yunbao/main/views/AbsMainHomeChildViewHolder.java index f2b544584..152077445 100644 --- a/main/src/main/java/com/yunbao/main/views/AbsMainHomeChildViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/AbsMainHomeChildViewHolder.java @@ -4,7 +4,7 @@ import android.content.Context; import android.view.ViewGroup; import com.yunbao.common.views.AbsMainViewHolder; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.activity.MainActivity; /** diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java index 93418bf16..1c1e53fb3 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCommunityViewHolder.java @@ -4,7 +4,6 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; -import android.graphics.drawable.AnimationDrawable; import android.net.Uri; import android.os.Build; import android.os.Handler; @@ -23,7 +22,6 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; -import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -44,8 +42,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveReportActivity; -import com.yunbao.live.activity.SystemMessageActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.ReportCommunityBean; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; @@ -55,7 +52,6 @@ import com.yunbao.main.activity.FansActivity; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.dialog.EncourageDialog; import com.yunbao.main.event.MainHomeCommunityToChatEvent; -import com.yunbao.main.manager.imrongcloud.ConversationIMListManager; import com.yunbao.main.utils.BottomBarUtil; import com.yunbao.video.activity.VideoPlayActivity; import com.yunbao.video.bean.VideoBean; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java index e3c065aba..e5030a341 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeCsdViewHolder.java @@ -25,7 +25,7 @@ import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import static android.content.Context.CLIPBOARD_SERVICE; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java index 718457865..50ad28fc4 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeFollLiveViewHolder.java @@ -16,7 +16,7 @@ import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.RouteUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.WeekWebViewActivity; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeFollowViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeFollowViewHolder.java index 7c72c7389..0dfd0bc0f 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeFollowViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeFollowViewHolder.java @@ -14,7 +14,7 @@ import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.RouteUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.utils.LiveStorge; import com.yunbao.main.R; import com.yunbao.main.adapter.MainHomeFollowAdapter; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java index 8dc874dd9..27c60eba2 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveItemViewHolder.java @@ -16,7 +16,7 @@ import com.yunbao.common.custom.RatioRoundImageView; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.formatBigNum; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.MainIconUtil; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java index 37d175647..1ddc55e92 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveViewHolder.java @@ -37,7 +37,7 @@ import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.views.CustomViewHolder; import com.yunbao.live.activity.LiveAudienceActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.event.LiveRoomChangeEvent; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java index 0d3beb827..1012b4dd5 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeLiveWeekItemViewHolder.java @@ -19,7 +19,7 @@ import com.opensource.svgaplayer.SVGAVideoEntity; import com.yunbao.common.bean.WeekListBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.SVGAViewUtils; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import java.util.ArrayList; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java index 98ffe11b1..e8d85e942 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeRecomLiveViewHolder.java @@ -16,7 +16,7 @@ import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.RouteUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.WeekWebViewActivity; diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java index 8fd63e159..884016223 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeShopViewHolder.java @@ -22,7 +22,7 @@ import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ToastUtil; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.main.R; import com.yunbao.main.utils.BottomBarUtil; diff --git a/main/src/main/java/com/yunbao/main/views/MainNearNearViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainNearNearViewHolder.java index 5432dd54e..bf04942ab 100644 --- a/main/src/main/java/com/yunbao/main/views/MainNearNearViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainNearNearViewHolder.java @@ -12,7 +12,7 @@ import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.custom.ItemDecoration; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.OnItemClickListener; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.utils.LiveStorge; import com.yunbao.main.R; import com.yunbao.main.adapter.MainNearNearAdapter; diff --git a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java index 65dfd5afb..2bbca4b31 100644 --- a/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java +++ b/main/src/main/java/com/yunbao/main/views/UserHomeViewHolder2.java @@ -48,7 +48,7 @@ import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveReportActivity; -import com.yunbao.live.bean.LiveBean; +import com.yunbao.common.bean.LiveBean; import com.yunbao.live.bean.SearchUserBean; import com.yunbao.live.dialog.LiveShareDialogFragment; import com.yunbao.live.event.LiveRoomChangeEvent;