Browse Source

feat: joinChannel log

tongmengxiao 3 months ago
parent
commit
dc94cbdb24

+ 3 - 0
home/src/main/java/com/swago/home/HomeActivity.kt

@@ -39,6 +39,7 @@ import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.GlobalScope
 import kotlinx.coroutines.launch
 import java.io.File
+import java.lang.ref.WeakReference
 
 /**
  *@date 2021/8/17 22:39
@@ -154,7 +155,9 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
             SpUtil.putString("systemCount" , it.unreadTotal.toString())
             unreadMessageVm.setSystemUnreadCount(it.unreadTotal)
         }
+        val weakActivity = WeakReference(this)
         FirebaseMessaging.getInstance().token.addOnCompleteListener {
+            weakActivity.get() ?: return@addOnCompleteListener
             if (it.isSuccessful){
                 homeVm.pushDeviceToken(it.result)
             }

+ 4 - 4
room/src/main/java/com/swago/room/reward/RewardView.kt

@@ -189,7 +189,7 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 duration = "five"
                 nextCoins = model.coin.ten
                 nextTime = 10
-                binding?.tvCoins?.text = "+${model.coin.five}fiv"
+                binding?.tvCoins?.text = "+${model.coin.five}"
                 //领取奖励倒计时
                 if (totalTime >= 300){
                     startGetAnimation()
@@ -203,7 +203,7 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 duration = "ten"
                 nextCoins = model.coin.fifteen
                 nextTime = 15
-                binding?.tvCoins?.text = "+${model.coin.ten}ten"
+                binding?.tvCoins?.text = "+${model.coin.ten}"
 
                 //领取奖励倒计时
                 if (totalTime >= 600){
@@ -218,7 +218,7 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 duration = "fifteen"
                 nextCoins = model.coin.thirty
                 nextTime = 30
-                binding?.tvCoins?.text = "+${model.coin.fifteen}fif"
+                binding?.tvCoins?.text = "+${model.coin.fifteen}"
                 //领取奖励倒计时
                 if (totalTime >= 900){
                     startGetAnimation()
@@ -232,7 +232,7 @@ class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener
                 duration = "thirty"
                 nextCoins = 0
                 nextTime = 0
-                binding?.tvCoins?.text = "+${model.coin.thirty}thi"
+                binding?.tvCoins?.text = "+${model.coin.thirty}"
                 //领取奖励倒计时
                 if (totalTime >= 1800){
                     startGetAnimation()