|
@@ -245,35 +245,20 @@ class GiftDanDaoView : FrameLayout {
|
|
if (imGiftModel.multiple != 0) {
|
|
if (imGiftModel.multiple != 0) {
|
|
when (imGiftModel.multiple) {
|
|
when (imGiftModel.multiple) {
|
|
in 1..99 -> {
|
|
in 1..99 -> {
|
|
- iv.visibility = View.VISIBLE
|
|
|
|
- tvWinPrize2.visibility = View.GONE
|
|
|
|
- svgaWinPrize.visibility = View.GONE
|
|
|
|
- if (aniamtionScale?.isRunning == false){
|
|
|
|
- clPrize.visibility = View.GONE
|
|
|
|
- }
|
|
|
|
- val layoutParams = tvWinPrize.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
- layoutParams.marginStart = DpPxUtil.dip2px(10f)
|
|
|
|
- tvWinPrize.layoutParams = layoutParams
|
|
|
|
- iv.setImageResource(R.mipmap.win_1_50_prize)
|
|
|
|
- clWinPrize.visibility = View.VISIBLE
|
|
|
|
- tvWinPrize.text =
|
|
|
|
- AppContext.getContext().resources.getString(R.string.win_num_prize)
|
|
|
|
- .format(imGiftModel.multiple)
|
|
|
|
|
|
+ ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
|
|
|
|
+ ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
|
|
}
|
|
}
|
|
|
|
|
|
in 100..499 -> {
|
|
in 100..499 -> {
|
|
- iv.visibility = View.GONE
|
|
|
|
ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
|
|
ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
|
|
}
|
|
}
|
|
|
|
|
|
in 500..999 -> {
|
|
in 500..999 -> {
|
|
- iv.visibility = View.GONE
|
|
|
|
ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
|
|
ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_500_999)
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_500_999)
|
|
}
|
|
}
|
|
else -> {
|
|
else -> {
|
|
- iv.visibility = View.GONE
|
|
|
|
UserInfo.getUserInfo()?.let { userInfoModel ->
|
|
UserInfo.getUserInfo()?.let { userInfoModel ->
|
|
if (userInfoModel.id == imGiftModel.senderId && imGiftModel.giftId.toInt() == 202){
|
|
if (userInfoModel.id == imGiftModel.senderId && imGiftModel.giftId.toInt() == 202){
|
|
vibrator?.vibrate(2500)
|
|
vibrator?.vibrate(2500)
|
|
@@ -283,25 +268,8 @@ class GiftDanDaoView : FrameLayout {
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_1000)
|
|
ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_1000)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (iv.visibility == VISIBLE){
|
|
|
|
- clWinPrize.removeCallbacks(winPrizeRunnable)
|
|
|
|
- clWinPrize.postDelayed(winPrizeRunnable, 1500)
|
|
|
|
- } else {
|
|
|
|
- if (giftEnterAnimator.isRunning && handler !=null){
|
|
|
|
- handler.postDelayed({
|
|
|
|
- clPrize.visibility = View.VISIBLE
|
|
|
|
- ivPrizeBg.visibility = View.VISIBLE
|
|
|
|
- clPrize.removeCallbacks(winPrizeRunnable)
|
|
|
|
- clPrize.postDelayed(winPrizeRunnable, 1500)
|
|
|
|
- if (aniamtionRotate?.isRunning ==false){
|
|
|
|
- aniamtionRotate?.start()
|
|
|
|
- }
|
|
|
|
- if (aniamtionScale?.isRunning ==false){
|
|
|
|
- aniamtionScale?.start()
|
|
|
|
- }
|
|
|
|
- loadGiftPrizeNum(imGiftModel.multiple)
|
|
|
|
- },300)
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (giftEnterAnimator.isRunning && handler !=null){
|
|
|
|
+ handler.postDelayed({
|
|
clPrize.visibility = View.VISIBLE
|
|
clPrize.visibility = View.VISIBLE
|
|
ivPrizeBg.visibility = View.VISIBLE
|
|
ivPrizeBg.visibility = View.VISIBLE
|
|
clPrize.removeCallbacks(winPrizeRunnable)
|
|
clPrize.removeCallbacks(winPrizeRunnable)
|
|
@@ -312,12 +280,20 @@ class GiftDanDaoView : FrameLayout {
|
|
if (aniamtionScale?.isRunning ==false){
|
|
if (aniamtionScale?.isRunning ==false){
|
|
aniamtionScale?.start()
|
|
aniamtionScale?.start()
|
|
}
|
|
}
|
|
- loadGiftPrizeNum(imGiftModel.multiple)
|
|
|
|
|
|
+ loadGiftPrizeNum(imGiftModel.multiple) },300)
|
|
|
|
+ } else {
|
|
|
|
+ clPrize.visibility = View.VISIBLE
|
|
|
|
+ ivPrizeBg.visibility = View.VISIBLE
|
|
|
|
+ clPrize.removeCallbacks(winPrizeRunnable)
|
|
|
|
+ clPrize.postDelayed(winPrizeRunnable, 1500)
|
|
|
|
+ if (aniamtionRotate?.isRunning ==false){
|
|
|
|
+ aniamtionRotate?.start()
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if (aniamtionScale?.isRunning ==false){
|
|
|
|
+ aniamtionScale?.start()
|
|
|
|
+ }
|
|
|
|
+ loadGiftPrizeNum(imGiftModel.multiple)
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|