弹窗整合

This commit is contained in:
18401019693 2023-12-14 17:39:05 +08:00
parent 280920d5f0
commit 3982afb0d3

View File

@ -3,6 +3,7 @@ package com.yunbao.main.views;
import static android.content.Context.CLIPBOARD_SERVICE; import static android.content.Context.CLIPBOARD_SERVICE;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
import android.content.Context; import android.content.Context;
@ -30,21 +31,23 @@ import androidx.annotation.RequiresApi;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.lxj.xpopup.XPopup; import com.lxj.xpopup.XPopup;
import com.momo.mcamera.util.JsonUtil;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.bean.CoolConfig;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.dialog.ActivateEliteBattleOrderPopupWindow; import com.yunbao.common.bean.NativeCallbackModel;
import com.yunbao.common.dialog.LiberalBattlePassPopupWindow; import com.yunbao.common.dialog.CinemaTicketPopupWindow;
import com.yunbao.common.dialog.PromotionElitePopupWindow;
import com.yunbao.common.dialog.RuleOfWarPopupWindow;
import com.yunbao.common.event.JavascriptInterfaceEvent; import com.yunbao.common.event.JavascriptInterfaceEvent;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.LiveHttpUtil;
import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.JavascriptInterfacePlayLetUtils; import com.yunbao.common.utils.JavascriptInterfacePlayLetUtils;
import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.JavascriptInterfaceUtils;
@ -52,9 +55,11 @@ import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.views.LoadingView; import com.yunbao.live.views.LoadingView;
import com.yunbao.main.R; import com.yunbao.main.R;
import com.yunbao.main.activity.MainActivity; import com.yunbao.main.activity.MainActivity;
import com.yunbao.main.activity.MyWalletActivity;
import com.yunbao.main.dialog.EncourageDialog; import com.yunbao.main.dialog.EncourageDialog;
import com.yunbao.main.utils.BottomBarUtil; import com.yunbao.main.utils.BottomBarUtil;
import com.yunbao.share.ui.SharePopDialog; import com.yunbao.share.ui.SharePopDialog;
@ -389,14 +394,13 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
.setAnchorAvatar(json.getString("avatar")) .setAnchorAvatar(json.getString("avatar"))
.showDialog(); .showDialog();
} else if (TextUtils.equals(event.getMethod(), "postWeakBalance")) { } else if (TextUtils.equals(event.getMethod(), "postWeakBalance")) {
LiveNetManager.get(mContext). LiveNetManager.get(mContext).
getCoolConfig(new com.yunbao.common.http.base.HttpCallback<CoolConfig>() { getCoolConfig(new com.yunbao.common.http.base.HttpCallback<CoolConfig>() {
@Override @Override
public void onSuccess(CoolConfig data) { public void onSuccess(CoolConfig data) {
new XPopup.Builder(mContext) new XPopup.Builder(mContext)
.enableDrag(false) .enableDrag(false)
.autoOpenSoftInput(false)
.maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34)) .maxWidth(DeviceUtils.getScreenHeight((Activity) mContext) - DpUtil.dp2px(34))
.asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() { .asCustom(new CinemaTicketPopupWindow(mContext, data.setTicketCount(event.getCoolConfig().getTicketCount()), new CinemaTicketPopupWindow.CinemaTicketPopupWindowCallBack() {
@Override @Override
@ -415,6 +419,7 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
} }
}); });
} else if (TextUtils.equals(data, "1")) { } else if (TextUtils.equals(data, "1")) {
ToastUtil.show(WordUtil.isNewZh() ? "兑换成功" : "Successful exchange");
mWebView.post(new Runnable() { mWebView.post(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -437,13 +442,12 @@ public class MainHomeCommunityViewHolder extends AbsMainHomeChildViewHolder impl
} }
@Override @Override
public void onError (String error){ public void onError(String error) {
ToastUtil.show(error); ToastUtil.show(error);
} }
// }); });
} }
}
}
} }
}
}