1:修改K歌房

This commit is contained in:
2025-10-27 09:43:19 +08:00
parent 8ebe1530ee
commit 8631fdbdbf
20 changed files with 208 additions and 131 deletions

View File

@@ -11,9 +11,9 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 2, "versionCode": 40,
"versionName": "1.0.0.1", "versionName": "1.0.5.2",
"outputFile": "羽声_1.0.0.1_2.apk" "outputFile": "羽声_1.0.5.2_40.apk"
} }
], ],
"elementType": "File", "elementType": "File",
@@ -22,14 +22,14 @@
"minApi": 28, "minApi": 28,
"maxApi": 30, "maxApi": 30,
"baselineProfiles": [ "baselineProfiles": [
"baselineProfiles/1/羽声_1.0.0.1_2.dm" "baselineProfiles/1/羽声_1.0.5.2_40.dm"
] ]
}, },
{ {
"minApi": 31, "minApi": 31,
"maxApi": 2147483647, "maxApi": 2147483647,
"baselineProfiles": [ "baselineProfiles": [
"baselineProfiles/0/羽声_1.0.0.1_2.dm" "baselineProfiles/0/羽声_1.0.5.2_40.dm"
] ]
} }
], ],

View File

@@ -1,4 +1,4 @@
package com.xscm.midi; package com.qxcm.qxlive;
import android.app.Activity; import android.app.Activity;

View File

@@ -1,4 +1,4 @@
package com.xscm.midi; package com.qxcm.qxlive;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
@@ -19,9 +19,9 @@ import java.util.List;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
public class LaunchPresenter extends BasePresenter<LaunchContacter.View> implements LaunchContacter.ILoginPre { public class LaunchPresenter extends BasePresenter<com.qxcm.qxlive.LaunchContacter.View> implements com.qxcm.qxlive.LaunchContacter.ILoginPre {
public LaunchPresenter(LaunchContacter.View view, Context context) { public LaunchPresenter(com.qxcm.qxlive.LaunchContacter.View view, Context context) {
super(view, context); super(view, context);
} }

View File

@@ -1,4 +1,4 @@
package com.xscm.midi.presenter; package com.qxcm.qxlive.presenter;
import android.content.Context; import android.content.Context;

View File

@@ -28,8 +28,8 @@ isBuildModule=false
#org.gradle.deamon=false #org.gradle.deamon=false
android.injected.testOnly=false android.injected.testOnly=false
APP_VERSION_NAME=1.0.0.1 APP_VERSION_NAME=1.0.5.2
APP_VERSION_CODE=2 APP_VERSION_CODE=40
org.gradle.jvm.toolchain.useLegacyAdapters=false org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15 #org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15

View File

@@ -192,6 +192,9 @@ public class GiftTwoDetailsFragment extends BaseMvpFragment<RewardGiftPresenter,
@Override @Override
public void giftPack(List<GiftPackBean> giftPackBean) { public void giftPack(List<GiftPackBean> giftPackBean) {
giftPackList = new ArrayList<>(); giftPackList = new ArrayList<>();
if (getActivity()==null){
return;
}
if (giftPackBean != null && giftPackBean.size() > 0) { if (giftPackBean != null && giftPackBean.size() > 0) {

View File

@@ -124,7 +124,7 @@ public class RoomManager {
} }
CommonAppContext.getInstance().isRoomJoininj=true; CommonAppContext.getInstance().isRoomJoininj=true;
// 检查是否有有效的缓存数据 // 检查是否有有效的缓存数据
// RoomInfoResp roomInfo = getCachedRoomData(roomId); RoomInfoResp roomInfo = getCachedRoomData(roomId);
// 检查是否是当前房间且用户在线 // 检查是否是当前房间且用户在线
// boolean isCurrentRoom = isCurrentRoom(roomId); // boolean isCurrentRoom = isCurrentRoom(roomId);
if (CommonAppContext.getInstance().playId == null) { if (CommonAppContext.getInstance().playId == null) {
@@ -138,10 +138,10 @@ public class RoomManager {
CommonAppContext.getInstance().isRoomJoininj=false; CommonAppContext.getInstance().isRoomJoininj=false;
EventBus.getDefault().post(new RoomOutEvent()); EventBus.getDefault().post(new RoomOutEvent());
} else if (CommonAppContext.getInstance().lable_id.equals("6")) { } else if (CommonAppContext.getInstance().lable_id.equals("6")) {
upInfo(context, roomId, password, true, null, true); upInfo(context, roomId, password, true, roomInfo, true);
return; return;
} }
isUserOnline(context, roomId, password, null); isUserOnline(context, roomId, password, roomInfo);
} }
@@ -346,11 +346,19 @@ public class RoomManager {
return; return;
} }
if (isOnline){
ARouter.getInstance()
.build(ARouteConstants.ROOM_DETAILS)
.navigation(context);
}else {
// 使用ARouter跳转到房间页面 // 使用ARouter跳转到房间页面
ARouter.getInstance() ARouter.getInstance()
.build(ARouteConstants.ROOM_DETAILS) .build(ARouteConstants.ROOM_DETAILS)
.with(bundle) .with(bundle)
.navigation(context); .navigation(context);
}
} catch (Exception e) { } catch (Exception e) {
Logger.e(TAG, "跳转房间页面失败: " + e.getMessage()); Logger.e(TAG, "跳转房间页面失败: " + e.getMessage());

View File

@@ -3752,7 +3752,7 @@ public class RetrofitClient {
if (string != null) { if (string != null) {
int code = string.getCode(); int code = string.getCode();
if (code == 1) { if (code == 1) {
observer.onNext(string.getMsg()); observer.onNext(string.getMsg()!= null ? string.getMsg() : "");
} else if (code == 301) { } else if (code == 301) {
try { try {

View File

@@ -206,6 +206,9 @@ public class RewardGiftPresenter extends BasePresenter<RewardGiftContacts.View>
if (MvpRef == null) { if (MvpRef == null) {
MvpRef = new WeakReference<>(mView); MvpRef = new WeakReference<>(mView);
} }
if (giftPackBeans == null) {
return;
}
MvpRef.get().giftPack(giftPackBeans); MvpRef.get().giftPack(giftPackBeans);
} }
}); });

View File

@@ -183,6 +183,17 @@ public class ImageUtils {
public static void loadHeadCC(String path, ImageView mImageView) { public static void loadHeadCC(String path, ImageView mImageView) {
if (mImageView == null) {
return;
}
Context context = mImageView.getContext();
if (context instanceof android.app.Activity) {
android.app.Activity activity = (android.app.Activity) context;
if (activity.isFinishing() || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && activity.isDestroyed())) {
return;
}
}
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView); Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
} }

View File

@@ -78,6 +78,9 @@ public class GiftDisplayManager {
} }
public void receiveGift(GiftBean gift) { public void receiveGift(GiftBean gift) {
if (isInBackground){
return;
}
if (gift == null) return; if (gift == null) return;
Log.d("GiftDisplayManager", "Received gift: " + gift.getSenderName() + Log.d("GiftDisplayManager", "Received gift: " + gift.getSenderName() +
@@ -201,6 +204,20 @@ public class GiftDisplayManager {
// 立即处理队列,而不是延迟 // 立即处理队列,而不是延迟
mainHandler.post(this::processGiftQueue); mainHandler.post(this::processGiftQueue);
} }
private boolean isInBackground=false;
public void isBackGround(){
for (GiftDisplayView view : displayViews) {
view.finishAnimationImmediately();
}
giftQueue.clear();
accumulatedGifts.clear();
isProcessingQueue = false;
isInBackground=true;
}
public void becomeFront(){
isInBackground=false;
}
public void clearAll() { public void clearAll() {
Log.d("GiftDisplayManager", "Clear all gifts and queue"); Log.d("GiftDisplayManager", "Clear all gifts and queue");

View File

@@ -124,7 +124,9 @@ public class GiftDisplayView extends FrameLayout {
// 临时用颜色代替 // 临时用颜色代替
// avatarImageView.setBackgroundColor(getRandomColor()); // avatarImageView.setBackgroundColor(getRandomColor());
if (avatarImageView!=null&&avatarImageView.getContext()!=null) {
ImageUtils.loadHeadCC(avatarUrl, avatarImageView); ImageUtils.loadHeadCC(avatarUrl, avatarImageView);
}
} else { } else {
avatarImageView.setBackgroundColor(Color.LTGRAY); avatarImageView.setBackgroundColor(Color.LTGRAY);
} }

View File

@@ -265,9 +265,9 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
mIvRipple.post(() -> { mIvRipple.post(() -> {
mIvRipple.stopAnimation(true); mIvRipple.stopAnimation(true);
CommonAppContext.getInstance().onlineMap.put(pitBean.getUser_id(),1); CommonAppContext.getInstance().onlineMap.put(pitBean.getUser_id(),1);
mIvRipple.setVisibility(GONE); mIvRipple.setVisibility(INVISIBLE);
}); });
mIvRipple.setVisibility(GONE); mIvRipple.setVisibility(INVISIBLE);
} else { } else {
mIvRipple.setVisibility(VISIBLE); mIvRipple.setVisibility(VISIBLE);
mIvRipple.post(() -> { mIvRipple.post(() -> {

View File

@@ -28,7 +28,7 @@ import java.util.Map;
public class CommonAppConfig { public class CommonAppConfig {
public static final String PACKAGE_NAME = "com.xscm.liveShort"; public static final String PACKAGE_NAME = "com.xscm.liveShort";
public static final String PACKAGE_NAME1 = "com.xscm.midi"; public static final String PACKAGE_NAME1 = "com.qxcm.qxlive";
//Http请求头 Header //Http请求头 Header
public static final Map<String, String> HEADER = new HashMap<>(); public static final Map<String, String> HEADER = new HashMap<>();
//域名 //域名

View File

@@ -51,7 +51,7 @@ public class DropHourlView extends LinearLayout {
public void run() { public void run() {
//设置初始位置 //设置初始位置
int sh = ScreenUtils.getScreenHeight(); int sh = ScreenUtils.getScreenHeight();
int sw = ScreenUtils.getScreenWidth()-200; int sw = ScreenUtils.getScreenWidth();
// setBackgroundResource(R.drawable.bg_home_drop_view); // setBackgroundResource(R.drawable.bg_home_drop_view);
int y = (int) (0.5f * sh) - getHeight(); int y = (int) (0.5f * sh) - getHeight();
// 确保Y坐标不会超出屏幕范围 // 确保Y坐标不会超出屏幕范围

View File

@@ -53,7 +53,7 @@ public class DropRedView extends LinearLayout {
int sh = ScreenUtils.getScreenHeight(); int sh = ScreenUtils.getScreenHeight();
int sw = ScreenUtils.getScreenWidth(); int sw = ScreenUtils.getScreenWidth();
// setBackgroundResource(R.drawable.bg_home_drop_view); // setBackgroundResource(R.drawable.bg_home_drop_view);
int y = (int) (0.5f * sh) - getHeight(); int y = (int) (0.2f * sh) - getHeight();
// 确保Y坐标不会超出屏幕范围 // 确保Y坐标不会超出屏幕范围
y = Math.max(0, Math.min(y, sh - getHeight())); y = Math.max(0, Math.min(y, sh - getHeight()));
// int x = sw - getWidth();//这是靠右边展示的 // int x = sw - getWidth();//这是靠右边展示的

View File

@@ -172,6 +172,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
fun addActiveDialogFragment(dialogFragment: Fragment) { fun addActiveDialogFragment(dialogFragment: Fragment) {
activeDialogFragments.add(dialogFragment) activeDialogFragments.add(dialogFragment)
} }
override fun doDone() { override fun doDone() {
isOnline = intent.getBooleanExtra("isOnline", false) isOnline = intent.getBooleanExtra("isOnline", false)
password = intent.getStringExtra("password") password = intent.getStringExtra("password")
@@ -286,7 +287,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
LogUtils.e("RoomActivity", "onPause") LogUtils.e("RoomActivity", "onPause")
GiftDisplayManager.getInstance().clearAll()
if (mRoomInfoResp != null) { if (mRoomInfoResp != null) {
if (mRoomInfoResp!!.room_info.type_id != "6") { if (mRoomInfoResp!!.room_info.type_id != "6") {
// 只有在用户主动离开应用时才执行最小化操作 // 只有在用户主动离开应用时才执行最小化操作
@@ -370,7 +371,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
// 调用退出房间方法 // 调用退出房间方法
MessageListenerSingleton.quitGroup(roomId); MessageListenerSingleton.quitGroup(roomId);
quit(); quit();
if (mRoomInfoResp?.getRoom_info()?.getLabel_id() != null && mRoomInfoResp?.getRoom_info()?.getLabel_id() if (mRoomInfoResp?.getRoom_info()?.getLabel_id() != null && mRoomInfoResp?.getRoom_info()
?.getLabel_id()
.equals("5") .equals("5")
) { ) {
jiaR(); jiaR();
@@ -475,6 +477,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga() QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
cleanupResources() cleanupResources()
} }
private lateinit var giftManager: GiftDisplayManager private lateinit var giftManager: GiftDisplayManager
private val testHandler = Handler() private val testHandler = Handler()
private var testRunnable: Runnable? = null private var testRunnable: Runnable? = null
@@ -548,8 +551,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
// 初始化礼物管理器 // 初始化礼物管理器
giftManager = GiftDisplayManager.getInstance() GiftDisplayManager.getInstance().setupDisplayView(mBinding!!.giftContainer)
giftManager.setupDisplayView(mBinding!!.giftContainer)
} }
@@ -586,25 +588,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {} override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
} }
private fun setview(resp: RoomInfoResp?) { private fun setview(resp: RoomInfoResp?) {
if (resp == null) if (resp == null)
return return
AppStateManager.getInstance().roomInfo = resp
this.mRoomInfoResp = resp this.mRoomInfoResp = resp
val roomBean = resp.room_info val roomBean = resp.room_info
this.mRoomBean = roomBean this.mRoomBean = roomBean
this.mRoomUserBean = resp.user_info this.mRoomUserBean = resp.user_info
this.mRoomOwnerBean = resp.room_owner this.mRoomOwnerBean = resp.room_owner
this.mPitList = mRoomBean!!.pit_list this.mPitList = mRoomBean!!.pit_list
this.roomId = roomBean.room_id
CommonAppContext.getInstance().isPlaying = true MessageListenerSingleton.getInstance().joinGroup(roomId) //加入房间im
CommonAppContext.getInstance().playId = roomId
CommonAppContext.getInstance().playName = mRoomBean!!.room_name
CommonAppContext.getInstance().playCover = resp.room_info.room_cover
CommonAppContext.getInstance().showSelf = resp.is_show_self == 1
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar) ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
mBinding!!.roomTop.name.text = roomBean.room_name mBinding!!.roomTop.name.text = roomBean.room_name
mBinding!!.roomTop.idVal.text = "ID:" + roomBean.room_number mBinding!!.roomTop.idVal.text = "ID:" + roomBean.room_number
if (mRoomUserBean?.getIs_room_owner() == 1) { if (mRoomUserBean?.getIs_room_owner() == 1) {
@@ -619,6 +616,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
number = roomBean.online_number number = roomBean.online_number
mBinding!!.roomTop.tvNum.text = number.toString() + "" mBinding!!.roomTop.tvNum.text = number.toString() + ""
val userIds = StringBuilder() val userIds = StringBuilder()
for (i in mRoomInfoResp!!.room_info.pit_list.indices) { for (i in mRoomInfoResp!!.room_info.pit_list.indices) {
val userId = mRoomInfoResp!!.room_info.pit_list[i].user_id val userId = mRoomInfoResp!!.room_info.pit_list[i].user_id
@@ -640,6 +638,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else { } else {
Log.e("Fragment", "Fragment transaction skipped due to state loss.") Log.e("Fragment", "Fragment transaction skipped due to state loss.")
} }
LogUtils.e("加入", roomId)
CommonAppContext.getInstance().isPlaying = true
CommonAppContext.getInstance().playId = roomId
CommonAppContext.getInstance().playName = mRoomBean!!.room_name
CommonAppContext.getInstance().playCover = resp.room_info.room_cover
CommonAppContext.getInstance().showSelf = resp.is_show_self == 1
if (mRoomUserBean?.getIs_collect() == 1) { if (mRoomUserBean?.getIs_collect() == 1) {
mBinding!!.roomTop.btnFollow.background = mBinding!!.roomTop.btnFollow.background =
@@ -653,6 +659,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
) )
mBinding!!.roomTop.btnFollow.setTextColor(ColorManager.getInstance().buttonColorInt) mBinding!!.roomTop.btnFollow.setTextColor(ColorManager.getInstance().buttonColorInt)
mBinding!!.roomTop.btnFollow.text = "收藏" mBinding!!.roomTop.btnFollow.text = "收藏"
// mBinding.roomTop.btnFollow.setBackground(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.collect));
} }
if ((roomBean.type_id == "3" || roomBean.type_id == "1" || roomBean.type_id == "4") && roomBean.label_id == "2") { if ((roomBean.type_id == "3" || roomBean.type_id == "1" || roomBean.type_id == "4") && roomBean.label_id == "2") {
AgoraManager.getInstance(this).isBjMusic = false AgoraManager.getInstance(this).isBjMusic = false
@@ -662,10 +669,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
AgoraManager.stopMuisc() AgoraManager.stopMuisc()
initializeAudio() initializeAudio()
toutiao() toutiao()
upRoomInfo(resp) upRoomInfo(resp)
instView() instView()
if (mRoomInfoResp!!.user_info.pit_number == 9 && mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId() if (mRoomInfoResp!!.user_info.pit_number == 9 && mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()
@@ -678,18 +683,31 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
ivSoundEffects(false) ivSoundEffects(false)
} }
if (mRoomInfoResp!!.room_info.type_id == "7" || mRoomInfoResp!!.room_info.type_id == "2") { if (resp.room_info.type_id == "7" || resp.room_info.type_id == "2") {
mBinding!!.rlMore.visibility = View.GONE mBinding!!.rlMore.visibility = View.GONE
mBinding!!.rlMisc.visibility = View.GONE mBinding!!.rlMisc.visibility = View.GONE
} }
setupEffectView() setupEffectView()
// 使用Handler延迟执行确保Fragment视图已完全创建 // 使用Handler延迟执行确保Fragment视图已完全创建
Handler(Looper.getMainLooper()).post { Handler(Looper.getMainLooper()).post {
if (publicScreenFragment != null && publicScreenFragment!!.isAdded && publicScreenFragment!!.view != null) { if (publicScreenFragment != null && publicScreenFragment!!.isAdded && publicScreenFragment!!.view != null) {
publicScreenFragment!!.getUpRoomInfo(resp) publicScreenFragment!!.getUpRoomInfo(resp)
} }
} }
if (mRoomInfoResp!!.gift_cycle != null && mRoomInfoResp!!.gift_cycle.xlh_info != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status == "1") {
mBinding?.xlhRk?.visibility = View.VISIBLE
xlhDjs(mRoomInfoResp!!.gift_cycle.xlh_info.end_time)
} else {
mBinding?.xlhRk?.visibility = View.INVISIBLE
releaseCountDownTimer1()
}
if (mRoomInfoResp!!.hour_ranking_open == 1) {
mBinding!!.clXsb.visibility = View.VISIBLE
} else {
mBinding!!.clXsb.visibility = View.GONE
}
} }
@@ -849,8 +867,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
mBinding!!.redBj.setOnClickListener { mBinding!!.redBj.setOnClickListener {
if (qxRedPacketManager!!.getAllRedPackets().size == 1) { if (qxRedPacketManager!!.getAllRedPackets().size == 1) {
redPacketInfo = qxRedPacketManager!!.getAllRedPackets().get(0) redPacketInfo = qxRedPacketManager!!.getAllRedPackets().get(0)
if (qxRedPacketManager!!.getAllRedPackets().get(0)!=null && qxRedPacketManager!!.getAllRedPackets().get(0).is_qiang==1){ if (qxRedPacketManager!!.getAllRedPackets().get(0) != null && qxRedPacketManager!!.getAllRedPackets()
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", qxRedPacketManager!!.getAllRedPackets().get(0).getRedpacket_id()).navigation(); .get(0).is_qiang == 1
) {
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT)
.withString("redpacketId", qxRedPacketManager!!.getAllRedPackets().get(0).getRedpacket_id())
.navigation();
} else { } else {
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity) redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1) redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
@@ -867,7 +889,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onRedPacketClick(redPacketInfos: RedPacketInfo?, position: Int) { override fun onRedPacketClick(redPacketInfos: RedPacketInfo?, position: Int) {
redPacketInfo = redPacketInfos redPacketInfo = redPacketInfos
if (redPacketInfos != null && redPacketInfos.is_qiang == 1) { if (redPacketInfos != null && redPacketInfos.is_qiang == 1) {
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", redPacketInfos.getRedpacket_id()).navigation(); ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT)
.withString("redpacketId", redPacketInfos.getRedpacket_id()).navigation();
} else { } else {
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity) redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1) redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
@@ -1359,7 +1382,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
giftBean.senderName = messageEvent.text.toUserInfo?.nickname giftBean.senderName = messageEvent.text.toUserInfo?.nickname
giftBean.senderAvatarUrl = messageEvent.text.toUserInfo?.avatar giftBean.senderAvatarUrl = messageEvent.text.toUserInfo?.avatar
giftBean.number = messageEvent.text.gift_num.toInt() giftBean.number = messageEvent.text.gift_num.toInt()
giftManager.receiveGift(giftBean) GiftDisplayManager.getInstance().receiveGift(giftBean)
} }
// } // }
hand1005(messageEvent, text) hand1005(messageEvent, text)
@@ -1495,10 +1518,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (messageEvent.text.xlh_data != null) { if (messageEvent.text.xlh_data != null) {
if (messageEvent.text.xlh_data.status == 1) { if (messageEvent.text.xlh_data.status == 1) {
mBinding!!.xlhRk.visibility = View.VISIBLE mBinding?.xlhRk?.visibility = View.VISIBLE
xlhDjs(messageEvent.text.xlh_data.end_time) xlhDjs(messageEvent.text.xlh_data.end_time)
} else { } else {
mBinding!!.xlhRk.visibility = View.INVISIBLE mBinding?.xlhRk?.visibility = View.INVISIBLE
releaseCountDownTimer1() releaseCountDownTimer1()
} }
} }
@@ -1526,10 +1549,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (xlhBean.from_type == 100) { if (xlhBean.from_type == 100) {
if (xlhBean.xlh_data != null) { if (xlhBean.xlh_data != null) {
if (xlhBean.xlh_data.status == 1) { if (xlhBean.xlh_data.status == 1) {
mBinding!!.xlhRk.visibility = View.VISIBLE mBinding?.xlhRk?.visibility = View.VISIBLE
xlhDjs(xlhBean.xlh_data.end_time) xlhDjs(xlhBean.xlh_data.end_time)
} else { } else {
mBinding!!.xlhRk.visibility = View.INVISIBLE mBinding?.xlhRk?.visibility = View.INVISIBLE
releaseCountDownTimer1() releaseCountDownTimer1()
} }
} }
@@ -1591,7 +1614,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setTime(time1) setTime(time1)
// mBinding.tvDjs.setText(time1 + ""); // mBinding.tvDjs.setText(time1 + "");
if (time1 == 0) { if (time1 == 0) {
mBinding!!.xlhRk.visibility = View.INVISIBLE mBinding?.xlhRk?.visibility = View.INVISIBLE
} }
} }
@@ -1615,7 +1638,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
fun setTime(seconds: Int) { fun setTime(seconds: Int) {
if (seconds == 0) { if (seconds == 0) {
mBinding!!.xlhRk.visibility = View.INVISIBLE mBinding?.xlhRk?.visibility = View.INVISIBLE
return return
} }
val formattedTime = formatTime(seconds) val formattedTime = formatTime(seconds)
@@ -2616,8 +2639,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
} }
emotionPickerDialog.show() emotionPickerDialog.show()
} } else if (id == R.id.iv_chat) {
else if (id == R.id.iv_chat) {
if (mRoomInfoResp!!.user_info.is_mute == "1") { if (mRoomInfoResp!!.user_info.is_mute == "1") {
ToastUtils.show("您已经被禁言") ToastUtils.show("您已经被禁言")
} else { } else {
@@ -2832,7 +2854,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
appStateListener!!.isAppInBackground = true appStateListener!!.isAppInBackground = true
} }
QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga() QXGiftPlayerManager.getInstance(applicationContext).destroyEffectSvga()
ARouter.getInstance() ARouter.getInstance()
.build(ARouteConstants.ME) .build(ARouteConstants.ME)
.navigation() .navigation()
@@ -3372,10 +3393,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setupEffectView() setupEffectView()
if (mRoomInfoResp!!.gift_cycle != null && mRoomInfoResp!!.gift_cycle.xlh_info != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status == "1") { if (mRoomInfoResp!!.gift_cycle != null && mRoomInfoResp!!.gift_cycle.xlh_info != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status != null && mRoomInfoResp!!.gift_cycle.xlh_info.xlh_status == "1") {
mBinding!!.xlhRk.visibility = View.VISIBLE mBinding?.xlhRk?.visibility = View.VISIBLE
xlhDjs(mRoomInfoResp!!.gift_cycle.xlh_info.end_time) xlhDjs(mRoomInfoResp!!.gift_cycle.xlh_info.end_time)
} else { } else {
mBinding!!.xlhRk.visibility = View.INVISIBLE mBinding?.xlhRk?.visibility = View.INVISIBLE
releaseCountDownTimer1() releaseCountDownTimer1()
} }
@@ -3688,9 +3709,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (true) GiftDisplayManager.getInstance().setupDisplayView(mBinding?.giftContainer)
return
LogUtils.e("RoomActivity", "onResume")
CommonAppContext.getInstance().isShow = true CommonAppContext.getInstance().isShow = true
CommonAppContext.getInstance().isPlaying = true CommonAppContext.getInstance().isPlaying = true
CommonAppContext.getInstance().isRoomJoininj = false CommonAppContext.getInstance().isRoomJoininj = false
@@ -3698,8 +3717,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
userLeaving = true userLeaving = true
MvpPre!!.roomRedPackets(roomId); MvpPre!!.roomRedPackets(roomId);
if ((mRoomInfoResp?.room_info?.type_id.equals("1")||mRoomInfoResp?.room_info?.type_id.equals("8")||mRoomInfoResp?.room_info?.type_id.equals("3") LogUtils.e("RoomActivity", "onResume")
||mRoomInfoResp?.room_info?.type_id.equals("4")) && mRoomInfoResp?.room_info?.label_id.equals("2") ){
if ((mRoomInfoResp?.room_info?.type_id.equals("1") || mRoomInfoResp?.room_info?.type_id.equals("8") || mRoomInfoResp?.room_info?.type_id.equals(
"3"
)
|| mRoomInfoResp?.room_info?.type_id.equals("4")) && mRoomInfoResp?.room_info?.label_id.equals("2")
) {
return return
} }
if (isInBackground) { if (isInBackground) {
@@ -3715,11 +3739,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
resumeRoomState() resumeRoomState()
setupEffectView() setupEffectView()
MvpPre!!.postRoomInfo(CommonAppContext.getInstance().playId) MvpPre?.postRoomInfo(CommonAppContext.getInstance().playId)
} }
// 延迟调整布局,确保视图已经完全加载 // 延迟调整布局,确保视图已经完全加载
mBinding!!.mainContentContainer.post { this.adjustLayoutHeights() } mBinding?.mainContentContainer?.post { this.adjustLayoutHeights() }
} }
// 添加检查房间连接状态的方法 // 添加检查房间连接状态的方法
@@ -4198,7 +4222,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (qxRedPacketManager != null) { if (qxRedPacketManager != null) {
qxRedPacketManager!!.destroyRedpacketInfo() qxRedPacketManager!!.destroyRedpacketInfo()
} }
giftManager.clearAll() GiftDisplayManager.getInstance().clearAll()
mBinding!!.giftContainer.removeAllViews() mBinding!!.giftContainer.removeAllViews()
// 确保父类的 onDestroy 被调用 // 确保父类的 onDestroy 被调用
super.finish() super.finish()

View File

@@ -817,7 +817,9 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
// dismiss(); // dismiss();
if (mBinding.viewPager.getCurrentItem() == 0) { if (mBinding.viewPager.getCurrentItem() == 0) {
if (MvpPre!=null) {
MvpPre.getGiftPackListCount(); MvpPre.getGiftPackListCount();
}
GiftPackEvent giftPackEvent = new GiftPackEvent(); GiftPackEvent giftPackEvent = new GiftPackEvent();
giftPackEvent.setBdid(beibaoId); giftPackEvent.setBdid(beibaoId);
EventBus.getDefault().post(giftPackEvent); EventBus.getDefault().post(giftPackEvent);

View File

@@ -132,7 +132,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
public void roomInfoUpdate(RoomInfoResp resp) { public void roomInfoUpdate(RoomInfoResp resp) {
roomInfoResp = resp; roomInfoResp = resp;
upData(); // upData();
} }
private void upData() { private void upData() {
@@ -281,7 +281,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
@Override @Override
protected void initData() { protected void initData() {
upData();
} }
protected void tzblChanged() { protected void tzblChanged() {

View File

@@ -112,6 +112,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
private RoomFragment parentFragment; private RoomFragment parentFragment;
List<RoomPitBean> pitList; List<RoomPitBean> pitList;
private SharedViewModel sharedViewModel; private SharedViewModel sharedViewModel;
public static SingSongFragment newInstance(RoomInfoResp roomInfoResp) { public static SingSongFragment newInstance(RoomInfoResp roomInfoResp) {
Bundle args = new Bundle(); Bundle args = new Bundle();
SingSongFragment fragment = new SingSongFragment(roomInfoResp); SingSongFragment fragment = new SingSongFragment(roomInfoResp);
@@ -126,6 +127,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
public SingSongFragment(RoomInfoResp roomInfoResp) { public SingSongFragment(RoomInfoResp roomInfoResp) {
this.roomInfoResp = roomInfoResp; this.roomInfoResp = roomInfoResp;
} }
@Override @Override
public void initArgs(Bundle arguments) { public void initArgs(Bundle arguments) {
super.initArgs(arguments); super.initArgs(arguments);
@@ -451,7 +453,10 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
@Override @Override
public void onMeilingClick(RoomSingSongWheatView view, int pitNumber) { public void onMeilingClick(RoomSingSongWheatView view, int pitNumber) {
ToastUtils.show("点击魅力值"); // ToastUtils.show("点击魅力值");
if (view.pitBean != null && !view.pitBean.getUser_id().isEmpty() && !view.pitBean.getUser_id().equals("0")) {
RoomCharmDialog.newInstance(roomId, view.pitBean.getUser_id()).show(getChildFragmentManager(), "RoomCharmDialog");
}
} }
}); });
} }
@@ -459,6 +464,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
wheatLayoutSingManager.setWheatData(roomInfoResp.getRoom_info().getPit_list(), isFirst); wheatLayoutSingManager.setWheatData(roomInfoResp.getRoom_info().getPit_list(), isFirst);
} }
} }
private void upWheter() { private void upWheter() {
if (roomInfoResp.getPk_info() == null) { if (roomInfoResp.getPk_info() == null) {
if (!ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getPit_list()) && roomInfoResp.getRoom_info().getPit_list().size() == 10) { if (!ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getPit_list()) && roomInfoResp.getRoom_info().getPit_list().size() == 10) {
@@ -1302,6 +1308,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
// wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number())); // wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
// } // }
// } else if (message.getMsgType() == 1037) { // } else if (message.getMsgType() == 1037) {
/// / 对方想结束本次pk是否同意 /// / 对方想结束本次pk是否同意
// if (message.getText().getPit_number().equals("9") && message.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) { // if (message.getText().getPit_number().equals("9") && message.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
// queren(); // queren();
@@ -1320,7 +1327,6 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
// //
// } // }
// } // }
public void event1021(RoomMessageEvent message) { public void event1021(RoomMessageEvent message) {
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) { for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
pitBean.setCharm("0"); pitBean.setCharm("0");
@@ -1507,6 +1513,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
/** /**
* 更新单个用户的魅力值 * 更新单个用户的魅力值
*
* @param userInfo 用户信息 * @param userInfo 用户信息
*/ */
private void updateCharmForUser(UserInfo userInfo) { private void updateCharmForUser(UserInfo userInfo) {