1:修改拍卖房背景

2:修改小黑屋报错问题
This commit is contained in:
2025-10-12 23:38:12 +08:00
parent 773db1da25
commit c1d13cd34c
12 changed files with 169 additions and 50 deletions

View File

@@ -1096,8 +1096,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val params = layoutParams
params.width = ConstraintLayout.LayoutParams.MATCH_CONSTRAINT
params.height = ConstraintLayout.LayoutParams.MATCH_CONSTRAINT
params.horizontalBias = 0.5f
params.verticalBias = 0.5f
// params.horizontalBias = 0.5f
// params.verticalBias = 0.5f
floatingMagnetView!!.layoutParams = params
} else {
// 如果不是ConstraintLayout.LayoutParams创建新的
@@ -3931,10 +3931,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val roomBean = resp.room_info
if (roomBean!!.type_id.equals("6")){
return
}
this.mRoomBean = roomBean
this.mRoomUserBean = resp.user_info
this.mRoomOwnerBean = resp.room_owner
this.mPitList = mRoomBean!!.pit_list
this.mPitList = mRoomBean!!.pit_list!!
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
mBinding!!.roomTop.name.text = roomBean.room_name

View File

@@ -680,10 +680,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
mBinding.pB.setImageResource(com.xscm.moduleutil.R.mipmap.za_t);
mBinding.btnRelation.setImageResource(com.xscm.moduleutil.R.mipmap.za_g);
mBinding.tvRelation.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
mBinding.tvRelation.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
mBinding.btnGift.setImageResource(com.xscm.moduleutil.R.mipmap.za_l);
mBinding.tvGift.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
mBinding.tvGift.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
mBinding.btnTime.setImageResource(com.xscm.moduleutil.R.mipmap.za_sj);
mBinding.tvTimetg.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
mBinding.tvTimetg.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_b);
mBinding.ivJp.setImageResource(com.xscm.moduleutil.R.mipmap.za_ljjp);
mBinding.avatar4.setImageResource(com.xscm.moduleutil.R.mipmap.za_m);
mBinding.avatar5.setImageResource(com.xscm.moduleutil.R.mipmap.za_m);
@@ -696,10 +699,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
mBinding.ivAuction1.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
mBinding.ivAuction2.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
mBinding.ivAuction3.setImageResource(com.xscm.moduleutil.R.mipmap.za_m, 0, "0");
mBinding.nickName1.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
mBinding.nickName2.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
mBinding.nickName3.setTextColor(ContextCompat.getColor(requireContext(), com.xscm.moduleutil.R.color.color_white));
setparams();
mBinding.clBj1.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
mBinding.clBj2.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
mBinding.clBj3.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw);
mBinding.clBj1.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
mBinding.clBj2.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
mBinding.clBj3.setBackgroundResource(com.xscm.moduleutil.R.mipmap.za_maiw_o);
} else {
layoutParams.setMargins(0, 15, 0, 0);

View File

@@ -208,7 +208,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
}
});
if (!CommonAppContext.getInstance().isShowAg){
switchMic(1);
switchMic(2);
}else {
isShow = true;
switchMic(2);
@@ -218,12 +218,12 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
@Override
public void onClick(View v) {
// requestScreenCapture();
if (!isMicPlace) {
joinChannel();
isMicPlace = true;
mBinding.im3.setImageResource(com.xscm.moduleutil.R.mipmap.clogs_car);
CommonAppContext.getInstance().isMicPlace = true;
} else {
isMicPlace = false;
ToastUtils.show("将停止屏幕共享");
@@ -245,7 +245,31 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
// mBinding.im3.setVisibility(GONE);
// }
}
// 获取 MediaProjectionManager
// MediaProjectionManager mediaProjectionManager = (MediaProjectionManager) getSelfActivity().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
// private MediaProjection[] mediaProjection = new MediaProjection[1];
// private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
// new ActivityResultContracts.StartActivityForResult(), result -> {
// if (result.getResultCode() == Activity.RESULT_OK) {
// try {
// // 获取申请到的 MediaProjection
// mediaProjection[0] = mediaProjectionManager
// .getMediaProjection(result.getResultCode(), result.getData());
// // r MediaProjection需要在 startScreenCapture 之前调用
//
// AgoraManager.getInstance(getActivity()).setExternalMediaProjection(mediaProjection);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// }
// );
// 请求屏幕捕获
private void requestScreenCapture() {
// Intent intent = mediaProjectionManager.createScreenCaptureIntent();
// mediaProjectionLauncher.launch(intent);
}
public void handleMsgType1028(RoomMessageEvent messageEvent){
if (messageEvent.getMsgType()==1028){
mBinding.tvHeartValue2.setText(messageEvent.getText().getHot_value());
@@ -417,6 +441,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
@Override
public void onExitRoom() {
CommonAppContext.getInstance().isMicPlace = false;
// 调用退出房间方法
if (label_id!=null && label_id.equals(LABEL_ID_MOVIE)){
MvpPre.quitRoom(roomId, SpUtil.getUserId() + "");
@@ -619,7 +644,7 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
if (cpUserBean != null) {
countDownTime(Long.parseLong(cpUserBean.getTime_day()));
}
mediaProjectionManager = (MediaProjectionManager) getContext().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
// mediaProjectionManager = (MediaProjectionManager) getContext().getSystemService(Context.MEDIA_PROJECTION_SERVICE);
}
@Override
@@ -674,22 +699,22 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
}
}
private MediaProjection[] mediaProjection = new MediaProjection[1];
private MediaProjectionManager mediaProjectionManager;
private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == Activity.RESULT_OK) {
try {
mediaProjection[0] = mediaProjectionManager
.getMediaProjection(result.getResultCode(), result.getData());
joinChannel();
} catch (Exception e) {
Log.e("RoomCabinFragment", "error msg: " + e.getMessage());
}
}
}
);
// private MediaProjection[] mediaProjection = new MediaProjection[1];
// private MediaProjectionManager mediaProjectionManager;
// private final ActivityResultLauncher<Intent> mediaProjectionLauncher = registerForActivityResult(
// new ActivityResultContracts.StartActivityForResult(),
// result -> {
// if (result.getResultCode() == Activity.RESULT_OK) {
// try {
// mediaProjection[0] = mediaProjectionManager
// .getMediaProjection(result.getResultCode(), result.getData());
// joinChannel();
// } catch (Exception e) {
// Log.e("RoomCabinFragment", "error msg: " + e.getMessage());
// }
// }
// }
// );
private void isConfig() {
@@ -818,7 +843,9 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
@Subscribe (threadMode = ThreadMode.MAIN)
public void roomInfoEvent(CabinEvent messageEvent) {
if (messageEvent.isJoined()){
isMicPlace=true;
if (CommonAppContext.getInstance().isMicPlace) {
isMicPlace = true;
}
}
}
@@ -831,10 +858,10 @@ public class RoomCabinFragment extends BaseRoomFragment<RoomCabinPresenter, Room
public void releaseResources(){
releaseCountDownTimer();
// ImageUtils.clearDiskCache(getActivity());
if (mediaProjection[0] != null) {
mediaProjection[0].stop();
mediaProjection[0] = null;
}
// if (mediaProjection[0] != null) {
// mediaProjection[0].stop();
// mediaProjection[0] = null;
// }
}
}