1.修改播放礼物特效代码
2:修改从房间进入其他页面出现不能回到房间的问题
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true"
|
||||
/>
|
||||
</application>
|
||||
|
||||
@@ -363,12 +363,35 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean shouldRestoreRoom() {
|
||||
// 检查是否应该恢复房间:
|
||||
// 1. 应用有正在播放的房间
|
||||
// 2. 应用应该显示房间
|
||||
// 3. 应用是从后台恢复的(通过检查 CommonAppContext 状态)
|
||||
return CommonAppContext.getInstance().isPlaying
|
||||
&& CommonAppContext.getInstance().isShow
|
||||
&& CommonAppContext.getInstance().wasInBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (isTaskRoot() &&CommonAppContext.getInstance().isPlaying && CommonAppContext.getInstance().isShow) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
|
||||
LogUtils.e("isShow", CommonAppContext.getInstance().isShow ,CommonAppContext.getInstance().isPlaying,isTaskRoot());
|
||||
// if (isTaskRoot() &&CommonAppContext.getInstance().isPlaying && CommonAppContext.getInstance().isShow) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
// 修改判断条件:不仅检查 isTaskRoot,还要检查是否是从后台恢复
|
||||
if (shouldRestoreRoom()) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS)
|
||||
.withString("form", "首页")
|
||||
.withString("roomId", CommonAppContext.getInstance().playId)
|
||||
.navigation();
|
||||
return;
|
||||
}
|
||||
|
||||
MvpPre.loginIm();
|
||||
@@ -425,12 +448,14 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
super.onStop();
|
||||
// mBinding.riv.removeCallbacks(mRivAnimationTask);
|
||||
// mBinding.riv.clearAnimation();
|
||||
CommonAppContext.getInstance().onAppBackground();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
// LogUtils.d(BaseApplication.getInstance().getToken());
|
||||
CommonAppContext.getInstance().onAppForeground();
|
||||
}
|
||||
|
||||
private final Runnable mRivAnimationTask = () -> {
|
||||
|
||||
Reference in New Issue
Block a user