个播匹配PK是否在匹配中判断逻辑优化
This commit is contained in:
@@ -266,7 +266,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
|
||||
final RoomPkBean pkBean = AvRoomDataManager.get().roomPkLiveData.getValue();
|
||||
if (AvRoomDataManager.get().isRoomOwner() && !AvRoomDataManager.get().isCpRoom()) {
|
||||
boolean isMatch = AvRoomDataManager.get().getPkMatchStartTime() > 0;
|
||||
boolean isMatch = false;
|
||||
boolean isEndPk = false;
|
||||
String str = AvRoomDataManager.get().isOpenAnotherPKMode() ? "主播PK中" : "主播PK";
|
||||
if (pkBean != null) {
|
||||
@@ -277,15 +277,16 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
str = "结束PK";
|
||||
isEndPk = true;
|
||||
}
|
||||
} else {
|
||||
isMatch = AvRoomDataManager.get().getPkMatchStartTime() > 0;
|
||||
if (isMatch) str = "PK匹配中";
|
||||
}
|
||||
|
||||
if (isMatch) {
|
||||
str = "PK匹配中";
|
||||
}
|
||||
int icon = AvRoomDataManager.get().isOpenAnotherPKMode() ?
|
||||
R.drawable.ic_room_opt_single_pk_open :
|
||||
R.drawable.ic_room_opt_single_pk_in;
|
||||
boolean finalIsEndPk = isEndPk;
|
||||
boolean finalIsMatch = isMatch;
|
||||
optAdapter.addData(new OptAction(icon, str, () -> {
|
||||
Map<String, String> arguments = new HashMap<>();
|
||||
arguments.put("name", "个播PK");
|
||||
@@ -304,7 +305,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMatch) {
|
||||
if (finalIsMatch) {
|
||||
SingleRoomPKModel.INSTANCE
|
||||
.cancelSingleRoomPkMatch()
|
||||
.doOnSuccess(s -> SingleRoomPKCreateActivity.start(getContext()))
|
||||
|
@@ -270,7 +270,8 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
|
||||
private fun initRoomPkOrder(pkMatchStartTime: Long) {
|
||||
if (pkMatchDisposable?.isDisposed == true) return
|
||||
if (!AvRoomDataManager.get().isRoomOwner) return
|
||||
pkMatchDisposable?.dispose()
|
||||
val residueSeconds = (pkMatchStartTime - CurrentTimeUtils.getCurrentTime()) / 1000
|
||||
if (residueSeconds > 0) {
|
||||
gameBinding.llRoomPkOrder.visibility = View.VISIBLE
|
||||
@@ -280,6 +281,7 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.doOnComplete {
|
||||
gameBinding.llRoomPkOrder.visibility = View.GONE
|
||||
AvRoomDataManager.get().pkMatchStartTime = 0
|
||||
}
|
||||
.subscribe { aLong: Long ->
|
||||
gameBinding.tvRoomPkOrderTime.text = TimeUtils.getFormatTimeString(
|
||||
|
@@ -1293,6 +1293,7 @@ public final class IMNetEaseManager {
|
||||
if (AvRoomDataManager.get().isRoomOwner()) {
|
||||
AudioEngineManager.get().disconnectOtherRoom();
|
||||
}
|
||||
AvRoomDataManager.get().setPkMatchStartTime(0);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_RESULT:
|
||||
AvRoomDataManager.get().roomPkLiveData.postValue(roomPkBean);
|
||||
|
@@ -25,5 +25,5 @@ only_arm64=false
|
||||
|
||||
channel_file=channel.txt
|
||||
|
||||
version_name=5.5.3
|
||||
version_code=553
|
||||
version_name=5.6.0.3
|
||||
version_code=560
|
Reference in New Issue
Block a user