fix bugs.6
This commit is contained in:
@@ -4052,15 +4052,19 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
|
||||
if (roomFragment == null) {
|
||||
roomFragment = RoomFragment.newInstance(this, mRoomInfoResp)
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
} else {
|
||||
roomFragment!!.refreshData(mRoomInfoResp, qxType)
|
||||
if (roomFragment != null) {
|
||||
supportFragmentManager.beginTransaction().remove(roomFragment!!).commitAllowingStateLoss()
|
||||
roomFragment = null
|
||||
}
|
||||
/*else {
|
||||
roomFragment!!.refreshData(mRoomInfoResp, qxType)
|
||||
}*/
|
||||
roomFragment = RoomFragment.newInstance(this, mRoomInfoResp)
|
||||
|
||||
supportFragmentManager
|
||||
.beginTransaction()
|
||||
.replace(R.id.vp_room_pager, roomFragment!!)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun getCharmRank(list: List<RoomCharmRankBean>) {
|
||||
|
||||
@@ -120,24 +120,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).setvisibTop(true);
|
||||
}
|
||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(0);
|
||||
if (roomPitBean.getUser_id() != null && !roomPitBean.getUser_id().isEmpty() && !roomPitBean.getUser_id().equals("0")) {
|
||||
roomPitBean.setIs_pm(1);
|
||||
wheatView.setData(roomPitBean);
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upYs(true);
|
||||
}
|
||||
} else {
|
||||
RoomPitBean pitBean = new RoomPitBean();
|
||||
pitBean.setUser_id("");
|
||||
pitBean.setPit_number("9");
|
||||
pitBean.setAvatar("");
|
||||
pitBean.setNickname("");
|
||||
pitBean.setSex("");
|
||||
pitBean.setCharm("");
|
||||
wheatView.setData(pitBean);
|
||||
|
||||
}
|
||||
parentFragment = (RoomFragment) getParentFragment();
|
||||
|
||||
roomAuction = roomInfoResp.getRoom_auction();
|
||||
@@ -194,7 +177,24 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
auctionList = roomAuction.getAuction_list();
|
||||
gexList();
|
||||
}
|
||||
RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(0);
|
||||
if (roomPitBean.getUser_id() != null && !roomPitBean.getUser_id().isEmpty() && !roomPitBean.getUser_id().equals("0")) {
|
||||
roomPitBean.setIs_pm(1);
|
||||
wheatView.setData(roomPitBean);
|
||||
if (getActivity() instanceof RoomActivity && !wheatView2.getUserId().isEmpty()) {
|
||||
((RoomActivity) getActivity()).upYs(true);
|
||||
}
|
||||
} else {
|
||||
RoomPitBean pitBean = new RoomPitBean();
|
||||
pitBean.setUser_id("");
|
||||
pitBean.setPit_number("9");
|
||||
pitBean.setAvatar("");
|
||||
pitBean.setNickname("");
|
||||
pitBean.setSex("");
|
||||
pitBean.setCharm("");
|
||||
wheatView.setData(pitBean);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
RoomPitBean roomPitBean1 = new RoomPitBean();
|
||||
@@ -209,6 +209,9 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
auctionId = "";
|
||||
SpUtil.setAuctionId("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
tzblChanged();//获取在线列表数据
|
||||
RoomPitBean roomPitBean2 = wheatView.pitBean;
|
||||
if (roomPitBean2 != null && roomPitBean2.getUser_id() != null && !roomPitBean2.getUser_id().equals("0")) {
|
||||
@@ -246,7 +249,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
|
||||
private void getvjs() {
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1 || roomInfoResp.getUser_info().getIs_management() == 1 || roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
if (getActivity() instanceof RoomActivity && !wheatView2.getUserId().isEmpty()) {
|
||||
((RoomActivity) getActivity()).upJs(true);
|
||||
}
|
||||
} else {
|
||||
@@ -836,7 +839,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
public void event1003(RoomMessageEvent messageEvent) {
|
||||
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||
wheatView.setData(getPitBean(messageEvent));
|
||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId() && !wheatView2.getUserId().isEmpty()) {
|
||||
if (getActivity() instanceof RoomActivity) {
|
||||
((RoomActivity) getActivity()).upVisibility(true);
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
*/
|
||||
private void releaseChildFragments() {
|
||||
try {
|
||||
FragmentManager fragmentManager = getChildFragmentManager();
|
||||
// 获取所有子Fragment
|
||||
List<Fragment> fragments = getChildFragmentManager().getFragments();
|
||||
if (!fragments.isEmpty()) {
|
||||
@@ -206,17 +207,9 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}else if (fragment instanceof RoomMentorShipFragment){
|
||||
mentorShipFragment = null;
|
||||
}
|
||||
|
||||
fragmentManager.beginTransaction().remove(fragment).commitNowAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
// 最后移除所有Fragment
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
for (Fragment fragment : fragments) {
|
||||
if (fragment != null) {
|
||||
transaction.remove(fragment);
|
||||
}
|
||||
}
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("releaseChildFragments error: " + e.getMessage());
|
||||
@@ -449,13 +442,10 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}
|
||||
|
||||
private void performFragmentReplacement(@NonNull Fragment newFragment, int containerId) {
|
||||
|
||||
String tag = newFragment.getClass().getSimpleName(); // 使用类名作为 tag
|
||||
FragmentManager fragmentManager = getChildFragmentManager();
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
|
||||
transaction.replace(containerId, newFragment, tag);
|
||||
transaction.commitNowAllowingStateLoss();
|
||||
transaction.replace(containerId, newFragment, "TAG_" + containerId); // 加TAG便于查找
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
setIvForMai(0)
|
||||
}
|
||||
|
||||
if (viewList[0].pitBean.user_id.equals(mRoomInfo?.user_info?.user_id.toString())){
|
||||
if (viewList[0].pitBean.user_id.equals(mRoomInfo?.user_info?.user_id.toString()) && !mSignPitBean?.user_id.equals("0")){
|
||||
mBinding.tvTimeLeft.visibility = View.VISIBLE
|
||||
} else {
|
||||
mBinding.tvTimeLeft.visibility = View.GONE
|
||||
|
||||
Reference in New Issue
Block a user