Merge remote-tracking branch 'origin/master'

This commit is contained in:
zlzw 2023-08-18 14:48:41 +08:00
commit a2f954b28a
2 changed files with 25 additions and 11 deletions

View File

@ -95,7 +95,7 @@
<RelativeLayout <RelativeLayout
android:id="@+id/gift_list" android:id="@+id/gift_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="345dp" android:layout_height="323dp"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
android:orientation="vertical"> android:orientation="vertical">
@ -221,7 +221,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="17dp" android:layout_marginBottom="8dp"
android:paddingStart="16dp"> android:paddingStart="16dp">
<LinearLayout <LinearLayout

View File

@ -86,6 +86,7 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.math.BigDecimal;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
@ -212,17 +213,18 @@ public class LiveGiftPopup extends AbsDialogFragment {
} }
}); });
//连送 //连送
ViewClicksAntiShake.clicksAntiShake(mBtnSendGroup, new ViewClicksAntiShake.ViewClicksCallBack() { mBtnSendGroup.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onViewClicks() { public void onClick(View v) {
sendGift(); sendGiftHandler.post(sendGiftRunnble);
} }
}); });
//送礼 //送礼
ViewClicksAntiShake.clicksAntiShake(liveGiftSend, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(liveGiftSend, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
sendGift(); sendGiftHandler.post(sendGiftRunnble);
} }
}); });
@ -448,11 +450,14 @@ public class LiveGiftPopup extends AbsDialogFragment {
goldText.setText(coinModel.getGold()); goldText.setText(coinModel.getGold());
diamondText.setText(coinModel.getCoin()); diamondText.setText(coinModel.getCoin());
lvStr.setText("Lv." + coinModel.getUserLevel()); 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())) && findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) &&
TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE); TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE);
if (!TextUtils.equals(coinModel.getUserLevel(), coinModel.getUserLevelMax())) { 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 { try {
String leveNext = String.valueOf(nextLeve); String leveNext = String.valueOf(nextLeve);
String userNextLevel = coinModel.getUserLevelUpgrades(); String userNextLevel = coinModel.getUserLevelUpgrades();
@ -487,7 +492,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
leaveHint.setText(builder); leaveHint.setText(builder);
progressBar.setProgress(nextLeve); progressBar.setProgress(nextLeve);
progressBar.setMax(maxLeve); progressBar.setMax(maxLeve.intValue());
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -506,6 +511,14 @@ public class LiveGiftPopup extends AbsDialogFragment {
}); });
} }
private Handler sendGiftHandler = new Handler();
private Runnable sendGiftRunnble = new Runnable() {
@Override
public void run() {
sendGift();
}
};
/** /**
* 赠送礼物 * 赠送礼物
*/ */
@ -641,7 +654,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
namingNameText.append("获取冠名:") namingNameText.append("获取冠名:")
.append(liveGiftModel.getNamingUserCoin()) .append(liveGiftModel.getNamingUserCoin())
.append(""); .append(" ");
} else { } else {
namingNameText.append("Get title: ") namingNameText.append("Get title: ")
.append(liveGiftModel.getNamingUserCoin()) .append(liveGiftModel.getNamingUserCoin())
@ -724,7 +738,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
namingNameText.append("获取冠名:") namingNameText.append("获取冠名:")
.append(liveGiftModel.getNamingUserCoin()) .append(liveGiftModel.getNamingUserCoin())
.append(""); .append(" ");
} else { } else {
namingNameText.append("Get title: ") namingNameText.append("Get title: ")
.append(liveGiftModel.getNamingUserCoin()); .append(liveGiftModel.getNamingUserCoin());