From 5da885594834033b5c43cf77522d416f1c625876 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 18 Aug 2023 14:17:46 +0800 Subject: [PATCH] =?UTF-8?q?6.5.4=E7=A4=BC=E7=89=A9=E5=86=A0=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/dialog/LiveGiftPopup.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java index b6a1df975..b5feda359 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java @@ -86,6 +86,7 @@ import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; +import java.math.BigDecimal; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -449,11 +450,14 @@ public class LiveGiftPopup extends AbsDialogFragment { goldText.setText(coinModel.getGold()); diamondText.setText(coinModel.getCoin()); lvStr.setText("Lv." + coinModel.getUserLevel()); - int nextLeve = Integer.parseInt(coinModel.getUserNextLevelRewards()); - int maxLeve = Integer.parseInt(coinModel.getUserLevelMax()) + Integer.parseInt(coinModel.getUserLevelCurrentConsumption()); + findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) && TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE); if (!TextUtils.equals(coinModel.getUserLevel(), coinModel.getUserLevelMax())) { + int nextLeve = Integer.parseInt(coinModel.getUserNextLevelRewards()); + + + BigDecimal maxLeve = new BigDecimal(coinModel.getUserLevelMax()).add( new BigDecimal(coinModel.getUserLevelCurrentConsumption())); try { String leveNext = String.valueOf(nextLeve); String userNextLevel = coinModel.getUserLevelUpgrades(); @@ -488,7 +492,7 @@ public class LiveGiftPopup extends AbsDialogFragment { Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); leaveHint.setText(builder); progressBar.setProgress(nextLeve); - progressBar.setMax(maxLeve); + progressBar.setMax(maxLeve.intValue()); } catch (Exception e) { throw new RuntimeException(e); }