修复开播通知可能出现两天的情况

修复svga可能只播放一次的情况
This commit is contained in:
zlzw 2024-08-02 14:49:28 +08:00
parent f7db0b0768
commit 40ba4b8aa8
5 changed files with 27 additions and 22 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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");
}
}

View File

@ -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<QiniuLog>() {
@Override
public void onSuccess(QiniuLog data) {
if(data.getLog_type()==1){
if (data.getLog_type() == 1) {
LogUtil.shareFile(mContext);
}
}

View File

@ -33,10 +33,12 @@ import java.util.List;
@Route(path = RouteUtil.PATH_COMMUNITY_Activity)
public class MainHomeCommunityActivity extends AbsActivity {
private List<AnchorStartLiveBean> 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();
}