修改MQTT使用方式
修改bug 修改盲盒布局
This commit is contained in:
@@ -159,7 +159,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int screenHeight = displayMetrics.heightPixels;
|
||||
// 设置高度为屏幕高度的100%(全屏)
|
||||
int heightInPx = (int) (screenHeight * 0.9);
|
||||
int heightInPx = (int) (screenHeight * 0.79);
|
||||
;
|
||||
window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, heightInPx);
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent);
|
||||
@@ -304,6 +304,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
int id = view.getId();
|
||||
if (id == R.id.ll_one) {
|
||||
if (!isDrawing) {
|
||||
isDrawing=true;
|
||||
init(1);
|
||||
startType = 1;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "1");
|
||||
@@ -313,14 +314,17 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
}
|
||||
} else if (id == R.id.ll_ten) {
|
||||
if (!isDrawing) {
|
||||
isDrawing=true;
|
||||
init(2);
|
||||
startType = 2;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "10");
|
||||
|
||||
} else {
|
||||
com.hjq.toast.ToastUtils.show("正在抽奖中...");
|
||||
}
|
||||
} else if (id == R.id.ll_hundred) {//抽奖100次
|
||||
if (!isDrawing) {
|
||||
isDrawing=true;
|
||||
init(3);
|
||||
startType = 3;
|
||||
MvpPre.drawGiftList(giftBagId, userIds, roomId, "100");
|
||||
@@ -504,6 +508,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
|
||||
MvpPre.giftSend(blind_box_turntable_id);
|
||||
MvpPre.wallet();
|
||||
isDrawing = false;
|
||||
stopFastAnimate();
|
||||
return;
|
||||
}
|
||||
@@ -524,7 +529,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
}
|
||||
|
||||
public void stopFastAnimate() {
|
||||
isDrawing = false;
|
||||
|
||||
if (handler != null) {
|
||||
// 移除特定的 Runnable(更精确)
|
||||
if (timerRunnable != null) {
|
||||
@@ -719,7 +724,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
playSound("draw.mp3");
|
||||
// 不要设置isDrawing=true,这会影响动画控制
|
||||
MvpPre.wallet();
|
||||
|
||||
isDrawing=false;
|
||||
MvpPre.giftSend(blind_box_turntable_id);
|
||||
}
|
||||
giftCardView.bindGiftData(giftBean);
|
||||
@@ -731,6 +736,7 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
startFastAnimate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user