diff --git a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java index 5c3c94455..4888ebbfd 100644 --- a/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/OrderLevelPopupWindow.java @@ -2,6 +2,7 @@ package com.yunbao.common.dialog; import android.content.Context; import android.view.View; +import android.widget.ProgressBar; import android.widget.TextView; import androidx.annotation.NonNull; @@ -12,15 +13,20 @@ import com.yunbao.common.R; import java.math.BigDecimal; /** - * 战令等级 + * 战令等级 经验 */ public class OrderLevelPopupWindow extends CenterPopupView { - private TextView orderLevel, orderLevelDiamond, balanceDiamond; + private TextView orderLevel, orderLevelDiamond, balanceDiamond, current; + private int currentExperience, totalExperience;//当前经验,全部经验 + private String buyExp = "100", currentLevel, balance; + private ProgressBar progressBar; - private String buyExp = "100"; - - public OrderLevelPopupWindow(@NonNull Context context) { + public OrderLevelPopupWindow(@NonNull Context context, int mCurrentExperience, int mTotalExperience, String mCurrentLevel, String mBalance) { super(context); + currentExperience = mCurrentExperience; + totalExperience = mTotalExperience; + currentLevel = mCurrentLevel; + balance = mBalance; } @Override @@ -35,7 +41,12 @@ public class OrderLevelPopupWindow extends CenterPopupView { orderLevel = findViewById(R.id.tickets_plus_minus); orderLevelDiamond = findViewById(R.id.order_level_diamond); balanceDiamond = findViewById(R.id.balance_diamond); + current = findViewById(R.id.current); orderLevel.setText(buyExp); + progressBar.setMax(totalExperience); + progressBar.setProgress(currentExperience); + current.setText(String.format("Lv%s", currentLevel)); + balanceDiamond.setText(balance); findViewById(R.id.sub).setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { diff --git a/common/src/main/res/layout/order_level_popup.xml b/common/src/main/res/layout/order_level_popup.xml index 0f0f7644f..e1037fe28 100644 --- a/common/src/main/res/layout/order_level_popup.xml +++ b/common/src/main/res/layout/order_level_popup.xml @@ -32,6 +32,7 @@ android:gravity="center_vertical">