拍卖房 fix bugs.
This commit is contained in:
@@ -1933,6 +1933,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (userId == currentUserId) {
|
if (userId == currentUserId) {
|
||||||
setRoleType(3, 888)
|
setRoleType(3, 888)
|
||||||
switchMic(2)
|
switchMic(2)
|
||||||
|
aBoolean = false
|
||||||
|
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding_up)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (text.type == 2) {
|
} else if (text.type == 2) {
|
||||||
@@ -1942,6 +1944,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
} else if ("888" == pitNumber) {
|
} else if ("888" == pitNumber) {
|
||||||
mRoomInfoResp?.room_auction = RoomAuction()
|
mRoomInfoResp?.room_auction = RoomAuction()
|
||||||
if (userId == currentUserId) {
|
if (userId == currentUserId) {
|
||||||
|
aBoolean = true
|
||||||
|
ivWheatFeeding(com.xscm.moduleutil.R.mipmap.room_wheat_feeding)
|
||||||
setRoleType(0, 0)
|
setRoleType(0, 0)
|
||||||
switchMic(2)
|
switchMic(2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,9 +78,14 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
private List<RoomAuction.AuctionListBean> auctionList;
|
private List<RoomAuction.AuctionListBean> auctionList;
|
||||||
private int type;
|
private int type;
|
||||||
RoomFragment parentFragment;
|
RoomFragment parentFragment;
|
||||||
|
private int isShowCardRelationshipFragment = -2;
|
||||||
|
|
||||||
public RoomAuctionFragment(){}
|
private CardRelationshipFragment dialogFragment = null;
|
||||||
public RoomAuctionFragment(RoomInfoResp resp){
|
|
||||||
|
public RoomAuctionFragment() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public RoomAuctionFragment(RoomInfoResp resp) {
|
||||||
roomInfoResp = resp;
|
roomInfoResp = resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,8 +413,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (id == R.id.bangdan) {//出价榜单
|
||||||
else if (id == R.id.bangdan) {//出价榜单
|
|
||||||
BidListDialogFragment.newInstance(SpUtil.getauctionId()).show(getChildFragmentManager(), "BidListDialogFragment");
|
BidListDialogFragment.newInstance(SpUtil.getauctionId()).show(getChildFragmentManager(), "BidListDialogFragment");
|
||||||
} else if (id == R.id.iv_auction1) {
|
} else if (id == R.id.iv_auction1) {
|
||||||
if (mBinding.ivAuction1.getUserId() != null && !mBinding.ivAuction1.getUserId().equals("")) {
|
if (mBinding.ivAuction1.getUserId() != null && !mBinding.ivAuction1.getUserId().equals("")) {
|
||||||
@@ -463,7 +467,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
viewName = "未知View ID: " + id;
|
viewName = "未知View ID: " + id;
|
||||||
}
|
}
|
||||||
LogUtils.e("wheatFeedingDF","点击了" + viewName +"========="+ClickUtils.isFastDoubleClick(view));
|
LogUtils.e("wheatFeedingDF", "点击了" + viewName + "=========" + ClickUtils.isFastDoubleClick(view));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -861,6 +865,17 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
if (isShowCardRelationshipFragment == -1) {
|
||||||
|
isShowCardRelationshipFragment = CardRelationshipFragment.show(roomInfoResp.getRoom_info().getRoom_id(),
|
||||||
|
SpUtil.getUserId() + "", type + "", getActivity().getSupportFragmentManager(), dialogFragment -> {
|
||||||
|
this.dialogFragment = dialogFragment;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void event1022(RoomMessageEvent messageEvent) {
|
public void event1022(RoomMessageEvent messageEvent) {
|
||||||
if (messageEvent.getText().getType() == 1) {//拍卖位上麦
|
if (messageEvent.getText().getType() == 1) {//拍卖位上麦
|
||||||
if (messageEvent.getText().getPit_number().equals("888")) {
|
if (messageEvent.getText().getPit_number().equals("888")) {
|
||||||
@@ -870,14 +885,26 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
((RoomActivity) getActivity()).upYs(false);
|
((RoomActivity) getActivity()).upYs(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
isShowCardRelationshipFragment = -2;
|
||||||
|
|
||||||
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
if (messageEvent.getText().getFromUserInfo().getUser_id() == SpUtil.getUserId()) {
|
||||||
CardRelationshipFragment.show(roomInfoResp.getRoom_info().getRoom_id(), SpUtil.getUserId() + "", type + "", getActivity().getSupportFragmentManager());
|
isShowCardRelationshipFragment = CardRelationshipFragment.show(roomInfoResp.getRoom_info().getRoom_id(),
|
||||||
|
SpUtil.getUserId() + "", type + "", getActivity().getSupportFragmentManager(), dialogFragment -> {
|
||||||
|
this.dialogFragment = dialogFragment;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else if (messageEvent.getText().getType() == 2) {//拍卖位下麦
|
} else if (messageEvent.getText().getType() == 2) {//拍卖位下麦
|
||||||
if (messageEvent.getText().getPit_number().equals("9")) {
|
if (messageEvent.getText().getPit_number().equals("9")) {
|
||||||
wheatView.setData(getPitBean2(messageEvent, "9"));
|
wheatView.setData(getPitBean2(messageEvent, "9"));
|
||||||
} else if (messageEvent.getText().getPit_number().equals("888")) {
|
} else if (messageEvent.getText().getPit_number().equals("888")) {
|
||||||
wheatView2.setData(getPitBean2(messageEvent, "888"));
|
wheatView2.setData(getPitBean2(messageEvent, "888"));
|
||||||
|
try {
|
||||||
|
if (dialogFragment != null){
|
||||||
|
dialogFragment.dismiss();
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
LogUtils.e("RoomAuctionFragment", "event1022: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
yinc();
|
yinc();
|
||||||
}
|
}
|
||||||
@@ -949,9 +976,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
|||||||
getvjs();
|
getvjs();
|
||||||
// imActionYs.setVisibility(GONE);
|
// imActionYs.setVisibility(GONE);
|
||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
|
if (getHostUser() < 4){
|
||||||
|
((RoomActivity) getActivity()).upJs(true);
|
||||||
|
}else {
|
||||||
((RoomActivity) getActivity()).upJs(false);
|
((RoomActivity) getActivity()).upJs(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (messageEvent.getText().getAuction_user().getUser_id().equals(SpUtil.getUserId() + "")) {
|
if (messageEvent.getText().getAuction_user().getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||||
mBinding.ivJp.setVisibility(INVISIBLE);
|
mBinding.ivJp.setVisibility(INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.fragment.app.FragmentManager;
|
|||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.LogUtils;
|
||||||
import com.xscm.modulemain.R;
|
import com.xscm.modulemain.R;
|
||||||
import com.xscm.modulemain.adapter.CardRelationAdapter;
|
import com.xscm.modulemain.adapter.CardRelationAdapter;
|
||||||
import com.xscm.modulemain.activity.room.contacts.CardRelationshipContacts;
|
import com.xscm.modulemain.activity.room.contacts.CardRelationshipContacts;
|
||||||
@@ -34,11 +35,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@author qx
|
* @author qx
|
||||||
*@data 2025/6/28
|
* @data 2025/6/28
|
||||||
*@description: 卡关系弹框
|
* @description: 卡关系弹框
|
||||||
*/
|
*/
|
||||||
public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelationshipPresenter, DialogCardRelationBinding> implements CardRelationshipContacts.View{
|
public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelationshipPresenter, DialogCardRelationBinding> implements CardRelationshipContacts.View {
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
private String roomId;
|
private String roomId;
|
||||||
@@ -56,8 +57,18 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
return new CardRelationshipPresenter(this, getActivity());
|
return new CardRelationshipPresenter(this, getActivity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface OnCardRelationListener{
|
||||||
|
void OnCardRelationListener(CardRelationshipFragment dialogFragment);
|
||||||
|
}
|
||||||
|
|
||||||
public static void show(String roomId, String userId,String type, FragmentManager fragmentManager) {
|
|
||||||
|
public static int show(String roomId, String userId, String type, FragmentManager fragmentManager,OnCardRelationListener onCardRelationListener) {
|
||||||
|
//activity 退到后台调用闪退
|
||||||
|
try {
|
||||||
|
// 检查 FragmentManager 状态
|
||||||
|
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
CardRelationshipFragment dialogFragment = new CardRelationshipFragment();
|
CardRelationshipFragment dialogFragment = new CardRelationshipFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putString("roomId", roomId);
|
args.putString("roomId", roomId);
|
||||||
@@ -65,7 +76,14 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
args.putString("type", type);
|
args.putString("type", type);
|
||||||
dialogFragment.setArguments(args);
|
dialogFragment.setArguments(args);
|
||||||
dialogFragment.show(fragmentManager, "CardRelationshipFragment");
|
dialogFragment.show(fragmentManager, "CardRelationshipFragment");
|
||||||
|
onCardRelationListener.OnCardRelationListener(dialogFragment);
|
||||||
|
return 0;
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.e("CardRelationshipFragment", "show: " + e.getMessage());
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(@NonNull Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
@@ -79,6 +97,7 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
MvpPre.roomRelationList(type);
|
MvpPre.roomRelationList(type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
@@ -86,7 +105,8 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
if (window != null) {
|
if (window != null) {
|
||||||
// 设置固定高度为 500dp
|
// 设置固定高度为 500dp
|
||||||
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
int screenHeight = getResources().getDisplayMetrics().heightPixels;
|
||||||
int heightInDp = (int) (screenHeight * 0.6f);;
|
int heightInDp = (int) (screenHeight * 0.6f);
|
||||||
|
;
|
||||||
int heightInPx = (int) heightInDp;
|
int heightInPx = (int) heightInDp;
|
||||||
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, heightInPx);
|
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, heightInPx);
|
||||||
|
|
||||||
@@ -97,12 +117,14 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
getDialog().setCancelable(false);
|
getDialog().setCancelable(false);
|
||||||
getDialog().setCanceledOnTouchOutside(false);
|
getDialog().setCanceledOnTouchOutside(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDialogStyle(Window window) {
|
protected void initDialogStyle(Window window) {
|
||||||
super.initDialogStyle(window);
|
super.initDialogStyle(window);
|
||||||
window.setGravity(Gravity.BOTTOM);
|
window.setGravity(Gravity.BOTTOM);
|
||||||
setStyle(DialogFragment.STYLE_NORMAL, com.xscm.moduleutil.R.style.CustomDialogFragmentTheme);
|
setStyle(DialogFragment.STYLE_NORMAL, com.xscm.moduleutil.R.style.CustomDialogFragmentTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
RecyclerView recyclerView = mBinding.recycleView;
|
RecyclerView recyclerView = mBinding.recycleView;
|
||||||
@@ -129,7 +151,7 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
});
|
});
|
||||||
adapter = new CardRelationAdapter();
|
adapter = new CardRelationAdapter();
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
roomAuctionABean=new RoomAuctionABean();
|
roomAuctionABean = new RoomAuctionABean();
|
||||||
|
|
||||||
// 模拟从网络获取 RoomAuctionABean 数据
|
// 模拟从网络获取 RoomAuctionABean 数据
|
||||||
|
|
||||||
@@ -141,20 +163,20 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
roomRelationBean = adapter.getSelectedRelation();
|
roomRelationBean = adapter.getSelectedRelation();
|
||||||
roomAutionTimeBean = adapter.getSelectedTime();
|
roomAutionTimeBean = adapter.getSelectedTime();
|
||||||
roonGiftModel = adapter.getSelectedGift();
|
roonGiftModel = adapter.getSelectedGift();
|
||||||
if (type.equals("2")){
|
if (type.equals("2")) {
|
||||||
if (roomRelationBean != null && roomAutionTimeBean != null && roonGiftModel != null) {
|
if (roomRelationBean != null && roomAutionTimeBean != null && roonGiftModel != null) {
|
||||||
// 创建一个 RoomAuctionABean 对象
|
// 创建一个 RoomAuctionABean 对象
|
||||||
MvpPre.roomAuction(roomId, userId, roonGiftModel.getGift_id(), roomRelationBean.getRelation_id(), "2", roomAutionTimeBean.getHours()+"");
|
MvpPre.roomAuction(roomId, userId, roonGiftModel.getGift_id(), roomRelationBean.getRelation_id(), "2", roomAutionTimeBean.getHours() + "");
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.show("请选择竞拍信息");
|
ToastUtils.show("请选择竞拍信息");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (roomRelationBean != null&& roonGiftModel != null){
|
if (roomRelationBean != null && roonGiftModel != null) {
|
||||||
|
|
||||||
// MvpPre.roomAuctionTime(roonGiftModel.getGift_id());
|
// MvpPre.roomAuctionTime(roonGiftModel.getGift_id());
|
||||||
MvpPre.roomAuction(roomId, userId, roonGiftModel.getGift_id(), roomRelationBean.getRelation_id(), "1", "");
|
MvpPre.roomAuction(roomId, userId, roonGiftModel.getGift_id(), roomRelationBean.getRelation_id(), "1", "");
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.show("请选择竞拍信息");
|
ToastUtils.show("请选择竞拍信息");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,10 +195,10 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void roomRelationList(List<RoomRelationBean> roomRelationBeans) {
|
public void roomRelationList(List<RoomRelationBean> roomRelationBeans) {
|
||||||
if (roomRelationBeans!=null) {
|
if (roomRelationBeans != null) {
|
||||||
roomAuctionABean.setRoomRelationBeanList(roomRelationBeans);
|
roomAuctionABean.setRoomRelationBeanList(roomRelationBeans);
|
||||||
MvpPre.getGiftList("99");
|
MvpPre.getGiftList("99");
|
||||||
}else {
|
} else {
|
||||||
ToastUtils.show("数据接口错误");
|
ToastUtils.show("数据接口错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +206,7 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGiftList(List<RoonGiftModel> roonGiftModels) {
|
public void setGiftList(List<RoonGiftModel> roonGiftModels) {
|
||||||
if (roonGiftModels!=null) {
|
if (roonGiftModels != null) {
|
||||||
roomAuctionABean.setRoomGiftBeanList(roonGiftModels);
|
roomAuctionABean.setRoomGiftBeanList(roonGiftModels);
|
||||||
upList();
|
upList();
|
||||||
}
|
}
|
||||||
@@ -204,7 +226,7 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void upList(){
|
private void upList() {
|
||||||
if (roomAuctionABean != null) {
|
if (roomAuctionABean != null) {
|
||||||
// 添加文本项
|
// 添加文本项
|
||||||
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择关系"));
|
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择关系"));
|
||||||
@@ -214,7 +236,7 @@ public class CardRelationshipFragment extends BaseMvpDialogFragment<CardRelation
|
|||||||
viewItems.add(new ViewItem(ViewItem.TYPE_RELATION, bean));
|
viewItems.add(new ViewItem(ViewItem.TYPE_RELATION, bean));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.equals("2")){
|
if (type.equals("2")) {
|
||||||
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择时长"));
|
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择时长"));
|
||||||
for (RoomAutionTimeBean bean : getDefaultTimeOptions()) {
|
for (RoomAutionTimeBean bean : getDefaultTimeOptions()) {
|
||||||
viewItems.add(new ViewItem(ViewItem.TYPE_IMAGE_SELECTION, bean));
|
viewItems.add(new ViewItem(ViewItem.TYPE_IMAGE_SELECTION, bean));
|
||||||
|
|||||||
@@ -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.RoomAuction;
|
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||||
import com.xscm.moduleutil.utils.ImageUtils;
|
import com.xscm.moduleutil.utils.ImageUtils;
|
||||||
@@ -36,11 +37,11 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
RoomAuction.AuctionListBean recipient;
|
RoomAuction.AuctionListBean recipient;
|
||||||
RoomAuction.AuctionUserBean auction_user;
|
RoomAuction.AuctionUserBean auction_user;
|
||||||
private OnDialogActionListener listener;
|
private OnDialogActionListener listener;
|
||||||
GifAvatarOvalView avatar1,za_avatar1;
|
GifAvatarOvalView avatar1, za_avatar1;
|
||||||
GifAvatarOvalView avatar2,za_avatar2;
|
GifAvatarOvalView avatar2, za_avatar2;
|
||||||
private TextView tv_tname,tv_za_tname;
|
private TextView tv_tname, tv_za_tname;
|
||||||
private TextView tv_name1,tv_za_name1;
|
private TextView tv_name1, tv_za_name1;
|
||||||
private TextView tv_name2,tv_za_name2;
|
private TextView tv_name2, tv_za_name2;
|
||||||
ConstraintLayout constraintLayout_qm, constraintLayout2_za;
|
ConstraintLayout constraintLayout_qm, constraintLayout2_za;
|
||||||
|
|
||||||
public interface OnDialogActionListener {
|
public interface OnDialogActionListener {
|
||||||
@@ -53,17 +54,32 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void show(RoomAuction.AuctionListBean recipient, RoomAuction.AuctionUserBean auction_user, FragmentManager fragmentManager) {
|
public static void show(RoomAuction.AuctionListBean recipient, RoomAuction.AuctionUserBean auction_user, FragmentManager fragmentManager) {
|
||||||
|
//activity 退到后台调用闪退
|
||||||
|
try {
|
||||||
|
// 检查 FragmentManager 状态
|
||||||
|
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
CustomCenterDialogFragment fragment = new CustomCenterDialogFragment();
|
CustomCenterDialogFragment fragment = new CustomCenterDialogFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putSerializable("recipient", recipient);
|
args.putSerializable("recipient", recipient);
|
||||||
args.putSerializable("auction_user", auction_user);
|
args.putSerializable("auction_user", auction_user);
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
fragment.show(fragmentManager, "CustomCenterDialogFragment");
|
fragment.show(fragmentManager, "CustomCenterDialogFragment");
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.e("CustomCenterDialogFragment", e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showWithAutoDismiss(RoomAuction.AuctionListBean recipient,
|
public static void showWithAutoDismiss(RoomAuction.AuctionListBean recipient,
|
||||||
RoomAuction.AuctionUserBean auction_user,
|
RoomAuction.AuctionUserBean auction_user,
|
||||||
FragmentManager fragmentManager) {
|
FragmentManager fragmentManager) {
|
||||||
|
//activity 退到后台调用闪退
|
||||||
|
try {
|
||||||
|
// 检查 FragmentManager 状态
|
||||||
|
if (fragmentManager.isDestroyed() || fragmentManager.isStateSaved()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
CustomCenterDialogFragment fragment = new CustomCenterDialogFragment();
|
CustomCenterDialogFragment fragment = new CustomCenterDialogFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putSerializable("recipient", recipient);
|
args.putSerializable("recipient", recipient);
|
||||||
@@ -94,9 +110,13 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
LogUtils.e("CustomCenterDialogFragment", e.getMessage());
|
||||||
// 安全地忽略异常
|
// 安全地忽略异常
|
||||||
}
|
}
|
||||||
}, 4000); // 4秒后关闭
|
}, 4000); // 4秒后关闭
|
||||||
|
} catch (Exception e) {
|
||||||
|
LogUtils.e("CustomCenterDialogFragment", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +132,6 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
@@ -126,41 +145,42 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
window.setGravity(Gravity.CENTER);
|
window.setGravity(Gravity.CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
avatar1= dialog.findViewById(R.id.avatar1);
|
avatar1 = dialog.findViewById(R.id.avatar1);
|
||||||
avatar2= dialog.findViewById(R.id.avatar2);
|
avatar2 = dialog.findViewById(R.id.avatar2);
|
||||||
tv_name1= dialog.findViewById(R.id.tv_name1);
|
tv_name1 = dialog.findViewById(R.id.tv_name1);
|
||||||
tv_name2= dialog.findViewById(R.id.tv_name2);
|
tv_name2 = dialog.findViewById(R.id.tv_name2);
|
||||||
tv_tname= dialog.findViewById(R.id.tv_tname);
|
tv_tname = dialog.findViewById(R.id.tv_tname);
|
||||||
|
|
||||||
za_avatar1= dialog.findViewById(R.id.za_avatar1);
|
za_avatar1 = dialog.findViewById(R.id.za_avatar1);
|
||||||
za_avatar2= dialog.findViewById(R.id.za_avatar2);
|
za_avatar2 = dialog.findViewById(R.id.za_avatar2);
|
||||||
tv_za_name1= dialog.findViewById(R.id.tv_za_name1);
|
tv_za_name1 = dialog.findViewById(R.id.tv_za_name1);
|
||||||
tv_za_name2= dialog.findViewById(R.id.tv_za_name2);
|
tv_za_name2 = dialog.findViewById(R.id.tv_za_name2);
|
||||||
tv_za_tname= dialog.findViewById(R.id.tv_tname_za);
|
tv_za_tname = dialog.findViewById(R.id.tv_tname_za);
|
||||||
|
|
||||||
constraintLayout_qm= dialog.findViewById(R.id.cl_container);
|
constraintLayout_qm = dialog.findViewById(R.id.cl_container);
|
||||||
constraintLayout2_za= dialog.findViewById(R.id.cl_container_za);
|
constraintLayout2_za = dialog.findViewById(R.id.cl_container_za);
|
||||||
if (auction_user.getAuction_type().equals("2")){
|
if (auction_user.getAuction_type().equals("2")) {
|
||||||
constraintLayout_qm.setVisibility(View.VISIBLE);
|
constraintLayout_qm.setVisibility(View.VISIBLE);
|
||||||
constraintLayout2_za.setVisibility(View.GONE);
|
constraintLayout2_za.setVisibility(View.GONE);
|
||||||
ImageUtils.loadHeadCC(recipient.getAvatar(),avatar1);
|
ImageUtils.loadHeadCC(recipient.getAvatar(), avatar1);
|
||||||
ImageUtils.loadHeadCC(auction_user.getAvatar(),avatar2);
|
ImageUtils.loadHeadCC(auction_user.getAvatar(), avatar2);
|
||||||
tv_name1.setText(recipient.getNickname());
|
tv_name1.setText(recipient.getNickname());
|
||||||
tv_name2.setText(auction_user.getNickname());
|
tv_name2.setText(auction_user.getNickname());
|
||||||
tv_tname.setText(auction_user.getRelation_name()+"关系竞拍成功");
|
tv_tname.setText(auction_user.getRelation_name() + "关系竞拍成功");
|
||||||
setTextViewGradient(tv_tname, ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFFFF0F0), ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFA4C8));
|
setTextViewGradient(tv_tname, ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFFFF0F0), ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.color_FFA4C8));
|
||||||
}else {
|
} else {
|
||||||
constraintLayout_qm.setVisibility(View.GONE);
|
constraintLayout_qm.setVisibility(View.GONE);
|
||||||
constraintLayout2_za.setVisibility(View.VISIBLE);
|
constraintLayout2_za.setVisibility(View.VISIBLE);
|
||||||
ImageUtils.loadHeadCC(recipient.getAvatar(),za_avatar1);
|
ImageUtils.loadHeadCC(recipient.getAvatar(), za_avatar1);
|
||||||
ImageUtils.loadHeadCC(auction_user.getAvatar(),za_avatar2);
|
ImageUtils.loadHeadCC(auction_user.getAvatar(), za_avatar2);
|
||||||
tv_za_name1.setText(recipient.getNickname());
|
tv_za_name1.setText(recipient.getNickname());
|
||||||
tv_za_name2.setText(auction_user.getNickname());
|
tv_za_name2.setText(auction_user.getNickname());
|
||||||
tv_za_tname.setText(auction_user.getRelation_name()+"关系竞拍成功");
|
tv_za_tname.setText(auction_user.getRelation_name() + "关系竞拍成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTextViewGradient(TextView textView, int startColor, int endColor) {
|
private void setTextViewGradient(TextView textView, int startColor, int endColor) {
|
||||||
Shader shader = new LinearGradient(
|
Shader shader = new LinearGradient(
|
||||||
0, 0, textView.getPaint().getTextSize() * textView.length(), 0,
|
0, 0, textView.getPaint().getTextSize() * textView.length(), 0,
|
||||||
@@ -169,6 +189,7 @@ public class CustomCenterDialogFragment extends DialogFragment {
|
|||||||
Shader.TileMode.CLAMP);
|
Shader.TileMode.CLAMP);
|
||||||
textView.getPaint().setShader(shader);
|
textView.getPaint().setShader(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
Reference in New Issue
Block a user