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

@@ -24,6 +24,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentManager;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.modulemain.R;
import com.xscm.moduleutil.bean.room.FriendUserBean;
import com.xscm.moduleutil.utils.ImageUtils;
@@ -56,17 +57,27 @@ public class FriendsDialogFragment extends DialogFragment {
}
public static void show(FriendUserBean bean, FragmentManager fragmentManager) {
FriendsDialogFragment fragment = new FriendsDialogFragment();
Bundle args = new Bundle();
args.putSerializable("FriendUserBean", bean);
fragment.setArguments(args);
fragment.show(fragmentManager, "FriendsDialogFragment");
new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (fragment != null && fragment.isAdded()) {
fragment.dismiss();
//activity 退到后台调用闪退
try {
// 检查 FragmentManager 状态
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
return;
}
}, 4000); // 4秒后关闭
FriendsDialogFragment fragment = new FriendsDialogFragment();
Bundle args = new Bundle();
args.putSerializable("FriendUserBean", bean);
fragment.setArguments(args);
fragment.show(fragmentManager, "FriendsDialogFragment");
new Handler(Looper.getMainLooper()).postDelayed(() -> {
if (fragment != null && fragment.isAdded()) {
fragment.dismiss();
}
}, 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 com.alibaba.android.arouter.launcher.ARouter;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.contacts.RoomUserContacts;
import com.xscm.modulemain.databinding.FragmentRoomUserInfoBinding;
@@ -181,6 +182,14 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
private void onClick(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("roomUserInfoFragment","点击了" + viewName );
if (id == R.id.room_m_cz) {
if (mBinding.roomMCz.getText().equals("上麦")) {
MvpPre.applyPit(room_id, "");
@@ -219,6 +228,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
pit_number = "";
}
userInfo.setPit_number(pit_number);
LogUtils.e("RoomGiftDialogFragment_userinfo");
RoomGiftDialogFragment.show(null, userInfo, room_id, 0, "", getParentFragmentManager());
}
dismiss();

View File

@@ -18,6 +18,7 @@ import androidx.recyclerview.widget.LinearSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.GsonUtils;
import com.blankj.utilcode.util.LogUtils;
import com.xscm.moduleutil.R;
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
import com.xscm.moduleutil.bean.GiftBean;
@@ -254,6 +255,14 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
private void onClick(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("tourClubDFragment","点击了" + viewName );
if (id == R.id.tv_jc) {
if (giftLists != null && !giftLists.isEmpty()) {
PrizePoolDialog prizePoolDialog = new PrizePoolDialog(getActivity());
@@ -381,7 +390,9 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
}
mBinding.gvFz.setIsLuckUser(false);
giftXlhChouAdapter.setNewData(giftLists);
if (giftXlhChouAdapter != null) {
giftXlhChouAdapter.setNewData(giftLists);
}
// // 数据加载完成后启动自动滚动
// if (giftLists != null && !giftLists.isEmpty()) {
// mBinding.recycleView.post(() -> {
@@ -543,10 +554,10 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
scrollHelper = null;
}
// 清理适配器引用
if (giftXlhChouAdapter != null) {
giftXlhChouAdapter = null;
}
// 清理适配器引用 存在一次调用 giftXlhChouAdapter.setNewData(giftLists); 中giftXlhChouAdapter = null;
// if (giftXlhChouAdapter != null) {
// giftXlhChouAdapter = null;
// }
if (xlhRecordDialog != null && xlhRecordDialog.isVisible()) {

View File

@@ -14,6 +14,7 @@ import android.view.WindowManager;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.contacts.WheatContacts;
@@ -164,6 +165,14 @@ public class WheatFeedingDialogFragment extends BaseMvpDialogFragment<WheatPrese
private void onClick(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 );
if (id == R.id.tv_3) {
if (mBinding.tv3.getText().equals("设置")) {
RoomWheatGiftSettingFragment.show(roomId, getChildFragmentManager());