From cad8236e5c46af985c0028dfb2e3f22fd115021b Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 21 Mar 2024 17:36:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/http/live/LiveNetManager.java | 2 + .../yunbao/live/dialog/DragonExpirePopup.java | 9 +++- .../live/dialog/LiveBuyGuardDialog.java | 32 ++++++++--- .../yunbao/live/dialog/LiveGuardDialog.java | 54 +++++++++++++++++++ .../live/presenter/LiveGiftAnimPresenter.java | 6 +++ 5 files changed, 95 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 2da882d1f..97d251db9 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -2995,6 +2995,8 @@ public class LiveNetManager { if (callback != null) { if (stringResponseModel.getData().getCode() == 0) { callback.onSuccess(stringResponseModel.getData().getMsg()); + } else if (stringResponseModel.getData().getCode() == 1001) { + callback.onSuccess("22"); } else { callback.onError(stringResponseModel.getData().getMsg()); } diff --git a/live/src/main/java/com/yunbao/live/dialog/DragonExpirePopup.java b/live/src/main/java/com/yunbao/live/dialog/DragonExpirePopup.java index 02dac6218..60dcac6a3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/DragonExpirePopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/DragonExpirePopup.java @@ -1,6 +1,7 @@ package com.yunbao.live.dialog; import android.content.Context; +import android.os.Handler; import android.widget.TextView; import androidx.annotation.NonNull; @@ -123,7 +124,13 @@ public class DragonExpirePopup extends CenterPopupView { @Override public void onViewClicks() { dismiss(); - new LiveBuyGuardDialog(activity, mLiveUid, mStream, getGuardUserInfoModel).showDialog(); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + new LiveBuyGuardDialog(activity, mLiveUid, mStream, getGuardUserInfoModel).showDialog(); + } + },1000); + } }); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java index 073e8f2dc..3dea413d3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveBuyGuardDialog.java @@ -1,5 +1,7 @@ package com.yunbao.live.dialog; +import static com.yunbao.common.utils.RouteUtil.PATH_COIN; + import android.animation.ObjectAnimator; import android.app.Dialog; import android.content.Context; @@ -21,6 +23,7 @@ import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager; +import com.alibaba.android.arouter.launcher.ARouter; import com.flyjingfish.gradienttextviewlib.GradientTextView; import com.lxj.xpopup.XPopup; import com.lxj.xpopup.enums.PopupPosition; @@ -152,7 +155,7 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { @Override public void run() { if (mGuardUserInfoModel != null) { - if (mGuardUserInfoModel.getGuardType()!=0){ + if (mGuardUserInfoModel.getGuardType() != 0) { buyGuardBanner.setBannerCurrentItem(mGuardUserInfoModel.getGuardType() - 1); } @@ -348,13 +351,28 @@ public class LiveBuyGuardDialog extends AbsDialogPopupWindow { String.valueOf(guardPriceModel.getPriceKey()), mStream, new HttpCallback() { @Override public void onSuccess(String data) { - ToastUtil.show(data); - dismiss(); - if (dataTipModel.getGuardType() == 3) { - new XPopup.Builder(mContext) - .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) - .show(); + if (TextUtils.equals(data, "22")) { + new DialogUitl.Builder(mContext) + .setView(R.layout.dialog_live_unfollow) + .setConfirmString(mContext.getString(R.string.charge)) + .setContent(mContext.getString(R.string.insufficient_balance)) + .setClickCallback(new DialogUitl.SimpleCallback() { + @Override + public void onConfirmClick(Dialog dialog, String content) { + LiveBuyGuardDialog.this.dismiss(); + ARouter.getInstance().build(PATH_COIN).withInt("p", 0).navigation(); + } + }).build().show(); + } else { + ToastUtil.show(data); + dismiss(); + if (dataTipModel.getGuardType() == 3) { + new XPopup.Builder(mContext) + .asCustom(new DragonSendsMoneyPopup(mContext, mLiveUid)) + .show(); + } } + } @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java index 57a89ba6f..e3652f8e6 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialog.java @@ -1,6 +1,7 @@ package com.yunbao.live.dialog; import android.content.Context; +import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -17,9 +18,11 @@ import com.lxj.xpopup.XPopup; import com.makeramen.roundedimageview.RoundedImageView; import com.opensource.svgaplayer.SVGAImageView; import com.umeng.analytics.MobclickAgent; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.bean.CheckUpgradesModel; import com.yunbao.common.bean.GuardGetGuardUserInfoModel; +import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.dialog.AbsDialogPopupWindow; import com.yunbao.common.dialog.GuardUpgradePopup; @@ -27,13 +30,16 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.CommonIconUtil; +import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.TimeUtils; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; +import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.adapter.NewGuardAdapter; import com.yunbao.live.bean.GuardUserModel; @@ -257,6 +263,54 @@ public class LiveGuardDialog extends AbsDialogPopupWindow { } }); + ViewClicksAntiShake.clicksAntiShake(guardianTask, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + StringBuffer htmlUrl = new StringBuffer(); + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/h5/Guard/mission.html?") + .append("&token=") + .append(userInfo.getToken()) + .append("&uid=") + .append(userInfo.getId()) + .append("&&anchorUid=") + .append(mLiveUid) + .append("&isZh=") + .append(((WordUtil.isNewZh()) ? "1" : "0")); + + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + bundle.putInt("height", DeviceUtils.getScreenHeight(getActivity()) / 5 * 3); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); + ViewClicksAntiShake.clicksAntiShake(myGraudGrade, new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + StringBuffer htmlUrl = new StringBuffer(); + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + htmlUrl.append(CommonAppConfig.HOST) + .append("/h5/Guard/level.html?") + .append("&token=") + .append(userInfo.getToken()) + .append("&uid=") + .append(userInfo.getId()) + .append("&&anchorUid=") + .append(mLiveUid) + .append("&isZh=") + .append(((WordUtil.isNewZh()) ? "1" : "0")); + + Bundle bundle = new Bundle(); + bundle.putString("url", htmlUrl.toString()); + bundle.putInt("height", DeviceUtils.getScreenHeight(getActivity()) / 5 * 3); + LiveHDDialogFragment fragment = new LiveHDDialogFragment(); + fragment.setArguments(bundle); + fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); + } + }); } private void setAdapterData() { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java index dd9e24155..eefb2de90 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveGiftAnimPresenter.java @@ -1649,12 +1649,18 @@ public class LiveGiftAnimPresenter { if (mGifGiftTipShowAnimatorBuyGuard != null) { mGifGiftTipShowAnimatorBuyGuard.cancel(); } + if (mGifGiftTipShowAnimatorBuyGuardNew != null) { + mGifGiftTipShowAnimatorBuyGuardNew.cancel(); + } if (mGifGiftTipHideAnimatorAllServer != null) { mGifGiftTipHideAnimatorAllServer.cancel(); } if (mGifGiftTipHideAnimatorBuyGuard != null) { mGifGiftTipHideAnimatorBuyGuard.cancel(); } + if (mGifGiftTipHideAnimatorBuyGuardNew != null) { + mGifGiftTipHideAnimatorBuyGuardNew.cancel(); + } if (mGifGiftTipShowAnimatorBuyZuoji != null) { mGifGiftTipShowAnimatorBuyZuoji.cancel();