diff --git a/common/src/main/java/com/yunbao/common/utils/SVGAViewUtils.java b/common/src/main/java/com/yunbao/common/utils/SVGAViewUtils.java index 1e72292da..c7085b77e 100644 --- a/common/src/main/java/com/yunbao/common/utils/SVGAViewUtils.java +++ b/common/src/main/java/com/yunbao/common/utils/SVGAViewUtils.java @@ -74,7 +74,7 @@ public class SVGAViewUtils { SVGA_CACHE.clear(); } public static void playEndClear(SVGAImageView svga, boolean isClear, SVGACallback callback) { - playEndClear(svga, isClear,1, null); + playEndClear(svga, isClear,0, null); } public static void playEndClear(SVGAImageView svga, boolean isClear) { playEndClear(svga, isClear,null); diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index 3d25e452b..efdacdffc 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -890,7 +890,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl */ private void startLiveInit() { if (isWifiProxy(mContext) || checkVPN((ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE))) { - ToastUtil.show(WordUtil.isNewZh()?"檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。": + ToastUtil.show(WordUtil.isNewZh() ? "檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。" : "It is detected that VPN or proxy is turned on. Please turn off VPN or proxy before starting the broadcast."); } else { boolean startPreview = ((LiveRyAnchorActivity) mContext).isStartPreview(); @@ -941,12 +941,12 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl return; } String title = mEditTitle.getText().toString().trim(); - LiveHttpUtil.newcreateRoom(title, mLiveClassID, mLiveType, mLiveTypeVal, mAvatarFile, IMLoginManager.get(mContext).getSelectClarity() + 1, false,new HttpCallback() { + LiveHttpUtil.newcreateRoom(title, mLiveClassID, mLiveType, mLiveTypeVal, mAvatarFile, IMLoginManager.get(mContext).getSelectClarity() + 1, false, new HttpCallback() { @Override public void onSuccess(int code, String msg, final String[] info) { + isHttpBack = false; if (code == 0 && info.length > 0) { L.e("开播", "createRoom------->" + info[0]); - isHttpBack = false; final CommonAppConfig appConfig = CommonAppConfig.getInstance(); UserBean u = appConfig.getUserBean(); ((LiveRyAnchorActivity) mContext).startLiveSuccess(info[0], mLiveType, mLiveTypeVal); diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java index 4883a5b0d..3d949e264 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java @@ -580,7 +580,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl } } - public void setFaceUnityNew(boolean init){ + public void setFaceUnityNew(boolean init) { LiveFaceUnityDialogNewFragment fragment = new LiveFaceUnityDialogNewFragment(mContext); fragment.setManager(manager); fragment.setDismissShowUi(mRootView); @@ -872,7 +872,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl */ private void startLiveInit() { if (isWifiProxy(mContext) || checkVPN((ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE))) { - ToastUtil.show(WordUtil.isNewZh()?"檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。": + ToastUtil.show(WordUtil.isNewZh() ? "檢測開啓了VPN或者代理,請先關閉VPN或者代理再開播。" : "It is detected that VPN or proxy is turned on. Please turn off VPN or proxy before starting the broadcast."); } else { boolean startPreview = ((LiveSwAnchorActivity) mContext).isStartPreview(); @@ -923,12 +923,12 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl return; } String title = mEditTitle.getText().toString().trim(); - LiveHttpUtil.newcreateRoom(title, mLiveClassID, mLiveType, mLiveTypeVal, mAvatarFile, IMLoginManager.get(mContext).getSelectClarity() + 1,true, new HttpCallback() { + LiveHttpUtil.newcreateRoom(title, mLiveClassID, mLiveType, mLiveTypeVal, mAvatarFile, IMLoginManager.get(mContext).getSelectClarity() + 1, true, new HttpCallback() { @Override public void onSuccess(int code, String msg, final String[] info) { + isHttpBack = false; if (code == 0 && info.length > 0) { L.e("开播", "createRoom------->" + info[0]); - isHttpBack = false; final CommonAppConfig appConfig = CommonAppConfig.getInstance(); UserBean u = appConfig.getUserBean(); ((LiveSwAnchorActivity) mContext).startLiveSuccess(info[0], mLiveType, mLiveTypeVal); @@ -944,7 +944,7 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl } }); } else { - ToastUtil.show(WordUtil.isNewZh()?"請求中,請勿重複點擊":"During request, please do not click repeatedly"); + ToastUtil.show(WordUtil.isNewZh() ? "請求中,請勿重複點擊" : "During request, please do not click repeatedly"); } } 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 e1655c875..848525f78 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -280,8 +280,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override - public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw); + public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw); } @Override @@ -495,8 +495,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class); new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override - public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw); + public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) { + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw); } @Override @@ -869,12 +869,12 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Override public void onError(RongIMClient.ConnectionErrorCode e) { - ToastUtil.show(R.string.net_error+""+e.toString()); + ToastUtil.show(R.string.net_error + "" + e.toString()); } @Override public void onDatabaseOpened(RongIMClient.DatabaseOpenStatus code) { - ToastUtil.show(R.string.net_error+""+code); + ToastUtil.show(R.string.net_error + "" + code); } }); @@ -1160,9 +1160,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene public void watchLive(LiveBean liveBean, String key, int position) { new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override - public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk,boolean isSw) { + public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk, boolean isSw) { MobclickAgent.onEvent(mContext, "home_page_enter_room", "首页点击直播间"); - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal),isSw); + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal), isSw); } @Override @@ -1233,8 +1233,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private void notifyLiveFlot() { if (startListNotifyList.iterator().hasNext()) { AnchorStartLiveBean bean = startListNotifyList.iterator().next(); + startListNotifyList.remove(bean); new AnchorStartLiveNotifyDialog(mContext, bean).setOnDismissListener(dialog -> { - startListNotifyList.remove(bean); if (startListNotifyList.iterator().hasNext()) { notifyLiveFlot(); } @@ -1598,7 +1598,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene @Subscribe(threadMode = ThreadMode.MAIN) public void onLiveFloatEvent(LiveFloatEvent event) { if (event != null && event.getmLiveBean() != null && !TextUtils.isEmpty(event.getmLiveBean().getPull())) { - new Handler().post(() -> LiveFloatView.getInstance().cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK() ==Constants.LIVE_SDK_SW, event.getmLiveTypeVal()).builderFloat(mContext, event.getmLiveBean().getPull(), LiveAudienceActivity.class)); + new Handler().post(() -> LiveFloatView.getInstance().cacheLiveData(event.getmLiveBean(), event.getmLiveType(), event.getmLiveSDK() == Constants.LIVE_SDK_SW, event.getmLiveTypeVal()).builderFloat(mContext, event.getmLiveBean().getPull(), LiveAudienceActivity.class)); } } @@ -1648,12 +1648,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene }); } - private void initLogUpdate(){ + + private void initLogUpdate() { LiveNetManager.get(mContext) .getLogUpdateStatus("1", new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(QiniuLog data) { - if(data.getLog_type()==1){ + if (data.getLog_type() == 1) { LogUtil.shareFile(mContext); } } diff --git a/main/src/main/java/com/yunbao/main/activity/MainHomeCommunityActivity.java b/main/src/main/java/com/yunbao/main/activity/MainHomeCommunityActivity.java index 8002a199a..8ba330d9e 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainHomeCommunityActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainHomeCommunityActivity.java @@ -33,10 +33,12 @@ import java.util.List; @Route(path = RouteUtil.PATH_COMMUNITY_Activity) public class MainHomeCommunityActivity extends AbsActivity { private List startListNotifyList = new ArrayList<>(); + @Override protected int getLayoutId() { return R.layout.activity_main_home_community; } + @Override protected void main() { EventBus.getDefault().register(this); @@ -63,6 +65,7 @@ public class MainHomeCommunityActivity extends AbsActivity { super.onDestroy(); EventBus.getDefault().unregister(this); } + @Subscribe(threadMode = ThreadMode.MAIN) public void onNotifyAnchorLive(AnchorStartLiveBean bean) { if (!IMLoginManager.get(mContext).isLiveNotifySettings()) return; @@ -74,11 +77,12 @@ public class MainHomeCommunityActivity extends AbsActivity { startListNotifyList.add(bean); } } + private void notifyLiveFlot() { if (startListNotifyList.iterator().hasNext()) { AnchorStartLiveBean bean = startListNotifyList.iterator().next(); + startListNotifyList.remove(bean); new AnchorStartLiveNotifyDialog(mContext, bean).setOnDismissListener(dialog -> { - startListNotifyList.remove(bean); if (startListNotifyList.iterator().hasNext()) { notifyLiveFlot(); }