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); }