diff --git a/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java index 767cef165..c16a17cfb 100644 --- a/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/PromotionElitePopupWindow.java @@ -6,10 +6,14 @@ import android.content.Context; import androidx.annotation.NonNull; import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.core.BasePopupView; import com.lxj.xpopup.core.CenterPopupView; import com.yunbao.common.R; +import com.yunbao.common.bean.BattlePassUserInfoBean; import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; /** @@ -19,6 +23,7 @@ public class PromotionElitePopupWindow extends CenterPopupView { private String enjoySpendMoney, quintessenceSpendMoney;//花费钱 private LiberalBattlePassPopupWindow.LiberalBattlePassCallback mPassCallback; private String elitesTypeId,enjoyTypeId; + private BattlePassUserInfoBean data; public PromotionElitePopupWindow(@NonNull Context context, String mEnjoySpendMoney, String mQuintessenceSpendMoney, LiberalBattlePassPopupWindow.LiberalBattlePassCallback passCallback, @@ -30,6 +35,10 @@ public class PromotionElitePopupWindow extends CenterPopupView { this.elitesTypeId = elitesTypeId; this.enjoyTypeId = enjoyTypeId; } + public PromotionElitePopupWindow setUserData(BattlePassUserInfoBean data) { + this.data=data; + return this; + } @Override protected int getImplLayoutId() { @@ -49,6 +58,10 @@ public class PromotionElitePopupWindow extends CenterPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_quintessence), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + if(data!=null && data.getBattlePassUserRecords2()==2){ + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); + return; + } dialog.dismiss(); new XPopup.Builder(getContext()) .enableDrag(false) @@ -60,6 +73,10 @@ public class PromotionElitePopupWindow extends CenterPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.button_enjoy), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { + if(data!=null && data.getBattlePassUserRecords3()==2){ + ToastUtil.show(WordUtil.getNewString(R.string.battlepass_buy_max)); + return; + } dialog.dismiss(); new XPopup.Builder(getContext()) .enableDrag(false) @@ -69,4 +86,6 @@ public class PromotionElitePopupWindow extends CenterPopupView { } }); } + + } diff --git a/common/src/main/res/layout/liberal_battle_pass_popup.xml b/common/src/main/res/layout/liberal_battle_pass_popup.xml index e49136d12..222928af4 100644 --- a/common/src/main/res/layout/liberal_battle_pass_popup.xml +++ b/common/src/main/res/layout/liberal_battle_pass_popup.xml @@ -10,7 +10,10 @@ - + > - - - + android:layout_marginBottom="16dp" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - - - -