小礼物逻辑第4次上传

This commit is contained in:
18401019693 2023-11-27 15:40:10 +08:00
parent 8a8a7a8326
commit 59446d2518
4 changed files with 20 additions and 14 deletions

View File

@ -12,9 +12,9 @@ import android.view.View;
public class CircleProgress2 extends View {
private Paint mPaint;
private RectF mRectF;
private int mCurrent = 1, mMax = 100;
private int mCurrent = 10, mMax = 100;
//圆弧也可以说是圆环的宽度
private float mArcWidth =9;
private float mArcWidth =7;
//控件的宽度
private float mWidth;
@ -60,7 +60,7 @@ public class CircleProgress2 extends View {
//大圆的半径
float bigCircleRadius = mWidth / 2;
//小圆的半径
float smallCircleRadius = bigCircleRadius - mArcWidth;
float smallCircleRadius = bigCircleRadius;
//绘制小圆
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
mPaint.setColor(Color.parseColor("#FEC51B"));

View File

@ -5,7 +5,7 @@ ext {
minSdkVersion : 21,
targetSdkVersion : 33,
versionCode : 458,
versionName : "6.6.2"
versionName : "6.6.3"
]
manifestPlaceholders = [
//

View File

@ -332,9 +332,12 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
public void upDataQuickGift(int quickGiftRemainingQuantity, int ifViewingDurationComplete) {
mQuickGiftRemainingQuantity = quickGiftRemainingQuantity;
mIfViewingDurationComplete = ifViewingDurationComplete;
quickGiftContDown = 120;
circleProgress.setMax(120);
circleProgress.setCurrent(quickGiftContDown);
if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) {
quickGiftContDown = 120;
circleProgress.setMax(120);
circleProgress.setCurrent(quickGiftContDown);
}
if (quickGiftRemainingQuantity > 0) {
quick_gift_remaining_quantity.setVisibility(View.VISIBLE);
quick_gift_remaining_quantity.setText(String.valueOf(quickGiftRemainingQuantity));
@ -342,7 +345,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
quick_gift_remaining_quantity.setVisibility(View.GONE);
}
if (quickGiftRemainingQuantity < 10 && ifViewingDurationComplete > 0) {
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) {
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
}
}
}
@ -370,9 +375,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
LiveNetManager.get(mContext).viewingDurationGetGift(mLiveUid, new com.yunbao.common.http.base.HttpCallback<QuickGiftSendGiftModel>() {
@Override
public void onSuccess(QuickGiftSendGiftModel data) {
if (data.getQuickGiftRemainingQuantity() < 10 && data.getIfViewingDurationComplete() > 0) {
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
}
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
}
@Override
@ -390,6 +396,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
combo.setVisibility(View.GONE);
lianSongHandler.removeCallbacks(lianSongRunnable);
lianSongHandler.removeCallbacks(lianSongRunnable);
quickGiftHandler.removeCallbacks(quickGiftRunnable);
}
private boolean removeRunnable = false;
@ -415,9 +422,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
@Override
public void onSuccess(QuickGiftSendGiftModel data) {
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
if (mQuickGiftRemainingQuantity < 10 && mIfViewingDurationComplete > 0) {
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
}
if (data.getIfHiddenEgg() == 3) {
ToastUtil.show(WordUtil.isNewZh() ? "恭喜您解鎖隱藏彩蛋! 獎勵已發放!" : "Congratulations on unlocking the hidden easter egg! Rewards have been distributed!");
}
@ -729,6 +733,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
super.release();
EventBus.getDefault().unregister(this);
removeCallbacks();
resetView();
}
/**

View File

@ -400,6 +400,7 @@
<ImageView
android:id="@+id/pd_pao"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"