fix bugs 55

This commit is contained in:
2025-11-26 12:01:31 +08:00
parent 46b02ac407
commit 2221a11f0a
16 changed files with 285 additions and 161 deletions

View File

@@ -26,6 +26,7 @@ import androidx.databinding.ViewDataBinding;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.BarUtils; import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.LogUtils;
import com.hjq.toast.ToastUtils; import com.hjq.toast.ToastUtils;
import com.xscm.moduleutil.R; import com.xscm.moduleutil.R;
import com.xscm.moduleutil.dialog.LoadingDialog; import com.xscm.moduleutil.dialog.LoadingDialog;
@@ -257,6 +258,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
public void finish() { public void finish() {
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
super.finish(); super.finish();
LogUtils.e(this.getComponentName()+"========finish");
} }
@Override @Override
@@ -346,5 +348,22 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
} }
@Override
protected void onResume() {
super.onResume();
LogUtils.e(this.getComponentName()+"========onResume");
}
@Override
protected void onPause() {
super.onPause();
LogUtils.e(this.getComponentName()+"=========onPause");
}
@Override
protected void onStop() {
super.onStop();
LogUtils.e(this.getComponentName()+"=========onStop");
}
} }

View File

@@ -161,7 +161,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
//设置mqtt环境 false 测试环境 true 正式环境 //设置mqtt环境 false 测试环境 true 正式环境
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false); // ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
//设置http环境 false 测试环境 true 正式环境 //设置http环境 false 测试环境 true 正式环境
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(true); ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(false);
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH(); currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.AppUtils; import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xscm.modulemain.activity.login.activity.ImproveInfoActivity; import com.xscm.modulemain.activity.login.activity.ImproveInfoActivity;
@@ -111,7 +112,6 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
} }
@Override @Override
public void switchAccounts(String loginId) { public void switchAccounts(String loginId) {
api.switchAccounts(loginId, new BaseObserver<List<UserBean>>() { api.switchAccounts(loginId, new BaseObserver<List<UserBean>>() {
@@ -143,6 +143,7 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
} }
}); });
} }
//一键登陆 //一键登陆
@Override @Override
public void oauthLoginLogin(String auth_code) { public void oauthLoginLogin(String auth_code) {
@@ -202,29 +203,32 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
} }
if (userBean.get(0).getSex() == 0) { if (userBean.get(0).getSex() == 0) {
try { try {
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), ImproveInfoActivity.class); Intent intent = new Intent(ActivityUtils.getTopActivity(), ImproveInfoActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putSerializable("userBean", userBean.get(0)); bundle.putSerializable("userBean", userBean.get(0));
intent.putExtras(bundle); intent.putExtras(bundle);
com.blankj.utilcode.util.ActivityUtils.startActivity(intent); ActivityUtils.startActivity(intent);
com.blankj.utilcode.util.ActivityUtils.getTopActivity().finish(); if (ActivityUtils.getTopActivity() != null)
ActivityUtils.getTopActivity().finish();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} else { } else {
EventBus.getDefault().post(userBean.get(0)); EventBus.getDefault().post(userBean.get(0));
com.blankj.utilcode.util.ActivityUtils.startActivity(MainActivity.class); ActivityUtils.startActivity(MainActivity.class);
com.blankj.utilcode.util.ActivityUtils.getTopActivity().finish(); if (ActivityUtils.getTopActivity() != null)
ActivityUtils.getTopActivity().finish();
} }
} else { } else {
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), SwitchAccountsActivity.class); Intent intent = new Intent(ActivityUtils.getTopActivity(), SwitchAccountsActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
// bundle.putSerializable("userBean", (Serializable) userBean); // bundle.putSerializable("userBean", (Serializable) userBean);
intent.putExtra("userBean", (ArrayList<UserBean>) userBean); intent.putExtra("userBean", (ArrayList<UserBean>) userBean);
intent.putExtras(bundle); intent.putExtras(bundle);
com.blankj.utilcode.util.ActivityUtils.startActivity(intent); ActivityUtils.startActivity(intent);
com.blankj.utilcode.util.ActivityUtils.getTopActivity().finish(); if (ActivityUtils.getTopActivity() != null)
ActivityUtils.getTopActivity().finish();
} }
// EventBus.getDefault().post(new LoginFinishEvent()); // EventBus.getDefault().post(new LoginFinishEvent());
@@ -263,19 +267,19 @@ public class LoginPresenter extends BasePresenter<LoginContacter.View> implement
} }
public void ysxl() { public void ysxl() {
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), WebViewActivity.class); Intent intent = new Intent(ActivityUtils.getTopActivity(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4"); intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4");
intent.putExtra("title", "隐私协议"); intent.putExtra("title", "隐私协议");
com.blankj.utilcode.util.ActivityUtils.startActivity(intent); ActivityUtils.startActivity(intent);
// ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation(); // ARouter.getInstance().build(ARouteConstants.H5).withString("url",CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=4").withString("title", "隐私协议").navigation();
} }
public void yhxy() { public void yhxy() {
Intent intent = new Intent(com.blankj.utilcode.util.ActivityUtils.getTopActivity(), WebViewActivity.class); Intent intent = new Intent(ActivityUtils.getTopActivity(), WebViewActivity.class);
intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6"); intent.putExtra("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6");
intent.putExtra("title", "用户协议"); intent.putExtra("title", "用户协议");
com.blankj.utilcode.util.ActivityUtils.startActivity(intent); ActivityUtils.startActivity(intent);
// ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation(); // ARouter.getInstance().build(ARouteConstants.H5).withString("url", CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl() + "/api/Page/page_show?id=6").withString("title", "用户协议").navigation();
} }

View File

@@ -121,7 +121,6 @@ import com.xscm.moduleutil.bean.room.FriendInfo.HeartList
import com.xscm.moduleutil.bean.room.FriendUserBean import com.xscm.moduleutil.bean.room.FriendUserBean
import com.xscm.moduleutil.bean.room.RoomAuction import com.xscm.moduleutil.bean.room.RoomAuction
import com.xscm.moduleutil.bean.room.RoomAuction.AuctionListBean import com.xscm.moduleutil.bean.room.RoomAuction.AuctionListBean
import com.xscm.moduleutil.bean.room.RoomBean
import com.xscm.moduleutil.bean.room.RoomHourBean import com.xscm.moduleutil.bean.room.RoomHourBean
import com.xscm.moduleutil.bean.room.RoomInfoResp import com.xscm.moduleutil.bean.room.RoomInfoResp
import com.xscm.moduleutil.bean.room.RoomOnline import com.xscm.moduleutil.bean.room.RoomOnline
@@ -689,7 +688,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
LogUtils.e("RoomActivity", "onPause") LogUtils.e("RoomActivity", "onPause")
GiftDisplayManager.getInstance().clearAll() GiftDisplayManager.getInstance().clearAll()
if (mRoomInfoResp != null) { if (mRoomInfoResp != null) {
if (mRoomInfoResp!!.room_info.type_id != "6") { if (mRoomInfoResp?.room_info?.type_id != "6") {
// 只有在用户主动离开应用时才执行最小化操作 // 只有在用户主动离开应用时才执行最小化操作
if (!userLeaving) { if (!userLeaving) {
// 保持Activity alive不调用finish() // 保持Activity alive不调用finish()
@@ -922,7 +921,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val userIds = StringBuilder() val userIds = StringBuilder()
if (mRoomInfoResp?.room_info?.pit_list != null) { if (mRoomInfoResp?.room_info?.pit_list != null) {
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
if (userId != null && userId != "0" && !userId.isEmpty()) { if (userId != null && userId != "0" && !userId.isEmpty()) {
if (userIds.length > 0) { if (userIds.length > 0) {
userIds.append(",") userIds.append(",")
@@ -958,7 +957,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
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()) {
ivSoundEffects(true) ivSoundEffects(true)
} else { } else {
ivSoundEffects(false) ivSoundEffects(false)
@@ -973,13 +972,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (mRoomInfoResp?.gift_cycle?.xlh_info?.xlh_status == "1") { if (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()
} }
if (mRoomInfoResp!!.hour_ranking_open == 1) { if (mRoomInfoResp?.hour_ranking_open == 1) {
mBinding!!.clXsb.visibility = View.VISIBLE mBinding!!.clXsb.visibility = View.VISIBLE
} else { } else {
mBinding!!.clXsb.visibility = View.GONE mBinding!!.clXsb.visibility = View.GONE
@@ -1393,25 +1392,25 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val userId = messageEvent.text?.user_id val userId = messageEvent.text?.user_id
LogUtils.e("messageEvent!!.text.type" + messageEvent.text.type) LogUtils.e("messageEvent!!.text.type" + messageEvent.text.type)
CommonAppContext.getInstance().onlineMap[userId ?: ""] = messageEvent.text.type CommonAppContext.getInstance().onlineMap[userId ?: ""] = messageEvent.text.type
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.room_info != null) {
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" || if (mRoomInfoResp?.room_info?.type_id == "1" || mRoomInfoResp?.room_info?.type_id == "3" ||
mRoomInfoResp!!.room_info.type_id == "4" || mRoomInfoResp!!.room_info.type_id == "8" mRoomInfoResp?.room_info?.type_id == "4" || mRoomInfoResp?.room_info?.type_id == "8"
) { ) {
if (mRoomInfoResp!!.room_info.label_id == "1") { if (mRoomInfoResp?.room_info?.label_id == "1") {
// roomFragment!!.SingSongEvent(messageEvent) // roomFragment!!.SingSongEvent(messageEvent)
} else { } else {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
} else if (mRoomInfoResp!!.room_info.type_id == "2") { } else if (mRoomInfoResp?.room_info?.type_id == "2") {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else if (mRoomInfoResp!!.room_info.type_id == "7") { } else if (mRoomInfoResp?.room_info?.type_id == "7") {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
} }
CommonAppContext.getInstance().getOnlineMap() CommonAppContext.getInstance().getOnlineMap()
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQingGRMl) { // 1059清除个人魅力 1058在离线 } else if (msgType == EMMessageInfo.QXRoomMessageTypeQingGRMl) { // 1059清除个人魅力 1058在离线
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.room_info != null) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
} else if (msgType == EMMessageInfo.QXRoomMessageTypeMangH) { // 1056 抽奖结果 } else if (msgType == EMMessageInfo.QXRoomMessageTypeMangH) { // 1056 抽奖结果
@@ -1533,11 +1532,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1039(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1039(messageEvent: RoomMessageEvent, text: T?) {
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) { if (mRoomInfoResp == null || mRoomInfoResp?.room_info == null) {
return return
} }
val pitList = mRoomInfoResp!!.room_info.pit_list val pitList = mRoomInfoResp?.room_info?.pit_list
if (pitList != null && !pitList.isEmpty()) { if (pitList != null && !pitList.isEmpty()) {
if (text == null) { if (text == null) {
@@ -1560,13 +1559,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
toPitNumber: String, toPitNumber: String,
messageEvent: RoomMessageEvent messageEvent: RoomMessageEvent
) { ) {
mRoomInfoResp!!.room_info.pit_list[toPitNumber.toInt() - 1] = getPitBean(messageEvent, 2) mRoomInfoResp?.room_info?.pit_list!![toPitNumber.toInt() - 1] = getPitBean(messageEvent, 2)
mRoomInfoResp?.room_info?.pit_list!![fromPitNumber.toInt() - 1] = RoomPitBean(fromPitNumber) mRoomInfoResp?.room_info?.pit_list!![fromPitNumber.toInt() - 1] = RoomPitBean(fromPitNumber)
if ("9" == toPitNumber && messageEvent.text.fromUserInfo.user_id == SpUtil.getUserId()) { if ("9" == toPitNumber && messageEvent.text.fromUserInfo.user_id == SpUtil.getUserId()) {
mRoomInfoResp!!.user_info.pit_number = Integer.parseInt(toPitNumber) mRoomInfoResp?.user_info?.pit_number = Integer.parseInt(toPitNumber)
ivSoundEffects(true) ivSoundEffects(true)
setRoleType(3, mRoomInfoResp!!.user_info.pit_number) setRoleType(3, mRoomInfoResp?.user_info?.pit_number!!)
} else { } else {
if (customMusicFloatingView != null) { if (customMusicFloatingView != null) {
customMusicFloatingView!!.destroy() customMusicFloatingView!!.destroy()
@@ -1583,14 +1582,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
userPermissionChange() userPermissionChange()
if (mRoomInfoResp!!.user_info.pit_number == 9) { if (mRoomInfoResp?.user_info?.pit_number == 9) {
ivSoundEffects(true) ivSoundEffects(true)
} }
} }
private fun hand1005(messageEvent: RoomMessageEvent, text: T?) { private fun hand1005(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
@@ -1628,17 +1627,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
AgoraManager.getInstance().desMusic() AgoraManager.getInstance().desMusic()
if ((mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "4" || if ((mRoomInfoResp?.room_info?.type_id == "1" || mRoomInfoResp?.room_info?.type_id == "4" ||
mRoomInfoResp!!.room_info.type_id == "3" || mRoomInfoResp!!.room_info.type_id == "8") && mRoomInfoResp?.room_info?.type_id == "3" || mRoomInfoResp?.room_info?.type_id == "8") &&
mRoomInfoResp!!.room_info.label_id == "2" mRoomInfoResp?.room_info?.label_id == "2"
) { ) {
for (roomPitBean in mRoomInfoResp!!.song_pit_list) { for (roomPitBean in mRoomInfoResp?.song_pit_list!!) {
AgoraManager.getInstance().ClientRole(false) AgoraManager.getInstance().ClientRole(false)
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding) ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding)
mBinding?.rlMic?.visibility = View.GONE mBinding?.rlMic?.visibility = View.GONE
} }
if (mRoomInfoResp!!.song_user_info != null && mRoomInfoResp!!.song_user_info.user_id != null) { if (mRoomInfoResp?.song_user_info != null && mRoomInfoResp?.song_user_info?.user_id != null) {
if (mRoomInfoResp!!.song_user_info.user_id == SpUtil.getUserId().toString() + "") { if (mRoomInfoResp?.song_user_info?.user_id == SpUtil.getUserId().toString() + "") {
AgoraManager.getInstance().ClientRole(false) AgoraManager.getInstance().ClientRole(false)
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding) ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding)
mBinding?.rlMic?.visibility = View.GONE mBinding?.rlMic?.visibility = View.GONE
@@ -1666,7 +1665,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1003(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1003(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val fromUserInfo = text.fromUserInfo ?: return val fromUserInfo = text.fromUserInfo ?: return
@@ -1684,8 +1683,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
aBoolean = false aBoolean = false
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up) ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up)
setBoolean(aBoolean) setBoolean(aBoolean)
if (mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.pit_number = mRoomInfoResp?.user_info?.pit_number =
pitNumber?.toInt() ?: -1 pitNumber?.toInt() ?: -1
} }
setRoleType(3, pitNumber!!.toInt()) setRoleType(3, pitNumber!!.toInt())
@@ -1697,9 +1696,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
when (typeId) { when (typeId) {
RoomType.AUCTION -> { RoomType.AUCTION -> {
if ("9" == pitNumber) { if ("9" == pitNumber) {
mRoomInfoResp!!.room_info.pit_list[0] = getPitBean(messageEvent, 1) mRoomInfoResp?.room_info?.pit_list!![0] = getPitBean(messageEvent, 1)
if (mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.pit_number = pitNumber.toInt() mRoomInfoResp?.user_info?.pit_number = pitNumber.toInt()
} }
} }
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
@@ -1707,11 +1706,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
RoomType.DATING -> { RoomType.DATING -> {
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
if ("2" == labelId) { if ("2" == labelId) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else if ("1" == labelId) { } else if ("1" == labelId) {
mRoomInfoResp!!.room_info.pit_list[pitNumber.toInt() - 1] = mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
getPitBean(messageEvent, 1) getPitBean(messageEvent, 1)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
@@ -1736,7 +1735,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1004(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1004(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val fromUserInfo = text.fromUserInfo ?: return val fromUserInfo = text.fromUserInfo ?: return
@@ -1766,7 +1765,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
switchMic(2) switchMic(2)
} }
val typeId = mRoomInfoResp!!.room_info.type_id val typeId = mRoomInfoResp?.room_info?.type_id
val roomType = RoomType.fromTypeId(typeId) val roomType = RoomType.fromTypeId(typeId)
@@ -1774,14 +1773,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
when (roomType) { when (roomType) {
RoomType.AUCTION -> { RoomType.AUCTION -> {
if ("9" == pitNumber) { if ("9" == pitNumber) {
mRoomInfoResp!!.room_info.pit_list[0] = RoomPitBean(pitNumber) mRoomInfoResp?.room_info?.pit_list!![0] = RoomPitBean(pitNumber)
if (userId == currentUserId) { if (userId == currentUserId) {
if (mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.pit_number = 0 mRoomInfoResp?.user_info?.pit_number = 0
} }
} }
} else if ("888" == pitNumber) {//被拍者 } else if ("888" == pitNumber) {//被拍者
mRoomInfoResp!!.room_auction = null mRoomInfoResp?.room_auction = null
if (userId == currentUserId) { if (userId == currentUserId) {
setRoleType(0, 0) setRoleType(0, 0)
switchMic(2) switchMic(2)
@@ -1792,12 +1791,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
RoomType.DATING -> { RoomType.DATING -> {
//TODO 下麦更换数据 //TODO 下麦更换数据
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
if ("1" == labelId) { if ("1" == labelId) {
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber) mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
if (mRoomInfoResp!!.user_info.user_id == SpUtil.getUserId()) { if (mRoomInfoResp?.user_info?.user_id == SpUtil.getUserId()) {
ivSoundEffects(false) ivSoundEffects(false)
} }
} }
@@ -1816,7 +1815,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1022(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1022(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val pitNumber = text.pit_number val pitNumber = text.pit_number
val userId = text.fromUserInfo.user_id val userId = text.fromUserInfo.user_id
@@ -1834,7 +1833,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setRoleType(0, 0) setRoleType(0, 0)
switchMic(2) switchMic(2)
} else if ("888" == pitNumber) { } else if ("888" == pitNumber) {
mRoomInfoResp!!.room_auction = RoomAuction() mRoomInfoResp?.room_auction = RoomAuction()
if (userId == currentUserId) { if (userId == currentUserId) {
setRoleType(0, 0) setRoleType(0, 0)
switchMic(2) switchMic(2)
@@ -1847,23 +1846,23 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1023(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1023(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_auction == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_auction == null) return
mRoomInfoResp!!.room_auction.auction_user = text.auction_user mRoomInfoResp?.room_auction?.auction_user = text.auction_user
SpUtil.setAuctionId(text.auction_user.auction_id) SpUtil.setAuctionId(text.auction_user.auction_id)
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} }
private fun handleMsgType1024(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1024(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_auction == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_auction == null) return
if (mRoomInfoResp!!.room_auction.auction_list != null) { if (mRoomInfoResp?.room_auction?.auction_list != null) {
mRoomInfoResp!!.room_auction.auction_list.clear() mRoomInfoResp?.room_auction?.auction_list!!.clear()
} }
if (mRoomInfoResp!!.room_auction.auction_list != null && text.auction_list != null) { if (mRoomInfoResp?.room_auction?.auction_list != null && text.auction_list != null) {
mRoomInfoResp!!.room_auction.auction_list.addAll(text.auction_list) mRoomInfoResp?.room_auction?.auction_list!!.addAll(text.auction_list)
} else { } else {
mRoomInfoResp!!.room_auction.auction_list = ArrayList() mRoomInfoResp?.room_auction?.auction_list = ArrayList()
} }
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
@@ -1905,6 +1904,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (roomMessageEvent.text.fromUserInfo.enter_image?.isNotEmpty() == true) { if (roomMessageEvent.text.fromUserInfo.enter_image?.isNotEmpty() == true) {
showFloatingMessage(roomMessageEvent.text.fromUserInfo) showFloatingMessage(roomMessageEvent.text.fromUserInfo)
} }
MvpPre?.getRoomOnline(roomId, "1", "10") MvpPre?.getRoomOnline(roomId, "1", "10")
// number++ // number++
@@ -2045,21 +2045,21 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1029(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1029(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.user_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.user_info == null) return
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()) {
querenPk(text.text, text.pkId) querenPk(text.text, text.pkId)
} }
} }
private fun handleMsgType1021(messageEvent: RoomMessageEvent, text: T) { private fun handleMsgType1021(messageEvent: RoomMessageEvent, text: T) {
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val typeId = mRoomInfoResp!!.room_info.type_id val typeId = mRoomInfoResp?.room_info?.type_id
if ("2" == typeId) { if ("2" == typeId) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else if ("1" == typeId || "4" == typeId || "3" == typeId || "8" == typeId) { } else if ("1" == typeId || "4" == typeId || "3" == typeId || "8" == typeId) {
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
if ("2" == labelId) { if ("2" == labelId) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else { } else {
@@ -2069,14 +2069,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
} else { } else {
updateCharmForAllPitBeans("") updateCharmForAllPitBeans("")
roomFragment!!.upFriendList(mRoomInfoResp!!.room_info.pit_list) roomFragment!!.upFriendList(mRoomInfoResp?.room_info?.pit_list)
} }
} }
private fun updateCharmForAllPitBeans(charm: String) { private fun updateCharmForAllPitBeans(charm: String) {
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val pitList = mRoomInfoResp!!.room_info.pit_list ?: return val pitList = mRoomInfoResp?.room_info?.pit_list ?: return
pitList.forEach { roomPitBean -> pitList.forEach { roomPitBean ->
roomPitBean.charm = charm roomPitBean.charm = charm
} }
@@ -2191,15 +2191,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1035(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1035(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return
val fromUserInfo = text.fromUserInfo ?: return val fromUserInfo = text.fromUserInfo ?: return
val typeId = mRoomInfoResp!!.room_info.type_id val typeId = mRoomInfoResp?.room_info?.type_id
if ("2" == typeId) { if ("2" == typeId) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else if ("1" == typeId || "3" == typeId || "4" == typeId || "8" == typeId) { } else if ("1" == typeId || "3" == typeId || "4" == typeId || "8" == typeId) {
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
if ("2" == labelId) { if ("2" == labelId) {
roomFragment!!.handleRoomMessage(messageEvent) roomFragment!!.handleRoomMessage(messageEvent)
} else { } else {
@@ -2213,9 +2213,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun updatePitBeanForUser(fromUserInfo: UserInfo): RoomInfoResp? { private fun updatePitBeanForUser(fromUserInfo: UserInfo): RoomInfoResp? {
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) return mRoomInfoResp if (mRoomInfoResp == null || mRoomInfoResp?.room_info == null) return mRoomInfoResp
val pitList = mRoomInfoResp!!.room_info.pit_list ?: return mRoomInfoResp val pitList = mRoomInfoResp?.room_info?.pit_list ?: return mRoomInfoResp
for (pitBean in pitList) { for (pitBean in pitList) {
if (pitBean.user_id == fromUserInfo.user_id.toString() + "") { if (pitBean.user_id == fromUserInfo.user_id.toString() + "") {
@@ -2248,32 +2248,32 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1007() { private fun handleMsgType1007() {
if (mRoomInfoResp != null && mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.is_host = 1 mRoomInfoResp?.user_info?.is_host = 1
userPermissionChange() userPermissionChange()
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
} }
} }
private fun handleMsgType1006() { private fun handleMsgType1006() {
if (mRoomInfoResp != null && mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.is_management = 1 mRoomInfoResp?.user_info?.is_management = 1
userPermissionChange() userPermissionChange()
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
} }
} }
private fun handleMsgType1018() { private fun handleMsgType1018() {
if (mRoomInfoResp != null && mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.is_host = 0 mRoomInfoResp?.user_info?.is_host = 0
userPermissionChange() userPermissionChange()
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
} }
} }
private fun handleMsgType1017() { private fun handleMsgType1017() {
if (mRoomInfoResp != null && mRoomInfoResp!!.user_info != null) { if (mRoomInfoResp != null && mRoomInfoResp?.user_info != null) {
mRoomInfoResp!!.user_info.is_management = 0 mRoomInfoResp?.user_info?.is_management = 0
userPermissionChange() userPermissionChange()
roomFragment!!.upRoomInfoData(mRoomInfoResp) roomFragment!!.upRoomInfoData(mRoomInfoResp)
} }
@@ -2314,14 +2314,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun handleMsgType1016(messageEvent: RoomMessageEvent, text: T?) { private fun handleMsgType1016(messageEvent: RoomMessageEvent, text: T?) {
if (text == null || mRoomInfoResp == null || mRoomInfoResp!!.user_info == null) return if (text == null || mRoomInfoResp == null || mRoomInfoResp?.user_info == null) return
if (text.fromUserInfo.user_id == SpUtil.getUserId()) { if (text.fromUserInfo.user_id == SpUtil.getUserId()) {
if (text.is_mute_pit == 1) { if (text.is_mute_pit == 1) {
switchMic(2) switchMic(2)
} }
mRoomInfoResp!!.user_info.is_mute_pit = text.is_mute_pit.toString() mRoomInfoResp?.user_info?.is_mute_pit = text.is_mute_pit.toString()
mRoomInfoResp!!.user_info.is_mute = text.is_mute.toString() mRoomInfoResp?.user_info?.is_mute = text.is_mute.toString()
} }
} }
@@ -2387,7 +2387,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
fun setUserInfo() { fun setUserInfo() {
mRoomInfoResp!!.user_info.is_collect = 1 mRoomInfoResp?.user_info?.is_collect = 1
mBinding!!.roomTop.btnFollow.background = mBinding!!.roomTop.btnFollow.background =
resources.getDrawable(com.xscm.moduleutil.R.mipmap.yishouc) resources.getDrawable(com.xscm.moduleutil.R.mipmap.yishouc)
mBinding!!.roomTop.btnFollow.text = "" mBinding!!.roomTop.btnFollow.text = ""
@@ -2406,8 +2406,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
return return
} }
val id = view.id val id = view.id
// 通过 ID 获取资源名称
var viewName = try {
view.context.resources.getResourceEntryName(id)
} catch (e: java.lang.Exception) {
"未知View ID: $id"
}
LogUtils.e("RoomActivity", "点击了$viewName")
if (id == R.id.btn_follow) { if (id == R.id.btn_follow) {
MvpPre!!.userGuanz(mRoomInfoResp!!.room_info.room_id, "2") MvpPre!!.userGuanz(mRoomInfoResp?.room_info?.room_id, "2")
} else if (id == R.id.btn_notice) { } else if (id == R.id.btn_notice) {
val roomNoticeDialogFragment = RoomNoticeDialogFragment(this) val roomNoticeDialogFragment = RoomNoticeDialogFragment(this)
roomNoticeDialogFragment.setTitle("公告") roomNoticeDialogFragment.setTitle("公告")
@@ -2431,8 +2440,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else if (id == R.id.rl) { } else if (id == R.id.rl) {
MvpPre!!.clearUserCharm(roomId, "") MvpPre!!.clearUserCharm(roomId, "")
} else if (id == R.id.ll_input) { } else if (id == R.id.ll_input) {
mBinding!!.llInput.visibility = View.GONE mBinding?.llInput?.visibility = View.GONE
mBinding!!.inputMenu1.dismiss() mBinding?.inputMenu1?.dismiss()
} else if (id == R.id.iv_emoji) { } else if (id == R.id.iv_emoji) {
val emotionPickerDialog = EmotionPickerDialog(this) val emotionPickerDialog = EmotionPickerDialog(this)
emotionPickerDialog.setOnEmotionSelectedListener { emotion -> emotionPickerDialog.setOnEmotionSelectedListener { emotion ->
@@ -2443,13 +2452,13 @@ 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 {
dialogDismiss(1) dialogDismiss(1)
} }
} else if (id == R.id.rl_mic) { } else if (id == R.id.rl_mic) {
if (mRoomInfoResp!!.user_info.is_mute_pit != null && mRoomInfoResp!!.user_info.is_mute_pit == "1") { if (mRoomInfoResp?.user_info?.is_mute_pit != null && mRoomInfoResp?.user_info?.is_mute_pit == "1") {
ToastUtils.show("您被禁麦了") ToastUtils.show("您被禁麦了")
} else { } else {
if (isSwith) { if (isSwith) {
@@ -2527,10 +2536,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else if (id == R.id.cl_first_charge) { } else if (id == R.id.cl_first_charge) {
roomFragment!!.showWheatFeedingDialog( roomFragment!!.showWheatFeedingDialog(
roomId, roomId,
if ((mRoomInfoResp!!.user_info.is_room_owner == 1 || mRoomInfoResp!!.user_info.is_host == 1 || mRoomInfoResp!!.user_info.is_management == 1)) 1 else 2 if ((mRoomInfoResp?.user_info?.is_room_owner == 1 || mRoomInfoResp?.user_info?.is_host == 1 || mRoomInfoResp?.user_info?.is_management == 1)) 1 else 2
) )
} else if (id == R.id.iv_wheat_feeding) { //点击上麦操作 } else if (id == R.id.iv_wheat_feeding) { //点击上麦操作
if (mRoomInfoResp!!.room_info.room_up_pit_type == "1") { if (mRoomInfoResp?.room_info?.room_up_pit_type == "1") {
if (aBoolean) { if (aBoolean) {
MvpPre!!.applyPit(roomId, "") MvpPre!!.applyPit(roomId, "")
} else { } else {
@@ -2565,7 +2574,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
private fun isNumberWhether(): Int { private fun isNumberWhether(): Int {
if (mRoomInfoResp!!.getUser_info().getPit_number() == 9) { if (mRoomInfoResp?.user_info?.pit_number == 9) {
return 1 return 1
} }
return 0 return 0
@@ -2632,7 +2641,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (mRoomInfoResp == null) { if (mRoomInfoResp == null) {
return true return true
} }
if (mRoomInfoResp!!.room_info.label_id != "6") { if (mRoomInfoResp?.room_info?.label_id != "6") {
val activityManager = val activityManager =
getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val appProcesses = val appProcesses =
@@ -2806,12 +2815,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
rl_misc?.visibility = View.GONE rl_misc?.visibility = View.GONE
// 空指针保护 // 空指针保护
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null || mRoomInfoResp!!.user_info == null) { if (mRoomInfoResp == null || mRoomInfoResp?.room_info == null || mRoomInfoResp?.user_info == null) {
return return
} }
val typeId = mRoomInfoResp!!.room_info.type_id val typeId = mRoomInfoResp?.room_info?.type_id
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
val userPitNumber = mRoomInfoResp?.user_info?.pit_number!! val userPitNumber = mRoomInfoResp?.user_info?.pit_number!!
// 情况1: typeId = 6 时,只显示消息按钮 // 情况1: typeId = 6 时,只显示消息按钮
@@ -2916,7 +2925,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val t = T() val t = T()
t.fromUserInfo = SpUtil.getUserInfo() t.fromUserInfo = SpUtil.getUserInfo()
t.text = s t.text = s
val roomMessageEvent = RoomMessageEvent(126, mRoomInfoResp!!.room_info.room_id, t) val roomMessageEvent = RoomMessageEvent(126, mRoomInfoResp?.room_info?.room_id, t)
val json = GsonUtils.toJson(roomMessageEvent) val json = GsonUtils.toJson(roomMessageEvent)
// 转换为 byte[] // 转换为 byte[]
val binaryData = json.toByteArray(StandardCharsets.UTF_8) val binaryData = json.toByteArray(StandardCharsets.UTF_8)
@@ -2931,7 +2940,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
@SuppressLint("MissingInflatedId") @SuppressLint("MissingInflatedId")
fun dialogDismiss(type: Int) { fun dialogDismiss(type: Int) {
// // 使用 AlertDialog.Builder // // 使用 AlertDialog.Builder
val builder = AlertDialog.Builder(this) val builder = AlertDialog.Builder(this)
val inflater = layoutInflater val inflater = layoutInflater
val dialogView = val dialogView =
@@ -3067,7 +3075,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
userPermissionChange() userPermissionChange()
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()) {
ivSoundEffects(true) ivSoundEffects(true)
} else { } else {
ivSoundEffects(false) ivSoundEffects(false)
@@ -3091,7 +3099,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
//隐藏视图 //隐藏视图
private fun instView() { private fun instView() {
if (mRoomInfoResp!!.user_info.pit_number != 0) { if (mRoomInfoResp?.user_info?.pit_number != 0) {
aBoolean = false aBoolean = false
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up) ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up)
setrlMic(true) setrlMic(true)
@@ -3102,31 +3110,31 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setrlMic(false) setrlMic(false)
setBoolean(aBoolean) setBoolean(aBoolean)
} }
val pitNumber = mRoomInfoResp!!.user_info.pit_number val pitNumber = mRoomInfoResp?.user_info?.pit_number
val roleType = if (pitNumber == 9) { val roleType = if (pitNumber == 9) {
if (mRoomInfoResp!!.user_info.is_room_owner != 0) 1 else if (mRoomInfoResp!!.user_info.is_host != 0) 2 else 0 if (mRoomInfoResp?.user_info?.is_room_owner != 0) 1 else if (mRoomInfoResp?.user_info?.is_host != 0) 2 else 0
} else if (pitNumber != 0 && pitNumber != 9) { } else if (pitNumber != 0 && pitNumber != 9) {
3 3
} else { } else {
0 0
} }
if (mRoomInfoResp!!.user_info.pit_number == 9) { if (mRoomInfoResp?.user_info?.pit_number == 9) {
ivSoundEffects(true) ivSoundEffects(true)
} else { } else {
ivSoundEffects(false) ivSoundEffects(false)
} }
// } // }
if (mRoomInfoResp?.user_info?.user_id == SpUtil.getUserId() if (mRoomInfoResp?.user_info?.user_id == SpUtil.getUserId()
&& mRoomInfoResp!!.user_info.pit_number == 9 && mRoomInfoResp?.user_info?.pit_number == 9
&& mRoomInfoResp!!.room_info.type_id != "2" && mRoomInfoResp?.room_info?.type_id != "2"
&& mRoomInfoResp!!.room_info.type_id != "6" && mRoomInfoResp?.room_info?.type_id != "6"
) { ) {
rlMore(true) rlMore(true)
} else { } else {
rlMore(false) rlMore(false)
} }
val countText = mRoomInfoResp!!.room_info.queue_number.toString() val countText = mRoomInfoResp?.room_info?.queue_number.toString()
val fullText = countText + "人排队" val fullText = countText + "人排队"
val spannableStringBuilder = SpannableStringBuilder(fullText) val spannableStringBuilder = SpannableStringBuilder(fullText)
@@ -3143,18 +3151,18 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
) )
tvFirst(spannableStringBuilder) tvFirst(spannableStringBuilder)
setRoleType(roleType, pitNumber) setRoleType(roleType, pitNumber!!)
} }
/** 头条 */ /** 头条 */
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
fun toutiao() { fun toutiao() {
if (mRoomInfoResp!!.room_info.head_line != null) { if (mRoomInfoResp?.room_info?.head_line != null) {
mBinding!!.flaoatZuoji.visibility = View.VISIBLE mBinding!!.flaoatZuoji.visibility = View.VISIBLE
ImageUtils.loadHeadCC(mRoomInfoResp!!.room_info.head_line.avatar, mBinding!!.headAvate) ImageUtils.loadHeadCC(mRoomInfoResp?.room_info?.head_line?.avatar, mBinding!!.headAvate)
mBinding!!.headName.text = mRoomInfoResp!!.room_info.head_line.nickname mBinding!!.headName.text = mRoomInfoResp?.room_info?.head_line?.nickname
mBinding!!.headCone.text = mRoomInfoResp!!.room_info.head_line.content mBinding!!.headCone.text = mRoomInfoResp?.room_info?.head_line?.content
mBinding!!.ivQuanQiang.setOnClickListener { v: View? -> mBinding!!.ivQuanQiang.setOnClickListener { v: View? ->
val fragment = PublishCommentDialogFragment.show( val fragment = PublishCommentDialogFragment.show(
@@ -3166,11 +3174,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
} }
mBinding!!.ivQuanC.setOnClickListener { v: View? -> mBinding!!.ivQuanC.setOnClickListener { v: View? ->
if (mRoomInfoResp!!.room_info.head_line.room_id != null && mRoomInfoResp!!.room_info.head_line.room_id.isNotEmpty()) { if (mRoomInfoResp?.room_info?.head_line?.room_id != null && mRoomInfoResp?.room_info?.head_line?.room_id!!.isNotEmpty()) {
if (mRoomInfoResp!!.room_info.head_line.room_id != roomId) { if (mRoomInfoResp?.room_info?.head_line?.room_id != roomId) {
RoomManager.getInstance().fetchRoomDataAndEnter( RoomManager.getInstance().fetchRoomDataAndEnter(
applicationContext, applicationContext,
mRoomInfoResp!!.room_info.head_line.room_id, mRoomInfoResp?.room_info?.head_line?.room_id,
"", "",
null null
) )
@@ -3241,7 +3249,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
hideSomeViewOrDoSomething() hideSomeViewOrDoSomething()
} }
silentCountDownTimer!!.start(mRoomInfoResp!!.room_info.head_line.end_time.toLong()) silentCountDownTimer!!.start(mRoomInfoResp?.room_info?.head_line?.end_time!!.toLong())
} else { } else {
mBinding!!.flaoatZuoji.visibility = View.GONE mBinding!!.flaoatZuoji.visibility = View.GONE
} }
@@ -3328,9 +3336,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
is SurfaceEvent -> { is SurfaceEvent -> {
if (mRoomInfoResp!!.room_info.type_id == "6") { //判断是否是电影房 if (mRoomInfoResp?.room_info?.type_id == "6") { //判断是否是电影房
floatingMagnetView = findViewById(R.id.flaoat) //电影房 floatingMagnetView = findViewById(R.id.flaoat) //电影房
if (mRoomInfoResp!!.user_info.is_room_owner != 1) { //判断是不是房主1是 如何是,不展示 0不是展示布局 if (mRoomInfoResp?.user_info?.is_room_owner != 1) { //判断是不是房主1是 如何是,不展示 0不是展示布局
if (event.type != 1) { if (event.type != 1) {
val container = val container =
floatingMagnetView?.findViewById<FrameLayout>(R.id.fl_screenshare) floatingMagnetView?.findViewById<FrameLayout>(R.id.fl_screenshare)
@@ -3450,7 +3458,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
is HeadlineBean -> { is HeadlineBean -> {
mRoomInfoResp!!.room_info.head_line = event mRoomInfoResp?.room_info?.head_line = event
toutiao() toutiao()
} }
@@ -3552,6 +3560,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
GiftDisplayManager.getInstance().setupDisplayView(mBinding?.giftContainer) GiftDisplayManager.getInstance().setupDisplayView(mBinding?.giftContainer)
} }
// 添加检查房间连接状态的方法 // 添加检查房间连接状态的方法
private fun resumeRoomState() { private fun resumeRoomState() {
// 恢复房间相关状态 // 恢复房间相关状态
@@ -3717,20 +3727,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} }
fun upHeight() { fun upHeight() {
if (mRoomInfoResp!!.room_info.type_id == "1" || mRoomInfoResp!!.room_info.type_id == "3" || mRoomInfoResp!!.room_info.type_id == "4" if (mRoomInfoResp?.room_info?.type_id == "1" || mRoomInfoResp?.room_info?.type_id == "3" || mRoomInfoResp?.room_info?.type_id == "4"
|| mRoomInfoResp!!.room_info.type_id == "8" || mRoomInfoResp?.room_info?.type_id == "8"
) { ) {
maxHeightDp = if (mRoomInfoResp!!.room_info.label_id == "1") { maxHeightDp = if (mRoomInfoResp?.room_info?.label_id == "1") {
333 333
} else { } else {
287 287
} }
} else if (mRoomInfoResp!!.room_info.type_id == "2") { } else if (mRoomInfoResp?.room_info?.type_id == "2") {
maxHeightDp = 297 maxHeightDp = 297
} }
if (mRoomInfoResp!!.room_info.type_id == "6") { if (mRoomInfoResp?.room_info?.type_id == "6") {
maxHeightDp = 453 maxHeightDp = 453
} else if (mRoomInfoResp!!.room_info.type_id == "7") { } else if (mRoomInfoResp?.room_info?.type_id == "7") {
maxHeightDp = 373 maxHeightDp = 373
} }
adjustLayoutHeights() adjustLayoutHeights()
@@ -3738,35 +3748,35 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
@SuppressLint("CommitTransaction") @SuppressLint("CommitTransaction")
private fun resetFragment() { private fun resetFragment() {
val typeId = mRoomInfoResp!!.room_info.type_id val typeId = mRoomInfoResp?.room_info?.type_id
val labelId = mRoomInfoResp!!.room_info.label_id val labelId = mRoomInfoResp?.room_info?.label_id
CommonAppContext.getInstance().lable_id = typeId CommonAppContext.getInstance().lable_id = typeId
val roomType = RoomType.fromTypeId(typeId) val roomType = RoomType.fromTypeId(typeId)
val qxType: QXRoomSeatViewType = when (roomType) { val qxType: QXRoomSeatViewType = when (roomType) {
RoomType.MUTUAL_ENTERTAINMENT -> { RoomType.MUTUAL_ENTERTAINMENT -> {
if (mRoomInfoResp!!.room_info.room_background == null || mRoomInfoResp!!.room_info.room_background == "") { if (mRoomInfoResp?.room_info?.room_background == null || mRoomInfoResp?.room_info?.room_background == "") {
changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj) changeBackground(com.xscm.moduleutil.R.mipmap.jiaoy_bj)
} else { } else {
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background) changeBackgroundColor(mRoomInfoResp?.room_info?.room_background)
} }
setvisibTop(true) setvisibTop(true)
QXRoomSeatViewType.FRIEND QXRoomSeatViewType.FRIEND
} }
RoomType.AUCTION -> { RoomType.AUCTION -> {
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background) changeBackgroundColor(mRoomInfoResp?.room_info?.room_background)
setvisibTop(true) setvisibTop(true)
QXRoomSeatViewType.AUCTION QXRoomSeatViewType.AUCTION
} }
RoomType.DATING -> { RoomType.DATING -> {
if ("2" == labelId) { if ("2" == labelId) {
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background) changeBackgroundColor(mRoomInfoResp?.room_info?.room_background)
setvisibTop(true) setvisibTop(true)
QXRoomSeatViewType.KTV QXRoomSeatViewType.KTV
} else if ("1" == labelId) { } else if ("1" == labelId) {
changeBackgroundColor(mRoomInfoResp!!.room_info.room_background) changeBackgroundColor(mRoomInfoResp?.room_info?.room_background)
setvisibTop(true) setvisibTop(true)
QXRoomSeatViewType.NORMAL QXRoomSeatViewType.NORMAL
} else { } else {
@@ -4289,7 +4299,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (redEnvelopesFragment!!.mRedPacketInfo.type == 1) { if (redEnvelopesFragment!!.mRedPacketInfo.type == 1) {
if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) { if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) {
//有收藏房间条件 //有收藏房间条件
if (mRoomInfoResp!!.user_info.is_collect == 1) { if (mRoomInfoResp?.user_info?.is_collect == 1) {
if (packet!!.redpacket_id == redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) { if (packet!!.redpacket_id == redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
//需要满足收藏在倒计时 //需要满足收藏在倒计时
redEnvelopesFragment!!.setNeedTime(packetTime) redEnvelopesFragment!!.setNeedTime(packetTime)
@@ -4304,7 +4314,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if (redEnvelopesFragment!!.isFromToComment) { if (redEnvelopesFragment!!.isFromToComment) {
if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) { if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) {
//有收藏房间条件 //有收藏房间条件
if (mRoomInfoResp!!.user_info.is_collect == 1) { if (mRoomInfoResp?.user_info?.is_collect == 1) {
if (packet!!.redpacket_id == redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) { if (packet!!.redpacket_id == redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
redEnvelopesFragment!!.setNeedTime(packetTime) redEnvelopesFragment!!.setNeedTime(packetTime)
} }
@@ -4363,4 +4373,5 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
return false // 不是快速重复点击 return false // 不是快速重复点击
} }
} }

View File

@@ -17,6 +17,7 @@ import android.widget.Switch;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.ActivityUtils; import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.LogUtils;
import com.orhanobut.logger.Logger; import com.orhanobut.logger.Logger;
import com.xscm.modulemain.R; import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.activity.RoomActivity; import com.xscm.modulemain.activity.room.activity.RoomActivity;
@@ -212,6 +213,7 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
userInfo.setNickname(pitBean.getNickname()); userInfo.setNickname(pitBean.getNickname());
userInfo.setUser_id(Integer.parseInt(pitBean.getUser_id())); userInfo.setUser_id(Integer.parseInt(pitBean.getUser_id()));
userInfo.setPit_number("0"); userInfo.setPit_number("0");
LogUtils.e("RoomGiftDialogFragment_friend");
RoomGiftDialogFragment.show(null, userInfo, roomId, 0, pitBean.getHeartId() + "", getParentFragmentManager()); RoomGiftDialogFragment.show(null, userInfo, roomId, 0, pitBean.getHeartId() + "", getParentFragmentManager());
} }

View File

@@ -349,10 +349,22 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
} }
private void onChock(View view) { private void onChock(View view) {
int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("wheatFeedingDF","点击了" + viewName +"========="+ClickUtils.isFastDoubleClick(view));
if (ClickUtils.isFastDoubleClick(view)) { if (ClickUtils.isFastDoubleClick(view)) {
return; return;
} }
int id = view.getId();
if (id == R.id.iv_jp) { if (id == R.id.iv_jp) {
// 添加多层空值检查 // 添加多层空值检查
if (roomInfoResp != null && if (roomInfoResp != null &&
@@ -371,6 +383,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
if (roomInfoResp.getRoom_info() != null && if (roomInfoResp.getRoom_info() != null &&
roomInfoResp.getRoom_info().getRoom_id() != null) { roomInfoResp.getRoom_info().getRoom_id() != null) {
LogUtils.e("RoomGiftDialogFragment_Auction");
RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(), 1, "", getParentFragmentManager()); RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(), 1, "", getParentFragmentManager());
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {

View File

@@ -228,6 +228,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
userInfo.setNickname(roomPitBean.getNickname()); userInfo.setNickname(roomPitBean.getNickname());
userInfo.setAvatar(roomPitBean.getAvatar()); userInfo.setAvatar(roomPitBean.getAvatar());
userInfo.setPit_number(""); userInfo.setPit_number("");
LogUtils.e("RoomGiftDialogFragment_Cabin");
RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(),0,"", getParentFragmentManager()); RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(),0,"", getParentFragmentManager());
} }

View File

@@ -525,6 +525,14 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
private void onClick(View view) { private void onClick(View view) {
int id = view.getId(); int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("roomKTVFragment","点击了" + viewName );
if (id == R.id.ll_tiaoyt) { if (id == R.id.ll_tiaoyt) {
// MvpPre.endSong(roomInfoResp.getRoom_info().getRoom_id()); // MvpPre.endSong(roomInfoResp.getRoom_info().getRoom_id());
TunerDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), getChildFragmentManager()); TunerDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), getChildFragmentManager());
@@ -544,6 +552,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
userInfo.setNickname(roomInfoResp.getSong_user_info().getNickname()); userInfo.setNickname(roomInfoResp.getSong_user_info().getNickname());
userInfo.setUser_id(Integer.parseInt(roomInfoResp.getSong_user_info().getUser_id())); userInfo.setUser_id(Integer.parseInt(roomInfoResp.getSong_user_info().getUser_id()));
userInfo.setPit_number("0"); userInfo.setPit_number("0");
LogUtils.e("RoomGiftDialogFragment_ktv");
RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(), 0, "", getParentFragmentManager()); RoomGiftDialogFragment.show(null, userInfo, roomInfoResp.getRoom_info().getRoom_id(), 0, "", getParentFragmentManager());
} else { } else {
com.hjq.toast.ToastUtils.show("请等待演唱者上麦"); com.hjq.toast.ToastUtils.show("请等待演唱者上麦");

View File

@@ -9,6 +9,7 @@ import com.xscm.moduleutil.base.BaseRoomPresenter;
import com.xscm.moduleutil.bean.CharmRankingResp; import com.xscm.moduleutil.bean.CharmRankingResp;
import com.xscm.moduleutil.http.BaseObserver; import com.xscm.moduleutil.http.BaseObserver;
import java.lang.ref.WeakReference;
import java.util.List; import java.util.List;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
@@ -19,9 +20,10 @@ import io.reactivex.disposables.Disposable;
*/ */
public class DataListPresenter extends BaseRoomPresenter<DataListContacts.View> implements DataListContacts.IRoomDataListPre { public class DataListPresenter extends BaseRoomPresenter<DataListContacts.View> implements DataListContacts.IRoomDataListPre {
private static final String TAG = "DataListPresenter"; private static final String TAG = "DataListPresenter";
DataListContacts.View mView;
public DataListPresenter(DataListContacts.View view, Context context) { public DataListPresenter(DataListContacts.View view, Context context) {
super(view, context); super(view, context);
mView = view;
} }
@@ -38,6 +40,9 @@ public class DataListPresenter extends BaseRoomPresenter<DataListContacts.View>
@Override @Override
public void onNext(List<CharmRankingResp> charmRankingResp) { public void onNext(List<CharmRankingResp> charmRankingResp) {
if (!ObjectUtils.isEmpty(charmRankingResp)){ if (!ObjectUtils.isEmpty(charmRankingResp)){
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
if (charmRankingResp.size()>0){ if (charmRankingResp.size()>0){
MvpRef.get().setNo1(charmRankingResp.get(0)); MvpRef.get().setNo1(charmRankingResp.get(0));
} }
@@ -68,6 +73,9 @@ public class DataListPresenter extends BaseRoomPresenter<DataListContacts.View>
@Override @Override
public void onNext(List<CharmRankingResp> charmRankingResp) { public void onNext(List<CharmRankingResp> charmRankingResp) {
if (!ObjectUtils.isEmpty(charmRankingResp)){ if (!ObjectUtils.isEmpty(charmRankingResp)){
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
if (charmRankingResp.size()>0){ if (charmRankingResp.size()>0){
MvpRef.get().setNo1(charmRankingResp.get(0)); MvpRef.get().setNo1(charmRankingResp.get(0));
} }

View File

@@ -31,6 +31,9 @@ public class FriendshipRoomPresenter extends BaseRoomPresenter<FriendshipRoomCon
@Override @Override
public void onNext(String s) { public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().applyPit(); MvpRef.get().applyPit();
} }
}); });
@@ -79,6 +82,9 @@ public class FriendshipRoomPresenter extends BaseRoomPresenter<FriendshipRoomCon
@Override @Override
public void onNext(FriendUserBean friendUserBean) { public void onNext(FriendUserBean friendUserBean) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().endFriend(friendUserBean); MvpRef.get().endFriend(friendUserBean);
} }
@@ -96,6 +102,9 @@ public class FriendshipRoomPresenter extends BaseRoomPresenter<FriendshipRoomCon
@Override @Override
public void onNext(String s) { public void onNext(String s) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().createRelation(); MvpRef.get().createRelation();
} }
}); });

View File

@@ -106,7 +106,14 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
if (MvpPre == null) { if (MvpPre == null) {
MvpPre = bindPresenter(); MvpPre = bindPresenter();
} }
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(view.getId());
} catch (Exception e) {
viewName = "未知View ID: " + view.getId();
}
LogUtils.e("roomUserInfoFragment","点击了" + viewName );
if (view.getId() == R.id.ll_youth) { if (view.getId() == R.id.ll_youth) {
// startActivity(new Intent(this, UnderageActivity.class)); // startActivity(new Intent(this, UnderageActivity.class));
showYouthModelDialog(); showYouthModelDialog();

View File

@@ -24,6 +24,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.modulemain.R; import com.xscm.modulemain.R;
import com.xscm.moduleutil.bean.room.FriendUserBean; import com.xscm.moduleutil.bean.room.FriendUserBean;
import com.xscm.moduleutil.utils.ImageUtils; import com.xscm.moduleutil.utils.ImageUtils;
@@ -56,6 +57,13 @@ public class FriendsDialogFragment extends DialogFragment {
} }
public static void show(FriendUserBean bean, FragmentManager fragmentManager) { public static void show(FriendUserBean bean, FragmentManager fragmentManager) {
//activity 退到后台调用闪退
try {
// 检查 FragmentManager 状态
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
return;
}
FriendsDialogFragment fragment = new FriendsDialogFragment(); FriendsDialogFragment fragment = new FriendsDialogFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putSerializable("FriendUserBean", bean); args.putSerializable("FriendUserBean", bean);
@@ -67,6 +75,9 @@ public class FriendsDialogFragment extends DialogFragment {
fragment.dismiss(); fragment.dismiss();
} }
}, 4000); // 4秒后关闭 }, 4000); // 4秒后关闭
}catch (IllegalStateException e){
LogUtils.e("FriendsDialogFragment: " + e.getMessage());
}
} }

View File

@@ -20,6 +20,7 @@ import android.view.Window;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.modulemain.R; import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.contacts.RoomUserContacts; import com.xscm.modulemain.activity.room.contacts.RoomUserContacts;
import com.xscm.modulemain.databinding.FragmentRoomUserInfoBinding; import com.xscm.modulemain.databinding.FragmentRoomUserInfoBinding;
@@ -181,6 +182,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
private void onClick(View view) { private void onClick(View view) {
int id = view.getId(); int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("roomUserInfoFragment","点击了" + viewName );
if (id == R.id.room_m_cz) { if (id == R.id.room_m_cz) {
if (mBinding.roomMCz.getText().equals("上麦")) { if (mBinding.roomMCz.getText().equals("上麦")) {
MvpPre.applyPit(room_id, ""); MvpPre.applyPit(room_id, "");
@@ -219,6 +228,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
pit_number = ""; pit_number = "";
} }
userInfo.setPit_number(pit_number); userInfo.setPit_number(pit_number);
LogUtils.e("RoomGiftDialogFragment_userinfo");
RoomGiftDialogFragment.show(null, userInfo, room_id, 0, "", getParentFragmentManager()); RoomGiftDialogFragment.show(null, userInfo, room_id, 0, "", getParentFragmentManager());
} }
dismiss(); dismiss();

View File

@@ -18,6 +18,7 @@ import androidx.recyclerview.widget.LinearSnapHelper;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.GsonUtils; import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.moduleutil.R; import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.BaseMvpDialogFragment; import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean; import com.xscm.moduleutil.bean.GiftBean;
@@ -254,6 +255,14 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
private void onClick(View view) { private void onClick(View view) {
int id = view.getId(); int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("tourClubDFragment","点击了" + viewName );
if (id == R.id.tv_jc) { if (id == R.id.tv_jc) {
if (giftLists != null && !giftLists.isEmpty()) { if (giftLists != null && !giftLists.isEmpty()) {
PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity()); PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
@@ -381,7 +390,9 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
} }
mBinding.gvFz.setIsLuckUser(false); mBinding.gvFz.setIsLuckUser(false);
if (giftXlhChouAdapter != null) {
giftXlhChouAdapter.setNewData(giftLists); giftXlhChouAdapter.setNewData(giftLists);
}
// // 数据加载完成后启动自动滚动 // // 数据加载完成后启动自动滚动
// if (giftLists != null && !giftLists.isEmpty()) { // if (giftLists != null && !giftLists.isEmpty()) {
// mBinding.recycleView.post(() -> { // mBinding.recycleView.post(() -> {
@@ -543,10 +554,10 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
scrollHelper = null; scrollHelper = null;
} }
// 清理适配器引用 // 清理适配器引用 存在一次调用 giftXlhChouAdapter.setNewData(giftLists); 中giftXlhChouAdapter = null;
if (giftXlhChouAdapter != null) { // if (giftXlhChouAdapter != null) {
giftXlhChouAdapter = null; // giftXlhChouAdapter = null;
} // }
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) { if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {

View File

@@ -14,6 +14,7 @@ import android.view.WindowManager;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils; import com.blankj.utilcode.util.ToastUtils;
import com.xscm.modulemain.R; import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.contacts.WheatContacts; import com.xscm.modulemain.activity.room.contacts.WheatContacts;
@@ -164,6 +165,14 @@ public class WheatFeedingDialogFragment extends BaseMvpDialogFragment<WheatPrese
private void onClick(View view) { private void onClick(View view) {
int id = view.getId(); int id = view.getId();
// 通过 ID 获取资源名称
String viewName = "";
try {
viewName = view.getContext().getResources().getResourceEntryName(id);
} catch (Exception e) {
viewName = "未知View ID: " + id;
}
LogUtils.e("wheatFeedingDF","点击了" + viewName );
if (id == R.id.tv_3) { if (id == R.id.tv_3) {
if (mBinding.tv3.getText().equals("设置")) { if (mBinding.tv3.getText().equals("设置")) {
RoomWheatGiftSettingFragment.show(roomId, getChildFragmentManager()); RoomWheatGiftSettingFragment.show(roomId, getChildFragmentManager());

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.6.5 APP_VERSION_NAME=1.0.6.6
APP_VERSION_CODE=54 APP_VERSION_CODE=55
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