新增战令购买经验对话框经验条上加入经验文本
This commit is contained in:
parent
8a7b65955c
commit
4a5e581978
@ -22,7 +22,7 @@ import java.math.BigDecimal;
|
||||
* 战令等级 经验
|
||||
*/
|
||||
public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current;
|
||||
private TextView orderLevel, orderLevelDiamond, balanceDiamond, current,expText;
|
||||
private int currentExperience, totalExperience;//当前经验,全部经验
|
||||
private String buyExp = "100", currentLevel, balance;
|
||||
private ProgressBar progressBar;
|
||||
@ -55,9 +55,11 @@ public class OrderLevelPopupWindow extends CenterPopupView {
|
||||
balanceDiamond = findViewById(R.id.balance_diamond);
|
||||
current = findViewById(R.id.current);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
expText = findViewById(R.id.exp_text);
|
||||
orderLevel.setText(buyExp);
|
||||
progressBar.setMax(totalExperience);
|
||||
progressBar.setProgress(currentExperience);
|
||||
expText.setText(String.format("%s/%s", currentExperience, totalExperience));
|
||||
current.setText(String.format("Lv%s", currentLevel));
|
||||
balanceDiamond.setText(balance);
|
||||
findViewById(R.id.sub).setOnClickListener(new OnClickListener() {
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="218dp"
|
||||
android:layout_marginStart="17dp"
|
||||
@ -40,26 +42,47 @@
|
||||
android:textColor="#CE2BFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="221dp"
|
||||
android:layout_height="6dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:max="100"
|
||||
android:progress="10"
|
||||
android:progressDrawable="@drawable/order_level_progress_bg" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="7dp">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="221dp"
|
||||
android:layout_height="6dp"
|
||||
android:max="100"
|
||||
android:progress="10"
|
||||
android:progressDrawable="@drawable/order_level_progress_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/exp_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="#000"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="500/1000" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
|
@ -78,7 +78,7 @@ public class BattlePassMissionFragment extends BaseFragment {
|
||||
return;
|
||||
}
|
||||
long maxExp=userInfoBean.getMaxLevelExp() - userInfoBean.getBattlePassExp();
|
||||
ToastUtil.show("max = "+maxExp+"|"+userInfoBean.getNextLevelExp());
|
||||
ToastUtil.showDebug("max = "+maxExp+"|"+userInfoBean.getNextLevelExp());
|
||||
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
|
Loading…
Reference in New Issue
Block a user