小礼物逻辑第4次上传
This commit is contained in:
parent
8a8a7a8326
commit
59446d2518
@ -12,9 +12,9 @@ import android.view.View;
|
|||||||
public class CircleProgress2 extends View {
|
public class CircleProgress2 extends View {
|
||||||
private Paint mPaint;
|
private Paint mPaint;
|
||||||
private RectF mRectF;
|
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;
|
private float mWidth;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class CircleProgress2 extends View {
|
|||||||
//大圆的半径
|
//大圆的半径
|
||||||
float bigCircleRadius = mWidth / 2;
|
float bigCircleRadius = mWidth / 2;
|
||||||
//小圆的半径
|
//小圆的半径
|
||||||
float smallCircleRadius = bigCircleRadius - mArcWidth;
|
float smallCircleRadius = bigCircleRadius;
|
||||||
//绘制小圆
|
//绘制小圆
|
||||||
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
|
canvas.drawCircle(bigCircleRadius, bigCircleRadius, smallCircleRadius, mPaint);
|
||||||
mPaint.setColor(Color.parseColor("#FEC51B"));
|
mPaint.setColor(Color.parseColor("#FEC51B"));
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
minSdkVersion : 21,
|
minSdkVersion : 21,
|
||||||
targetSdkVersion : 33,
|
targetSdkVersion : 33,
|
||||||
versionCode : 458,
|
versionCode : 458,
|
||||||
versionName : "6.6.2"
|
versionName : "6.6.3"
|
||||||
]
|
]
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
//正式、
|
//正式、
|
||||||
|
@ -332,9 +332,12 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
public void upDataQuickGift(int quickGiftRemainingQuantity, int ifViewingDurationComplete) {
|
public void upDataQuickGift(int quickGiftRemainingQuantity, int ifViewingDurationComplete) {
|
||||||
mQuickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
mQuickGiftRemainingQuantity = quickGiftRemainingQuantity;
|
||||||
mIfViewingDurationComplete = ifViewingDurationComplete;
|
mIfViewingDurationComplete = ifViewingDurationComplete;
|
||||||
quickGiftContDown = 120;
|
if (!(quickGiftContDown > 0 && quickGiftContDown < 120)) {
|
||||||
circleProgress.setMax(120);
|
quickGiftContDown = 120;
|
||||||
circleProgress.setCurrent(quickGiftContDown);
|
circleProgress.setMax(120);
|
||||||
|
circleProgress.setCurrent(quickGiftContDown);
|
||||||
|
}
|
||||||
|
|
||||||
if (quickGiftRemainingQuantity > 0) {
|
if (quickGiftRemainingQuantity > 0) {
|
||||||
quick_gift_remaining_quantity.setVisibility(View.VISIBLE);
|
quick_gift_remaining_quantity.setVisibility(View.VISIBLE);
|
||||||
quick_gift_remaining_quantity.setText(String.valueOf(quickGiftRemainingQuantity));
|
quick_gift_remaining_quantity.setText(String.valueOf(quickGiftRemainingQuantity));
|
||||||
@ -342,7 +345,9 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
quick_gift_remaining_quantity.setVisibility(View.GONE);
|
quick_gift_remaining_quantity.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
if (quickGiftRemainingQuantity < 10 && ifViewingDurationComplete > 0) {
|
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>() {
|
LiveNetManager.get(mContext).viewingDurationGetGift(mLiveUid, new com.yunbao.common.http.base.HttpCallback<QuickGiftSendGiftModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(QuickGiftSendGiftModel data) {
|
public void onSuccess(QuickGiftSendGiftModel data) {
|
||||||
if (data.getQuickGiftRemainingQuantity() < 10 && data.getIfViewingDurationComplete() > 0) {
|
|
||||||
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
|
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -390,6 +396,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
combo.setVisibility(View.GONE);
|
combo.setVisibility(View.GONE);
|
||||||
lianSongHandler.removeCallbacks(lianSongRunnable);
|
lianSongHandler.removeCallbacks(lianSongRunnable);
|
||||||
lianSongHandler.removeCallbacks(lianSongRunnable);
|
lianSongHandler.removeCallbacks(lianSongRunnable);
|
||||||
|
quickGiftHandler.removeCallbacks(quickGiftRunnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean removeRunnable = false;
|
private boolean removeRunnable = false;
|
||||||
@ -415,9 +422,6 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(QuickGiftSendGiftModel data) {
|
public void onSuccess(QuickGiftSendGiftModel data) {
|
||||||
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
|
upDataQuickGift(data.getQuickGiftRemainingQuantity(), data.getIfViewingDurationComplete());
|
||||||
if (mQuickGiftRemainingQuantity < 10 && mIfViewingDurationComplete > 0) {
|
|
||||||
quickGiftHandler.postDelayed(quickGiftRunnable, 1000);
|
|
||||||
}
|
|
||||||
if (data.getIfHiddenEgg() == 3) {
|
if (data.getIfHiddenEgg() == 3) {
|
||||||
ToastUtil.show(WordUtil.isNewZh() ? "恭喜您解鎖隱藏彩蛋! 獎勵已發放!" : "Congratulations on unlocking the hidden easter egg! Rewards have been distributed!");
|
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();
|
super.release();
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
removeCallbacks();
|
removeCallbacks();
|
||||||
|
resetView();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -400,6 +400,7 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/pd_pao"
|
android:id="@+id/pd_pao"
|
||||||
android:layout_width="27dp"
|
android:layout_width="27dp"
|
||||||
|
|
||||||
android:layout_height="27dp"
|
android:layout_height="27dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
Loading…
Reference in New Issue
Block a user