12 Commits ae1caa3a70 ... 48ab2497e4

Auteur SHA1 Message Date
  tongmengxiao 48ab2497e4 feat:优化 il y a 3 mois
  tongmengxiao dfbf99f975 feat: 本地化 il y a 3 mois
  tongmengxiao b500d5deb5 feat: 开屏页 il y a 3 mois
  tongmengxiao ec73601ee3 feat: 活动飘条 il y a 3 mois
  tongmengxiao 948e1b6000 feat: 送礼倍数 il y a 3 mois
  tongmengxiao 24fbbe0648 feat: splash il y a 3 mois
  tongmengxiao 71bfabb64c feat: pk优化;2C il y a 3 mois
  tongmengxiao b327079d2d feat: video 清晰度 il y a 3 mois
  tongmengxiao 23c7164d84 feat: update google 支付 il y a 3 mois
  tongmengxiao a52b2a7296 fix: svga il y a 4 mois
  tongmengxiao 96a7744edf feat: 换开麦 闭麦图标 il y a 4 mois
  tongmengxiao 473e28825b feat: 阿里上报 il y a 4 mois
92 fichiers modifiés avec 1177 ajouts et 197 suppressions
  1. 14 1
      .idea/deploymentTargetDropDown.xml
  2. 1 1
      .idea/kotlinc.xml
  3. 8 0
      .idea/misc.xml
  4. 4 1
      app/proguard-rules.pro
  5. 77 5
      app/src/main/java/com/swago/app/SplashActivity.kt
  6. 6 1
      app/src/main/java/com/swago/app/SplashVm.kt
  7. 7 13
      app/src/main/java/com/swago/app/SwagoApp.kt
  8. 17 0
      app/src/main/res/layout/activity_splash.xml
  9. 2 2
      baseswago/build.gradle
  10. 1 1
      baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt
  11. 1 1
      baseswago/src/main/java/com/swago/baseswago/dialog/PayDialog.kt
  12. 38 0
      baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt
  13. 17 0
      baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt
  14. 3 0
      baseswago/src/main/java/com/swago/baseswago/inter/ConfigApi.kt
  15. 2 0
      baseswago/src/main/java/com/swago/baseswago/model/ConfigModel.kt
  16. 8 0
      baseswago/src/main/java/com/swago/baseswago/model/LogProducerModel.kt
  17. 1 0
      baseswago/src/main/java/com/swago/baseswago/model/im/GamePrize.kt
  18. 9 0
      baseswago/src/main/java/com/swago/baseswago/model/im/PiaoTiaoRewardsData.kt
  19. 11 0
      baseswago/src/main/java/com/swago/baseswago/model/live/gift/IMGiftModel.java
  20. 78 0
      baseswago/src/main/java/com/swago/baseswago/util/LogProducer.kt
  21. 34 0
      baseswago/src/main/java/com/swago/glide.kt
  22. 5 0
      baseswago/src/main/res/drawable/shape_66000000_28.xml
  23. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_audioing.png
  24. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_living.png
  25. 12 1
      baseswago/src/main/res/values-ar/strings.xml
  26. 11 0
      baseswago/src/main/res/values-in/strings.xml
  27. 11 0
      baseswago/src/main/res/values-ms/strings.xml
  28. 12 1
      baseswago/src/main/res/values-zh/strings.xml
  29. 11 0
      baseswago/src/main/res/values/strings.xml
  30. 2 2
      build.gradle
  31. 1 1
      home/src/main/java/com/swago/home/HomeActivity.kt
  32. 1 1
      home/src/main/java/com/swago/home/HomeFragment.kt
  33. 1 1
      home/src/main/java/com/swago/home/MessageFragment.kt
  34. 2 2
      home/src/main/res/layout/item_home.xml
  35. 1 1
      login/src/main/java/com/swago/login/FBLogin.kt
  36. 8 8
      login/src/main/java/com/swago/login/LoginActivity.kt
  37. 10 1
      room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt
  38. 1 1
      room/src/main/java/com/swago/room/audio/UserByAnchorInviteDialog.kt
  39. 6 2
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  40. 98 0
      room/src/main/java/com/swago/room/dialog/ClarityVideoDialog.kt
  41. 3 0
      room/src/main/java/com/swago/room/gift/control/SvgPlayerManager.kt
  42. 80 34
      room/src/main/java/com/swago/room/gift/control/XSvgPlayer.kt
  43. 1 0
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoManager.kt
  44. 164 46
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt
  45. 1 1
      room/src/main/java/com/swago/room/lianmai/UserLianMaiDialog.kt
  46. 94 8
      room/src/main/java/com/swago/room/piaotiao/WaftView.kt
  47. 1 1
      room/src/main/java/com/swago/room/pk/PKAudienceAdapter.kt
  48. 4 2
      room/src/main/java/com/swago/room/pk/PKInviteDialog.kt
  49. 11 17
      room/src/main/java/com/swago/room/pk/PKLayoutView.kt
  50. 3 0
      room/src/main/java/com/swago/room/pk/PkVm.kt
  51. 7 0
      room/src/main/java/com/swago/room/user/UserRoomFragment.kt
  52. 39 3
      room/src/main/java/com/swago/room/vm/MsgVm.kt
  53. 2 2
      room/src/main/java/com/swago/room/widget/AnchorFooterView.kt
  54. 44 0
      room/src/main/res/animator/scale.xml
  55. 22 0
      room/src/main/res/animator/scale_rotate.xml
  56. 6 0
      room/src/main/res/drawable/live_clarity_check.xml
  57. 16 0
      room/src/main/res/layout/activity_anchor_room.xml
  58. 2 2
      room/src/main/res/layout/dialog_audio_action.xml
  59. 1 1
      room/src/main/res/layout/dialog_invited_by_anchor_mic.xml
  60. 16 12
      room/src/main/res/layout/fragment_base_com.xml
  61. 3 3
      room/src/main/res/layout/item_pk_seat.xml
  62. 1 1
      room/src/main/res/layout/layout_anchor_footer_view.xml
  63. 3 3
      room/src/main/res/layout/layout_pk_view.xml
  64. 44 4
      room/src/main/res/layout/view_item_gift.xml
  65. 1 1
      room/src/main/res/layout/view_red_envelope.xml
  66. 74 6
      room/src/main/res/layout/view_waft.xml
  67. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_big_prize.png
  68. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_function.png
  69. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_game.png
  70. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_send.png
  71. BIN
      room/src/main/res/mipmap-xxhdpi/gift_bg_prize_1000.png
  72. BIN
      room/src/main/res/mipmap-xxhdpi/gift_bg_prize_100_499.png
  73. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1000.png
  74. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_100_499.png
  75. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1_99.png
  76. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_500_999.png
  77. BIN
      room/src/main/res/mipmap-xxhdpi/ic_clarity_hd.png
  78. BIN
      room/src/main/res/mipmap-xxhdpi/ic_clarity_sd.png
  79. BIN
      room/src/main/res/mipmap-xxhdpi/ic_waft_big_prize.png
  80. BIN
      room/src/main/res/mipmap-xxhdpi/ic_waft_function.png
  81. BIN
      room/src/main/res/mipmap-xxhdpi/ic_waft_game.png
  82. BIN
      room/src/main/res/mipmap-xxhdpi/ic_waft_send.png
  83. BIN
      room/src/main/res/mipmap-xxhdpi/icon_pk_mvp.png
  84. BIN
      room/src/main/res/mipmap-xxhdpi/live_mute.png
  85. 0 0
      room/src/main/res/mipmap-xxhdpi/live_mute_white.webp
  86. BIN
      room/src/main/res/mipmap-xxhdpi/live_unmute.png
  87. 0 0
      room/src/main/res/mipmap-xxhdpi/live_unmute_white.webp
  88. BIN
      room/src/main/res/mipmap-xxhdpi/waft_bg.webp
  89. BIN
      room/src/main/res/mipmap-xxhdpi/waft_big_prize.webp
  90. BIN
      room/src/main/res/mipmap-xxhdpi/waft_game_bg.webp
  91. 1 1
      user/src/main/java/com/swago/user/SettingActivity.kt
  92. 1 1
      user/src/main/java/com/swago/user/recharge/RechargeActivity.kt

+ 14 - 1
.idea/deploymentTargetDropDown.xml

@@ -3,7 +3,20 @@
   <component name="deploymentTargetDropDown">
     <value>
       <entry key="app">
-        <State />
+        <State>
+          <targetSelectedWithDropDown>
+            <Target>
+              <type value="QUICK_BOOT_TARGET" />
+              <deviceKey>
+                <Key>
+                  <type value="VIRTUAL_DEVICE_PATH" />
+                  <value value="$USER_HOME$/.android/avd/Pixel_Fold_API_34.avd" />
+                </Key>
+              </deviceKey>
+            </Target>
+          </targetSelectedWithDropDown>
+          <timeTargetWasSelectedWithDropDown value="2024-07-18T02:04:41.635213Z" />
+        </State>
       </entry>
     </value>
   </component>

+ 1 - 1
.idea/kotlinc.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="KotlinJpsPluginSettings">
-    <option name="version" value="1.7.10" />
+    <option name="version" value="1.9.0" />
   </component>
 </project>

+ 8 - 0
.idea/misc.xml

@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ASMIdeaPluginConfiguration">
     <asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
@@ -313,4 +314,11 @@
   <component name="SuppressionsComponent">
     <option name="suppComments" value="[]" />
   </component>
+  <component name="VisualizationToolProject">
+    <option name="state">
+      <ProjectState>
+        <option name="scale" value="0.67" />
+      </ProjectState>
+    </option>
+  </component>
 </project>

+ 4 - 1
app/proguard-rules.pro

@@ -260,4 +260,7 @@ public static java.lang.String TABLENAME;
 # If you do NOT use SQLCipher:
 -dontwarn net.sqlcipher.database.**
 # If you do NOT use RxJava:
--dontwarn rx.**
+-dontwarn rx.**
+
+-keep class com.aliyun.sls.android.producer.* { *; }
+-keep interface com.aliyun.sls.android.producer.* { *; }

+ 77 - 5
app/src/main/java/com/swago/app/SplashActivity.kt

@@ -3,24 +3,38 @@ package com.swago.app
 import android.Manifest
 import android.os.Build
 import android.os.Bundle
-import android.util.Log
+import android.os.CountDownTimer
+import android.text.TextUtils
+import android.view.View
+import android.widget.ImageView
+import android.widget.TextView
 import android.widget.Toast
 import androidx.activity.viewModels
 import androidx.appcompat.app.AppCompatActivity
 import com.alibaba.android.arouter.launcher.ARouter
-import com.swago.baseswago.constant.ARouteConstant
 import com.permissionx.guolindev.PermissionX
+import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.constant.UrlConstant
+import com.swago.baseswago.model.ConfigModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.FileUtil
-import com.swago.baseswago.util.MD5Util
+import com.swago.baseswago.util.NoDoubleClickListener
 import com.swago.baseswago.util.SpUtil
+import com.swago.loadNoPlaceUrl
 import java.io.File
 
+
 class SplashActivity : AppCompatActivity() {
 
     private val splashVm by viewModels<SplashVm>()
 
+    private var mSplashImage:ImageView ?= null
+    private var mSplashTime:TextView ?= null
+    private lateinit var countDownTimer: CountDownTimer
+    private val totalTimeInMillis: Long = 4000
+    private var configModel:ConfigModel ?= null
+    private var isRunning = false
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_splash)
@@ -41,7 +55,7 @@ class SplashActivity : AppCompatActivity() {
                     } else {
                         Toast.makeText(
                             this@SplashActivity,
-                            "These permissions are denied: $deniedList",
+                            getString(com.swago.login.R.string.these_permissions_denied)+" $deniedList",
                             Toast.LENGTH_LONG
                         ).show()
                         ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
@@ -66,7 +80,7 @@ class SplashActivity : AppCompatActivity() {
                     } else {
                         Toast.makeText(
                             this@SplashActivity,
-                            "These permissions are denied: $deniedList",
+                            getString(com.swago.login.R.string.these_permissions_denied)+" $deniedList",
                             Toast.LENGTH_LONG
                         ).show()
                         ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
@@ -81,6 +95,64 @@ class SplashActivity : AppCompatActivity() {
             val t = UrlConstant.appGameRootPath + File.separator + 8
             FileUtil.upZipFile(UrlConstant.appGameRootPath + File.separator + 8 + File.separator + "com-swago-magical-piggy.zip" , t + File.separator)
         }
+        setSplashImage()
+    }
+
+    private fun setSplashImage() {
+        mSplashImage = findViewById(R.id.iv_splash)
+        mSplashTime = findViewById(R.id.skip_time)
+        countDownTimer = object : CountDownTimer(totalTimeInMillis, 1000) {
+            override fun onTick(millisUntilFinished: Long) {
+                val secondsRemaining = millisUntilFinished / 1000
+                mSplashTime?.text = "Skip ${secondsRemaining + 1}"
+            }
+
+            override fun onFinish() {
+                isRunning = false
+                splashVm.loginByAuto()
+            }
+        }
+
+        splashVm.jumpToHomeLiveData.observe(this){
+            if (it == null || TextUtils.isEmpty(it.rotation_img_url)){
+                splashVm.loginByAuto()
+            } else {
+                mSplashImage?.loadNoPlaceUrl(this, it.rotation_img_url) { success ->
+                    if (success){
+                        mSplashTime?.visibility = View.VISIBLE
+                        isRunning = true
+                        countDownTimer.start()
+                    } else {
+                        splashVm.loginByAuto()
+                    }
+
+                }
+            }
+        }
+
+        mSplashImage?.setOnClickListener(object :NoDoubleClickListener() {
+            override fun onClick() {
+                configModel?.rotation_url?.let {
+                    ARouter.getInstance().build(ARouteConstant.Base.webView)
+                        .withString("url", it)
+                        .navigation()
+                }
+            }
+        })
+
+        mSplashTime?.setOnClickListener(object :NoDoubleClickListener(){
+            override fun onClick() {
+                countDownTimer.cancel()
+                if (isRunning){
+                    isRunning = false
+                    splashVm.loginByAuto()
+                }
+            }
+        })
+    }
 
+    override fun onDestroy() {
+        super.onDestroy()
+        countDownTimer.cancel()
     }
 }

+ 6 - 1
app/src/main/java/com/swago/app/SplashVm.kt

@@ -12,6 +12,7 @@ import com.swago.baseswago.constant.ARouteConstant
 import com.swago.baseswago.constant.UrlConstant
 import com.swago.baseswago.http.RetrofitManager
 import com.swago.baseswago.inter.ApiManager
+import com.swago.baseswago.model.ConfigModel
 import com.swago.baseswago.model.DomainConfig
 import com.swago.baseswago.util.*
 import org.jsoup.Jsoup
@@ -31,6 +32,10 @@ class SplashVm(application: Application) : BaseViewModel(application) {
         MutableLiveData<Boolean>()
     }
 
+    val jumpToHomeLiveData by lazy {
+        MutableLiveData<ConfigModel>()
+    }
+
     var retry = 0
 
     private val executorService by lazy {
@@ -64,7 +69,7 @@ class SplashVm(application: Application) : BaseViewModel(application) {
                 if (UserInfo.getLoginModel() == null) {
                     jumpToLoginLiveData.value = false
                 } else {
-                    loginByAuto()
+                    jumpToHomeLiveData.value = data
                 }
             }
 

+ 7 - 13
app/src/main/java/com/swago/app/SwagoApp.kt

@@ -15,6 +15,7 @@ import com.swago.baseswago.dialog.ForceOfflineDialog
 import com.swago.baseswago.inter.ApiManager
 import com.swago.baseswago.util.ActivityManagerUtil
 import com.swago.baseswago.util.AppContext
+import com.swago.baseswago.util.LogProducer
 import com.swago.baseswago.util.LogUtil
 import com.swago.baseswago.util.SwagoInfo
 import com.swago.baseswago.util.UserInfo
@@ -87,6 +88,7 @@ class SwagoApp : Application() {
                 LogUtil.d("成功--$code---$msg")
             }
         })
+        pushCrash()
     }
 
     override fun attachBaseContext(base: Context?) {
@@ -96,19 +98,11 @@ class SwagoApp : Application() {
 
     private fun pushCrash() {
         Thread.setDefaultUncaughtExceptionHandler { t, ex ->
-            runBlocking {
-                val jsonObject = JSONObject()
-                UserInfo.getUserInfo()?.let {
-                    jsonObject.put("id" , it.id)
-                }
-                jsonObject.put("version", SwagoInfo.getVersionCode())
-                jsonObject.put("device" , SwagoInfo.getDeviceInfo())
-                jsonObject.put("message","${ex.message}")
-                jsonObject.put("detail", ex.stackTraceToString())
-                if (!BuildConfig.DEBUG){
-                    ApiManager.configApi.pushCrash(jsonObject.toString())
-                }
-
+            val jsonObject = JSONObject()
+            jsonObject.put("message","${ex.message}")
+            jsonObject.put("detail", ex.stackTraceToString())
+            if (!BuildConfig.DEBUG){
+                LogProducer.addLog(jsonObject, "error")
             }
         }
     }

+ 17 - 0
app/src/main/res/layout/activity_splash.xml

@@ -3,10 +3,27 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     tools:context=".SplashActivity">
 
     <ImageView
+        android:id="@+id/iv_splash"
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>
 
+    <TextView
+        android:id="@+id/skip_time"
+        android:layout_width="60dp"
+        android:layout_height="23dp"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:textColor="@color/_ffffff"
+        android:textSize="@dimen/sp_14"
+        android:text="Skip"
+        android:gravity="center"
+        android:layout_marginEnd="16dp"
+        android:layout_marginTop="37dp"
+        android:visibility="gone"
+        android:background="@drawable/shape_66000000_28"/>
+
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 2
baseswago/build.gradle

@@ -108,7 +108,7 @@ dependencies {
     //agora
     api "io.agora.rtc:full-rtc-basic:3.7.0.2"
     //支付
-    api 'com.android.billingclient:billing-ktx:5.2.0'
+    api 'com.android.billingclient:billing-ktx:7.0.0'
     //抓包
     debugImplementation "com.github.chuckerteam.chucker:library:3.5.2"
     releaseImplementation "com.github.chuckerteam.chucker:library-no-op:3.5.2"
@@ -136,5 +136,5 @@ dependencies {
     //lottie
     api 'com.airbnb.android:lottie:4.0.0'
     api  'org.greenrobot:greendao:3.3.0' // 添加库
-
+    implementation 'io.github.aliyun-sls:aliyun-log-android-sdk:2.7.0@aar'
 }

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt

@@ -134,7 +134,7 @@ class PersonDataDFragment : BaseXDFragment<DialogPersonDataBinding>() {
                                 } else {
                                     Toast.makeText(
                                         AppContext.getContext(),
-                                        "These permissions are denied: $deniedList",
+                                        AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }

+ 1 - 1
baseswago/src/main/java/com/swago/baseswago/dialog/PayDialog.kt

@@ -143,7 +143,7 @@ class PayDialog : BaseXDFragment<DialogPayBinding>(), IPayCallback{
     override fun onUnConsumeOrder(data: List<Purchase>) {
         lifecycleScope.launch(Dispatchers.Main) {
             data.forEach {
-                val orderLostDialog = OrderLostDialog.newInstance(it.orderId)
+                val orderLostDialog = OrderLostDialog.newInstance(it.orderId?:"")
                 orderLostDialog.commitLostOrderFun = {
                     payVm.payOrderToServer(it, 4)
                 }

+ 38 - 0
baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt

@@ -10,6 +10,8 @@ import com.swago.baseswago.im.ImConstant.beauty_game_grab_host
 import com.swago.baseswago.im.ImConstant.beauty_game_grab_host_two
 import com.swago.baseswago.im.ImConstant.beauty_game_host
 import com.swago.baseswago.im.ImConstant.bind_anchor
+import com.swago.baseswago.im.ImConstant.break_egg_rewards
+import com.swago.baseswago.im.ImConstant.break_egg_sum
 import com.swago.baseswago.im.ImConstant.cancel_forbid_speak
 import com.swago.baseswago.im.ImConstant.change_user_name
 import com.swago.baseswago.im.ImConstant.close_account
@@ -21,6 +23,7 @@ import com.swago.baseswago.im.ImConstant.follow_anchor_success
 import com.swago.baseswago.im.ImConstant.forbid_speak
 import com.swago.baseswago.im.ImConstant.force_close_live_room
 import com.swago.baseswago.im.ImConstant.fruit_game
+import com.swago.baseswago.im.ImConstant.game_key_rewards
 import com.swago.baseswago.im.ImConstant.game_win_big_prize
 import com.swago.baseswago.im.ImConstant.house_open_live
 import com.swago.baseswago.im.ImConstant.invite_user_on_mic
@@ -49,6 +52,7 @@ import com.swago.baseswago.im.ImConstant.room_dan_mu
 import com.swago.baseswago.im.ImConstant.send_wish_gift
 import com.swago.baseswago.im.ImConstant.set_room_admin
 import com.swago.baseswago.im.ImConstant.svg_gift
+import com.swago.baseswago.im.ImConstant.today_star_rewards
 import com.swago.baseswago.im.ImConstant.update_audience
 import com.swago.baseswago.im.ImConstant.update_mic_list_data
 import com.swago.baseswago.im.ImConstant.user_agree_invite_by_anchor
@@ -68,6 +72,7 @@ import com.swago.baseswago.model.live.audio.*
 import com.swago.baseswago.model.live.gift.IMGiftModel
 import com.swago.baseswago.model.live.mic.LianMaiIMModel
 import com.swago.baseswago.model.live.pk.*
+import com.swago.baseswago.util.LogProducer
 import com.swago.baseswago.util.LogUtil
 import com.tencent.imsdk.v2.V2TIMMessage
 import org.json.JSONObject
@@ -98,6 +103,7 @@ class GroupMsgParser : IGroupNewMsgParser {
         try {
             val resultString = String(result)
             val jsonObject = JSONObject(resultString)
+            LogProducer.addLog(jsonObject, "imCallback")
             LogUtil.d("SwagoIM",resultString)
             var parameterizedTypeImpl: ParameterizedTypeImpl? = null
             when(jsonObject.getInt("type")){
@@ -375,6 +381,38 @@ class GroupMsgParser : IGroupNewMsgParser {
                     )
                     parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
                 }
+                today_star_rewards -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(PiaoTiaoRewardsData::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
+                game_key_rewards -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(PiaoTiaoRewardsData::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
+                break_egg_rewards -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(PiaoTiaoRewardsData::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
+                break_egg_sum -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(PiaoTiaoRewardsData::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
 
             }
             parserModel?.v2TIMMessage = v2TIMMessage

+ 17 - 0
baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt

@@ -246,6 +246,23 @@ object ImConstant {
      * 主播开播
      * */
     const val house_open_live = 504
+    /**
+     * 今日之星奖励发放
+     * */
+    const val today_star_rewards = 505
+    /**
+     * 游戏之王奖励发放
+     * */
+    const val game_key_rewards = 506
+    /**
+     * 砸金蛋中奖发放
+     * */
+    const val break_egg_rewards = 507
+    /**
+     * 砸金蛋奖池金额
+     * */
+    const val break_egg_sum = 508
+
 
     /**********游戏相关IM********/
     const val fruit_game = 1001

+ 3 - 0
baseswago/src/main/java/com/swago/baseswago/inter/ConfigApi.kt

@@ -2,6 +2,7 @@ package com.swago.baseswago.inter
 
 import com.swago.baseswago.model.ConfigModel
 import com.swago.baseswago.model.DomainConfig
+import com.swago.baseswago.model.LogProducerModel
 import retrofit2.http.Field
 import retrofit2.http.FormUrlEncoded
 import retrofit2.http.GET
@@ -31,4 +32,6 @@ interface ConfigApi {
     @POST("android/error/push")
     suspend fun pushCrash(@Field("message") message:String):Any
 
+    @POST("/upload/log/token")
+    suspend fun getLogToken(): LogProducerModel
 }

+ 2 - 0
baseswago/src/main/java/com/swago/baseswago/model/ConfigModel.kt

@@ -12,6 +12,8 @@ data class ConfigModel(
     val im_app_id:Int,
     var language_lables: List<Label>?,
     var special_zip_url:String = "",
+    var rotation_img_url:String = "",
+    var rotation_url:String = "",
 
     //版本更新
     val app_version:Int,

+ 8 - 0
baseswago/src/main/java/com/swago/baseswago/model/LogProducerModel.kt

@@ -0,0 +1,8 @@
+package com.swago.baseswago.model
+
+data class LogProducerModel (
+    val access_key_id:String="",
+    val access_key_secret:String="",
+    val security_token:String="",
+    val expiration:Long
+)

+ 1 - 0
baseswago/src/main/java/com/swago/baseswago/model/im/GamePrize.kt

@@ -5,4 +5,5 @@ class GamePrize:IPiaoTiao{
     val senderId:String=""
     val gameName:String=""
     val coin:String=""
+    val headSpecial:String=""
 }

+ 9 - 0
baseswago/src/main/java/com/swago/baseswago/model/im/PiaoTiaoRewardsData.kt

@@ -0,0 +1,9 @@
+package com.swago.baseswago.model.im
+
+ class PiaoTiaoRewardsData :IPiaoTiao {
+    var type:Int = 0
+    val userName: String = ""
+    val sort: String = ""
+    val winCoin: String = ""
+    val actCoin: String = ""
+}

+ 11 - 0
baseswago/src/main/java/com/swago/baseswago/model/live/gift/IMGiftModel.java

@@ -1,5 +1,7 @@
 package com.swago.baseswago.model.live.gift;
 
+import android.text.TextUtils;
+
 import com.swago.baseswago.model.im.IPiaoTiao;
 
 /**
@@ -53,6 +55,7 @@ public class IMGiftModel implements IPiaoTiao {
     private String giftEnName = "";
 
     private String giftIdName = "";
+    private String headSpecial = "";
 
     private String userWealthJingyanValue;
 
@@ -259,4 +262,12 @@ public class IMGiftModel implements IPiaoTiao {
     public void setAndroidHeadSpecial(String androidHeadSpecial) {
         this.androidHeadSpecial = androidHeadSpecial;
     }
+
+    public String getHeadSpecial() {
+        return TextUtils.isEmpty(headSpecial) ? androidHeadSpecial : headSpecial;
+    }
+
+    public void setHeadSpecial(String headSpecial) {
+        this.headSpecial = headSpecial;
+    }
 }

+ 78 - 0
baseswago/src/main/java/com/swago/baseswago/util/LogProducer.kt

@@ -0,0 +1,78 @@
+package com.swago.baseswago.util
+
+import com.aliyun.sls.android.producer.Log
+import com.aliyun.sls.android.producer.LogProducerClient
+import com.aliyun.sls.android.producer.LogProducerConfig
+import com.aliyun.sls.android.producer.LogProducerException
+import com.aliyun.sls.android.producer.LogProducerResult
+import com.swago.baseswago.inter.ApiManager
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import org.json.JSONObject
+import java.text.SimpleDateFormat
+import java.util.Date
+
+
+object LogProducer {
+    private var config: LogProducerConfig? = null
+    private var client: LogProducerClient? = null
+
+    init {
+        initProducer()
+    }
+
+    private fun initProducer() {
+        try {
+            config = LogProducerConfig()
+            config?.endpoint = "cn-hongkong.log.aliyuncs.com"
+            config?.project = "yunwei-swago"
+            config?.logstore = "app"
+            client = LogProducerClient(config
+            ) { resultCode, reqId, errorMessage, logBytes, compressedBytes ->
+                val result = LogProducerResult.fromInt(resultCode)
+                if (LogProducerResult.LOG_PRODUCER_SEND_UNAUTHORIZED == result || LogProducerResult.LOG_PRODUCER_PARAMETERS_INVALID == result) {
+                    // 需要更新AccessKey或者SDK的初始化参数。
+                    requestAccessKey()
+                }
+            }
+        } catch (e: LogProducerException) {
+            e.printStackTrace()
+        }
+    }
+
+    private fun requestAccessKey() {
+        CoroutineScope(Dispatchers.Default).launch {
+            val model = ApiManager.configApi.getLogToken()
+            updateAccessKey(model.access_key_id,model.access_key_secret,model.security_token)
+        }
+    }
+
+    private fun updateAccessKey(accessKeyId:String,accessKeySecret:String,securityToken:String?){
+        if (!securityToken.isNullOrEmpty()){
+            config?.resetSecurityToken(accessKeyId,accessKeySecret,securityToken)
+        } else {
+            config?.setAccessKeyId(accessKeyId)
+            config?.setAccessKeySecret(accessKeySecret)
+        }
+    }
+    fun addLog(customLog:JSONObject,type:String){
+        if (null == client) {
+            return
+        }
+        val log = Log()
+        val jsonObject =JSONObject()
+        val jsonContentsObject =JSONObject()
+        jsonContentsObject.put("type", type)
+        jsonContentsObject.put("device_info", SwagoInfo.getDeviceInfo())
+        jsonContentsObject.put("device_system", "android")
+        jsonContentsObject.put("app_channel", SwagoInfo.getChannel())
+        jsonContentsObject.put("app_version",SwagoInfo.getVersionCode())
+        jsonContentsObject.put("user_id", UserInfo.getUserInfo()?.id)
+        jsonContentsObject.put("custom_log", customLog)
+        jsonObject.put("time", System.currentTimeMillis())
+        jsonObject.put("contents",jsonContentsObject)
+        log.putContent(jsonObject)
+        client?.addLog(log)
+    }
+}

+ 34 - 0
baseswago/src/main/java/com/swago/glide.kt

@@ -14,9 +14,13 @@ import android.widget.ImageView
 import androidx.annotation.DrawableRes
 import androidx.annotation.RequiresApi
 import com.bumptech.glide.Glide
+import com.bumptech.glide.load.DataSource
 import com.bumptech.glide.load.engine.DiskCacheStrategy
+import com.bumptech.glide.load.engine.GlideException
+import com.bumptech.glide.request.RequestListener
 import com.bumptech.glide.request.RequestOptions
 import com.bumptech.glide.request.target.CustomTarget
+import com.bumptech.glide.request.target.Target
 import com.bumptech.glide.request.transition.Transition
 import com.swago.baseswago.R
 import jp.wasabeef.glide.transformations.BlurTransformation
@@ -48,6 +52,36 @@ fun ImageView.loadUrl(context: Context,url:String){
         .into(this)
 }
 
+fun ImageView.loadNoPlaceUrl(context: Context,url:String,call: (success:Boolean) -> Unit){
+    Glide.with(context)
+        .load(url)
+        .centerCrop()
+        .listener(object :RequestListener<Drawable>{
+            override fun onLoadFailed(
+                e: GlideException?,
+                model: Any?,
+                target: Target<Drawable>?,
+                isFirstResource: Boolean
+            ): Boolean {
+                call.invoke(false)
+                return false
+            }
+
+            override fun onResourceReady(
+                resource: Drawable?,
+                model: Any?,
+                target: Target<Drawable>?,
+                dataSource: DataSource?,
+                isFirstResource: Boolean
+            ): Boolean {
+                call.invoke(true)
+                return false
+            }
+
+        })
+        .into(this)
+}
+
 fun ImageView.loadUrlCache(context: Context,url:String){
     Glide.with(context)
         .load(url)

+ 5 - 0
baseswago/src/main/res/drawable/shape_66000000_28.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#66000000"/>
+    <corners android:radius="28dp"/>
+</shape>

BIN
baseswago/src/main/res/mipmap-xxhdpi/icon_audioing.png


BIN
baseswago/src/main/res/mipmap-xxhdpi/icon_living.png


+ 12 - 1
baseswago/src/main/res/values-ar/strings.xml

@@ -351,5 +351,16 @@
     <string name="no_time_limit">لا يوجد حد زمني</string>
     <string name="already_owned">مملوكة</string>
     <string name="using">استخدام</string>
-    <string name="local_music">Local Music</string>
+    <string name="local_music">موسيقى محلية</string>
+    <string name="congratulations_to_for_start_of_today">تهانينا لـ %s على حصولهم على NO.%s  في STAR OF TODAY</string>
+    <string name="congratulations_to_for_king_of_game">تهانينا لـ %s على حصولهم على NO.%s في KING OF GAME</string>
+    <string name="so_lucky_golden_egg">محظوظ جدا أنت! تهانينا لـ %s للحصول على %s عملة معدنية في حدث Golden Egg Smashing.</string>
+    <string name="prize_pool_golden_egg">لقد وصل مجموع جوائز Golden Egg Smashing إلى %s، سارع الجميع للمشاركة.</string>
+    <string name="hd">HD</string>
+    <string name="sd">SD</string>
+    <string name="login_cancel">إلغاء تسجيل الدخول</string>
+    <string name="these_permissions_denied">تم رفض هذه الأذونات:</string>
+    <string name="login_fail">فشل تسجيل الدخول</string>
+    <string name="user_refused_invitation">رفض المستخدم دعوتك</string>
+    <string name="user_agreed_invitation">وافق المستخدم على دعوتك</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values-in/strings.xml

@@ -364,4 +364,15 @@
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</string>
     <string name="local_music">Local Music</string>
+    <string name="congratulations_to_for_start_of_today">Selamat kepada %s yang telah menjadi NO.%s di STAR OF TODAY</string>
+    <string name="congratulations_to_for_king_of_game">Selamat kepada %s yang telah menjadi NO.%s di KING OF GAME</string>
+    <string name="so_lucky_golden_egg">Beruntung sekali! Selamat kepada %s telah mendapatkan bonus %s koin  di Event Golden Egg.</string>
+    <string name="prize_pool_golden_egg">Jumlah jackpot sudah tercapai %s dalam Event Golden Egg.Ayo,berpartisipasi event ini dan menangkan bonus besar.</string>
+    <string name="hd">HD</string>
+    <string name="sd">SD</string>
+    <string name="login_cancel">Batalkan masuk</string>
+    <string name="these_permissions_denied">Izin ditolak</string>
+    <string name="login_fail">Gagal masuk</string>
+    <string name="user_refused_invitation">Pengguna menolak undangan Anda</string>
+    <string name="user_agreed_invitation">Pengguna menyetujui undangan Anda</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values-ms/strings.xml

@@ -364,4 +364,15 @@
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</string>
     <string name="local_music">Local Music</string>
+    <string name="congratulations_to_for_start_of_today">Tahniah kepada %s kerana menjadi NO.%s di STAR OF TODAY</string>
+    <string name="congratulations_to_for_king_of_game">Tahniah kepada %s kerana menjadi NO.%s dalam KING OF GAME</string>
+    <string name="so_lucky_golden_egg">Sangat bertuah! Tahniah kepada %s kerana mendapat bonus syiling %s di Acara Telur Emas.</string>
+    <string name="prize_pool_golden_egg">Jumlah jackpot sudah tercapai %s dalam Event Golden Egg.Ayo,berpartisipasi event ini dan menangkan bonus besar.</string>
+    <string name="hd">HD</string>
+    <string name="sd">SD</string>
+    <string name="login_cancel">Batalkan log masuk</string>
+    <string name="these_permissions_denied">Kebenaran ditolak</string>
+    <string name="login_fail">Daftar masuk gagal</string>
+    <string name="user_refused_invitation">Pengguna menolak jemputan anda</string>
+    <string name="user_agreed_invitation">Pengguna menerima jemputan anda</string>
 </resources>

+ 12 - 1
baseswago/src/main/res/values-zh/strings.xml

@@ -140,7 +140,7 @@
     <string name="share_to">分享至</string>
     <string name="app_not_install">应用未安装</string>
     <string name="follow_anchor">刚刚关注了主播,再也不用担心错过直播啦~</string>
-    <string name="big_prize">真是幸运!%s送出%s赢得了%s倍奖励,恭喜他!</string>
+    <string name="big_prize">真是幸运!%s送出%s赢得了%s倍\n奖励,恭喜他!</string>
     <string name="update_now">立即更新</string>
 
     <string name="special">特殊</string>
@@ -352,4 +352,15 @@
     <string name="already_owned">已拥有</string>
     <string name="using">使用中</string>
     <string name="local_music">本地音乐</string>
+    <string name="congratulations_to_for_start_of_today">恭喜%s成为本场今日之星活动第%s名</string>
+    <string name="congratulations_to_for_king_of_game">恭喜%s成为本场游戏之王活动第%s名</string>
+    <string name="so_lucky_golden_egg">太幸运啦,恭喜%s在砸金蛋活动中得到%s金币奖励</string>
+    <string name="prize_pool_golden_egg">砸金蛋活动奖池已经达到%s,大家快去参与呀</string>
+    <string name="hd">HD</string>
+    <string name="sd">SD</string>
+    <string name="login_cancel">取消登录</string>
+    <string name="these_permissions_denied">权限被拒绝</string>
+    <string name="login_fail">登录失败</string>
+    <string name="user_refused_invitation">用户拒绝了你的邀请</string>
+    <string name="user_agreed_invitation">用户同意了你的邀请</string>
 </resources>

+ 11 - 0
baseswago/src/main/res/values/strings.xml

@@ -384,4 +384,15 @@
     <string name="already_owned">owned</string>
     <string name="using">using</string>
     <string name="local_music">Local Music</string>
+    <string name="congratulations_to_for_start_of_today">Congratulations to %s for becoming the NO.%s in STAR OF TODAY</string>
+    <string name="congratulations_to_for_king_of_game">Congratulations to %s for becoming the NO.%s in  KING OF GAME</string>
+    <string name="so_lucky_golden_egg">So lucky you are! Congratulations to %s for getting %s coins in the Golden Egg Smashing event.</string>
+    <string name="prize_pool_golden_egg">The prize pool for the Golden Egg Smashing has reached %s, everyone hurry up and participate.</string>
+    <string name="hd">HD</string>
+    <string name="sd">SD</string>
+    <string name="login_cancel">Login cancel</string>
+    <string name="these_permissions_denied">These permissions are denied:</string>
+    <string name="login_fail">login fail</string>
+    <string name="user_refused_invitation">user refused your invitation</string>
+    <string name="user_agreed_invitation">user agreed your invitation</string>
 </resources>

+ 2 - 2
build.gradle

@@ -1,6 +1,6 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 buildscript {
-    ext.kotlin_version = "1.7.10"
+    ext.kotlin_version = "1.9.0"
     repositories {
         google()
         maven {
@@ -19,7 +19,7 @@ buildscript {
     }
     dependencies {
         classpath "com.android.tools.build:gradle:7.2.1"
-        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
+        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'
         classpath 'com.google.gms:google-services:4.3.10'
         classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
         classpath 'com.google.firebase:perf-plugin:1.4.1'

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

@@ -272,7 +272,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
     override fun onUnConsumeOrder(data: List<Purchase>) {
         lifecycleScope.launch(Dispatchers.Main) {
             data.forEach {
-                val orderLostDialog = OrderLostDialog.newInstance(it.orderId)
+                val orderLostDialog = OrderLostDialog.newInstance(it.orderId?:"")
                 orderLostDialog.commitLostOrderFun = {
                     payVm.payOrderToServer(it, 4)
                 }

+ 1 - 1
home/src/main/java/com/swago/home/HomeFragment.kt

@@ -127,7 +127,7 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
                             binding.ivLive.isEnabled = true
                             Toast.makeText(
                                 AppContext.getContext(),
-                                "These permissions are denied: $deniedList",
+                                AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                 Toast.LENGTH_LONG
                             ).show()
                         }

+ 1 - 1
home/src/main/java/com/swago/home/MessageFragment.kt

@@ -49,7 +49,7 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
                     } else {
                         Toast.makeText(
                             AppContext.getContext(),
-                            "These permissions are denied: $deniedList",
+                            AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                             Toast.LENGTH_LONG
                         ).show()
                     }

+ 2 - 2
home/src/main/res/layout/item_home.xml

@@ -18,7 +18,7 @@
         android:layout_marginEnd="8dp"
         android:layout_marginTop="8dp"
         app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
         android:layout_width="18dp"
         android:layout_height="18dp"/>
 
@@ -29,7 +29,7 @@
         android:layout_marginTop="8dp"
         android:layout_marginStart="8dp"
         app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
         android:src="@mipmap/ic_live_lock"
         android:visibility="gone"/>
 

+ 1 - 1
login/src/main/java/com/swago/login/FBLogin.kt

@@ -20,7 +20,7 @@ object FBLogin {
             .registerCallback(manager, object : FacebookCallback<LoginResult> {
 
                 override fun onCancel() {
-                    Toast.makeText(AppContext.getContext(), "Login Cancel", Toast.LENGTH_SHORT)
+                    Toast.makeText(AppContext.getContext(), AppContext.getContext().getString(R.string.login_cancel), Toast.LENGTH_SHORT)
                         .show()
                 }
 

+ 8 - 8
login/src/main/java/com/swago/login/LoginActivity.kt

@@ -70,7 +70,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     FBLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        getString(R.string.these_permissions_denied)+ "$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -87,7 +87,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     FBLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        getString(R.string.these_permissions_denied)+ "$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -114,7 +114,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     GoogleLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        getString(R.string.these_permissions_denied)+"$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -131,7 +131,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     GoogleLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        getString(R.string.these_permissions_denied)+"$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -201,7 +201,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                 loginVm.loginByAccount(account, secret)
                                 Toast.makeText(
                                     this@LoginActivity,
-                                    "These permissions are denied: $deniedList",
+                                    getString(R.string.these_permissions_denied)+" $deniedList",
                                     Toast.LENGTH_LONG
                                 ).show()
                             }
@@ -224,7 +224,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                 loginVm.loginByAccount(account, secret)
                                 Toast.makeText(
                                     this@LoginActivity,
-                                    "These permissions are denied: $deniedList",
+                                    getString(R.string.these_permissions_denied)+" $deniedList",
                                     Toast.LENGTH_LONG
                                 ).show()
                             }
@@ -255,7 +255,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                         GoogleSignInStatusCodes.SIGN_IN_FAILED -> {
                             Toast.makeText(
                                 AppContext.getContext(),
-                                "login fail-${e.statusCode}",
+                                AppContext.getContext().getString(R.string.login_fail)+"-${e.statusCode}",
                                 Toast.LENGTH_SHORT
                             ).show()
                         }
@@ -263,7 +263,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                         CommonStatusCodes.CANCELED -> {
                             Toast.makeText(
                                 AppContext.getContext(),
-                                "login cancel-${e.statusCode}",
+                                AppContext.getContext().getString(R.string.login_cancel)+"-${e.statusCode}",
                                 Toast.LENGTH_SHORT
                             ).show()
                         }

+ 10 - 1
room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt

@@ -68,6 +68,7 @@ import io.agora.capture.video.camera.Constant
 import java.util.*
 import com.swago.room.wishgift.SetWishGiftsDialog
 import io.agora.rtc.IRtcEngineEventHandler
+import io.agora.rtc.video.VideoEncoderConfiguration
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 
@@ -282,7 +283,7 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
                                 binding.tvStartLive.isEnabled = true
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    "These permissions are denied: $deniedList",
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                     Toast.LENGTH_LONG
                                 ).show()
                             }
@@ -402,6 +403,14 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
             binding.cbPassword.text = if (isChecked)  getString(R.string.lock_room_on) else getString(R.string.lock_room_off)
             checkPassword = isChecked
         }
+        binding.cbClarity.setOnCheckedChangeListener { _, isChecked ->
+            binding.cbClarity.text = if (isChecked)  getString(R.string.hd) else getString(R.string.sd)
+            if (isChecked){
+                AgoraManager.setVideoConfiguration(VideoEncoderConfiguration.VD_1280x720 ,VideoEncoderConfiguration.FRAME_RATE.FRAME_RATE_FPS_15)
+            } else{
+                AgoraManager.setVideoConfiguration()
+            }
+        }
 
     }
 

+ 1 - 1
room/src/main/java/com/swago/room/audio/UserByAnchorInviteDialog.kt

@@ -89,7 +89,7 @@ class UserByAnchorInviteDialog  : BaseXDFragment<DialogInvitedByAnchorMicBinding
                                 } else {
                                     Toast.makeText(
                                         AppContext.getContext(),
-                                        "These permissions are denied: $deniedList",
+                                        AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }

+ 6 - 2
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -224,7 +224,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
         chatAdapter.setNewData(dataChatList)
         context?.let {
             svgPlayerManager.init(it, binding.xSvgaPlayer, binding.svgDanDaoView)
-            joinAnimalManager.init(it, binding.xSvgaPlayer)
+            joinAnimalManager.init(it, binding.xJoinSvgaPlayer)
         }
 
         activity?.let {
@@ -294,7 +294,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
                                                 } else {
                                                     Toast.makeText(
                                                         AppContext.getContext(),
-                                                        "These permissions are denied: $deniedList",
+                                                        AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                                         Toast.LENGTH_LONG
                                                     ).show()
                                                 }
@@ -668,6 +668,10 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
                 }
             }.show(childFragmentManager, "RedEnvelopResultDialog")
         }
+        pkVm.pkState = { pkState ->
+            binding.bannerView.visibility = if (pkState) View.INVISIBLE else View.VISIBLE
+            binding.videoPlayBannerView.visibility = if (pkState) View.INVISIBLE else View.VISIBLE
+        }
     }
 
     fun openShareDialog() {

+ 98 - 0
room/src/main/java/com/swago/room/dialog/ClarityVideoDialog.kt

@@ -0,0 +1,98 @@
+package com.swago.room.dialog
+
+import android.annotation.SuppressLint
+import android.os.Bundle
+import android.view.Gravity
+import android.view.View
+import com.bumptech.glide.Glide
+import com.swago.baseswago.baseroom.SwagoRoomManager
+import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.model.live.AnchorClosedModel
+import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.baseswago.util.TimeUtil
+import com.swago.room.R
+import com.swago.room.databinding.DialogAnchorCloseBinding
+import com.swago.room.enum.RoomType
+
+/**
+ *@date 2021/11/28 21:13
+ *description:
+ */
+class ClarityVideoDialog : BaseXDFragment<DialogAnchorCloseBinding>(){
+
+    private var anchorCloseModel:AnchorClosedModel? = null
+    private var roomType:Int = 1
+
+    companion object{
+        fun newInstance(anchorCloseModel:AnchorClosedModel ,roomType: Int , checkPassword: Boolean):ClarityVideoDialog{
+            val dialog = ClarityVideoDialog()
+            val bundle = Bundle()
+            bundle.putParcelable("model",anchorCloseModel)
+            bundle.putInt("roomType",roomType)
+            bundle.putBoolean("checkPassword",checkPassword)
+            dialog.arguments = bundle
+            return dialog
+        }
+    }
+
+
+    @SuppressLint("MissingSuperCall")
+    override fun onActivityCreated(savedInstanceState: Bundle?) {
+        super.onActivityCreated(savedInstanceState)
+        setDimAmount(0f)
+        setHeightMatchParent()
+        setGravity(Gravity.BOTTOM)
+    }
+
+
+    override fun initOther() {
+        arguments?.let {
+            anchorCloseModel =  it.getParcelable("model")
+            roomType = it.getInt("roomType")
+            val checkPassword = it.getBoolean("checkPassword")
+            if (checkPassword){
+                binding.tvPassword.visibility = View.VISIBLE
+            } else {
+                binding.tvPassword.visibility = View.GONE
+            }
+            if (roomType == RoomType.VIDEO.type){
+                binding.tvIncome.text = getString(R.string.income_of_this_live)
+                binding.tvTime.text = getString(R.string.duration_of_this_live)
+                binding.tvTotalTime.text = getString(R.string.today_video_duration)
+                binding.tvWeekTime.text = getString(R.string.total_video_duration_this_week)
+                binding.tvWeekDayTime.text = getString(R.string.video_valid_days_this_week)
+            } else {
+                binding.tvIncome.text = getString(R.string.income_of_this_audio)
+                binding.tvTime.text = getString(R.string.duration_of_this_audio)
+                binding.tvTotalTime.text = getString(R.string.today_audio_duration)
+                binding.tvWeekTime.text = getString(R.string.total_voice_time_this_week)
+                binding.tvWeekDayTime.text = getString(R.string.voice_valid_days_this_week)
+            }
+
+            anchorCloseModel?.let {  anchorClosedModel ->
+                Glide.with(this).load(anchorClosedModel.user_head_img_url)
+                    .placeholder(R.mipmap.default_avatar)
+                    .error(R.mipmap.default_avatar).into(binding.ivAvatar)
+                binding.tvIncomeValue.text = anchorClosedModel.income_coins
+                binding.tvWatcherValue.text = anchorClosedModel.total_member
+                binding.tvTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.broadcast_time))
+                binding.tvTotalTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.today_total_time))
+                binding.tvWeekTimeValue.text = TimeUtil.convertMinSecond((anchorClosedModel.week_total_time ))
+                binding.tvWeekDayValue.text = "${anchorClosedModel.week_valid_day}"
+                binding.tvName.text = anchorClosedModel.user_name
+                binding.tvId.text = "ID:${anchorClosedModel.user_account}"
+            }
+        }
+
+        binding.tvClose.setOnClickListener(object : NoDoubleClickListener() {
+            override fun onClick() {
+                dismissAllowingStateLoss()
+                activity?.finish()
+            }
+        })
+    }
+
+    override fun initLiveData() {
+
+    }
+}

+ 3 - 0
room/src/main/java/com/swago/room/gift/control/SvgPlayerManager.kt

@@ -1,11 +1,13 @@
 package com.swago.room.gift.control
 
 import android.content.Context
+import com.opensource.svgaplayer.SVGACache
 import com.opensource.svgaplayer.SVGAParser
 import com.swago.baseswago.baseroom.IRoomActiveListener
 import com.swago.baseswago.baseroom.IRoomInfo
 import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.model.live.gift.IMGiftModel
+import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.LogUtil
 import java.util.*
 
@@ -20,6 +22,7 @@ class SvgPlayerManager : IRoomActiveListener {
     private var svgDanDaoView: SvgDanDaoView? = null
 
     fun init(context: Context, xSvgPlayer: XSvgPlayer,svgDanDaoView: SvgDanDaoView) {
+        SVGACache.onCreate(AppContext.getContext(), SVGACache.Type.FILE)
         SVGAParser.shareParser().init(context)
         this.xSvgPlayer = xSvgPlayer
         this.svgDanDaoView = svgDanDaoView

+ 80 - 34
room/src/main/java/com/swago/room/gift/control/XSvgPlayer.kt

@@ -50,40 +50,77 @@ class XSvgPlayer : ConstraintLayout {
        if (imGiftModel.svga.isNullOrEmpty()){
            return
        }
-        svgaParser!!.let {
+        svgaParser?.let {
             LogUtil.d("svgPlayer","xxx--$isPlaying")
-            it.decodeFromURL(URL(imGiftModel.svga),object:SVGAParser.ParseCompletion{
-                override fun onComplete(videoItem: SVGAVideoEntity) {
-                    binding!!.apply {
-                        val drawable = SVGADrawable(videoItem)
-                        svgaImageView.visibility = View.VISIBLE
-                        svgaImageView.setImageDrawable(drawable)
-                        svgaImageView.loops = 1
-                        svgaImageView.callback = callback
-                        LogUtil.d("svgPlayer","onComplete--$isPlaying")
-                        if (!isPlaying){
-                            svgaImageView.startAnimation()
-                            isPlaying = true
+            try{
+                it.decodeFromURL(URL(imGiftModel.svga),object:SVGAParser.ParseCompletion{
+                    override fun onComplete(videoItem: SVGAVideoEntity) {
+                        binding?.apply {
+                            val drawable = SVGADrawable(videoItem)
+                            svgaImageView.visibility = View.VISIBLE
+                            svgaImageView.setImageDrawable(drawable)
+                            svgaImageView.loops = 1
+                            svgaImageView.callback = callback
+                            LogUtil.d("svgPlayer","onComplete--$isPlaying")
+                            if (!isPlaying){
+                                svgaImageView.startAnimation()
+                                isPlaying = true
+                            }
+
                         }
 
                     }
 
-                }
+                    override fun onError() {
+                        binding?.apply {
+                            isPlaying = false
+                            LogUtil.d("svgPlayer","onError--$isPlaying")
+                            svgaImageView.visibility = View.GONE
+                            nextSvgPlay?.invoke()
+                        }
+                    }
+                },object:SVGAParser.PlayCallback{
+                    override fun onPlay(file: List<File>) {
+                        LogUtil.d("svgPlayer","onPlay--${file.size}")
+                    }
+
+                })
+
+            } catch (e: Exception){
+                it.decodeFromURL(URL(imGiftModel.svga),object:SVGAParser.ParseCompletion{
+                    override fun onComplete(videoItem: SVGAVideoEntity) {
+                        binding?.apply {
+                            val drawable = SVGADrawable(videoItem)
+                            svgaImageView.visibility = View.VISIBLE
+                            svgaImageView.setImageDrawable(drawable)
+                            svgaImageView.loops = 1
+                            svgaImageView.callback = callback
+                            LogUtil.d("svgPlayer","onComplete--$isPlaying")
+                            if (!isPlaying){
+                                svgaImageView.startAnimation()
+                                isPlaying = true
+                            }
+
+                        }
 
-                override fun onError() {
-                    binding?.apply {
-                        isPlaying = false
-                        LogUtil.d("svgPlayer","onError--$isPlaying")
-                        svgaImageView.visibility = View.GONE
-                        nextSvgPlay?.invoke()
                     }
-                }
-            },object:SVGAParser.PlayCallback{
-                override fun onPlay(file: List<File>) {
-                    LogUtil.d("svgPlayer","onPlay--${file.size}")
-                }
 
-            })
+                    override fun onError() {
+                        binding?.apply {
+                            isPlaying = false
+                            LogUtil.d("svgPlayer","onError--$isPlaying")
+                            svgaImageView.visibility = View.GONE
+                            nextSvgPlay?.invoke()
+                        }
+                    }
+                },object:SVGAParser.PlayCallback{
+                    override fun onPlay(file: List<File>) {
+                        LogUtil.d("svgPlayer","onPlay--${file.size}")
+                    }
+
+                })
+
+            }
 
         }
     }
@@ -98,13 +135,13 @@ class XSvgPlayer : ConstraintLayout {
                 topMargin = -155 // 以像素为单位设置顶部边距
             }
         }
-        svgaParser!!.let {
+        svgaParser?.let {
             LogUtil.d("svgPlayer","xxx--$isPlaying")
             callbackExecuted = false
             it.decodeFromURL(URL(userJoinRoomBean.androidJoinSpecial),object:SVGAParser.ParseCompletion{
                 override fun onComplete(videoItem: SVGAVideoEntity) {
                     callbackExecuted = true
-                    binding!!.apply {
+                    binding?.apply {
                         val drawable = SVGADrawable(videoItem)
                         svgaImageView.visibility = View.VISIBLE
                         svgaImageView.setImageDrawable(drawable)
@@ -129,15 +166,23 @@ class XSvgPlayer : ConstraintLayout {
                         nextSvgPlay?.invoke()
                     }
                 }
+            },object : SVGAParser.PlayCallback{
+                override fun onPlay(file: List<File>) {
+                    LogUtil.d("svgPlayer","onPlay--${file.size}")
+                }
+
             })
 
-            handler.postDelayed({
-                if (!callbackExecuted){
-                    playJoinRoomSvga(userJoinRoomBean)
-                    LogUtil.d("JoinAnimalManager","callbackExecuted")
-                }
+            if (handler!= null){
+                handler.postDelayed({
+                    if (!callbackExecuted && binding?.svgaImageView?.isAnimating == false){
+                        playJoinRoomSvga(userJoinRoomBean)
+                        LogUtil.d("JoinAnimalManager","callbackExecuted")
+                    }
+
+                },7000)
+            }
 
-            },7000)
 
         }
     }
@@ -156,6 +201,7 @@ class XSvgPlayer : ConstraintLayout {
         override fun onFinished() {
             isPlaying = false
             LogUtil.d("svgPlayer","onFinished--${isPlaying}")
+            binding?.svgaImageView?.pauseAnimation()
             binding?.svgaImageView?.visibility = View.GONE
             nextSvgPlay?.invoke()
         }

+ 1 - 0
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoManager.kt

@@ -56,6 +56,7 @@ class GiftDanDaoManager  : IRoomActiveListener {
         giftModelList.clear()
         giftDanDaoViewList.forEach {
             it.clear()
+            it.closeRoom()
         }
         loopJob?.cancel()
         loopJob = null

+ 164 - 46
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt

@@ -1,16 +1,16 @@
 package com.swago.room.giftdandao
 
 import android.animation.Animator
+import android.animation.AnimatorInflater
+import android.animation.AnimatorListenerAdapter
 import android.animation.AnimatorSet
 import android.animation.ObjectAnimator
 import android.app.Service
 import android.content.Context
 import android.os.Vibrator
 import android.util.AttributeSet
-import android.util.Log
 import android.view.LayoutInflater
 import android.view.View
-import android.view.animation.BounceInterpolator
 import android.view.animation.DecelerateInterpolator
 import android.widget.FrameLayout
 import android.widget.ImageView
@@ -26,7 +26,6 @@ import com.swago.baseswago.util.DpPxUtil
 import com.swago.baseswago.util.LogUtil
 import com.swago.baseswago.util.SwagoInfo
 import com.swago.baseswago.util.UserInfo
-import com.swago.room.BuildConfig
 import com.swago.room.R
 import com.swago.room.databinding.ViewItemGiftBinding
 import java.io.File
@@ -52,6 +51,10 @@ class GiftDanDaoView : FrameLayout {
         ArrayList<ImageView>()
     }
 
+    private val imageViewPrizeData by lazy {
+        ArrayList<ImageView>()
+    }
+
     constructor(context: Context) : super(context) {
         initView(context)
     }
@@ -63,6 +66,9 @@ class GiftDanDaoView : FrameLayout {
     private var svgaPlayWhichType = 0
 
     private var vibrator: Vibrator? = null
+    private var aniamtionRotate:Animator ?= null
+    private var aniamtionScale:Animator ?= null
+    private var aniamtionNum:Animator ?= null
 
     private fun initView(context: Context) {
         vibrator = context.getSystemService(Service.VIBRATOR_SERVICE) as Vibrator
@@ -71,9 +77,48 @@ class GiftDanDaoView : FrameLayout {
         svgParser2 = SVGAParser(context)
         for (i in 0..5){
             val imageView = ImageView(context)
+            val imageViewPrize = ImageView(context)
             imageViewData.add(imageView)
+            imageViewPrizeData.add(imageViewPrize)
         }
         isDevicesRtl = SwagoInfo.isMirror()
+        setAniamtion()
+    }
+
+    private fun setAniamtion() {
+        aniamtionRotate = AnimatorInflater.loadAnimator(context,R.animator.scale_rotate)
+        aniamtionScale = AnimatorInflater.loadAnimator(context,R.animator.scale)
+        aniamtionNum = AnimatorInflater.loadAnimator(context,R.animator.scale)
+        aniamtionRotate?.setTarget(binding?.ivPrizeBg)
+        aniamtionScale?.setTarget(binding?.ivPrizeFrame)
+        aniamtionNum?.setTarget(binding?.llPrizeNum)
+        aniamtionRotate?.addListener(object : AnimatorListenerAdapter() {
+            override fun onAnimationEnd(animation: Animator) {
+                super.onAnimationEnd(animation)
+                binding?.ivPrizeBg?.rotation = 0f
+                binding?.ivPrizeBg?.scaleX = 1.0f
+                binding?.ivPrizeBg?.scaleY = 1.0f
+                aniamtionRotate?.setTarget(binding?.ivPrizeBg)
+            }
+        })
+        aniamtionScale?.addListener(object : AnimatorListenerAdapter() {
+            override fun onAnimationEnd(animation: Animator) {
+                super.onAnimationEnd(animation)
+                binding?.ivPrizeFrame?.rotation = 0f
+                binding?.ivPrizeFrame?.scaleX = 1.0f
+                binding?.ivPrizeFrame?.scaleY = 1.0f
+                aniamtionScale?.setTarget(binding?.ivPrizeFrame)
+            }
+        })
+        aniamtionNum?.addListener(object : AnimatorListenerAdapter() {
+            override fun onAnimationEnd(animation: Animator) {
+                super.onAnimationEnd(animation)
+                binding?.llPrizeNum?.rotation = 0f
+                binding?.llPrizeNum?.scaleX = 1.0f
+                binding?.llPrizeNum?.scaleY = 1.0f
+                aniamtionNum?.setTarget(binding?.llPrizeNum)
+            }
+        })
     }
 
     fun addData(imGiftModel: IMGiftModel) {
@@ -195,15 +240,17 @@ class GiftDanDaoView : FrameLayout {
                 }
             }
 
-
             clItemGift.removeCallbacks(showRunnable)
             clItemGift.postDelayed(showRunnable, 3000)
             if (imGiftModel.multiple != 0) {
                 when (imGiftModel.multiple) {
-                    in 1..50 -> {
+                    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
@@ -214,63 +261,63 @@ class GiftDanDaoView : FrameLayout {
                                 .format(imGiftModel.multiple)
                     }
 
-                    in 51..100 -> {
-                        iv.visibility = View.VISIBLE
-                        tvWinPrize2.visibility = View.GONE
-                        svgaWinPrize.visibility = View.GONE
-                        val layoutParams = tvWinPrize.layoutParams as ConstraintLayout.LayoutParams
-                        layoutParams.marginStart = DpPxUtil.dip2px(26f)
-                        tvWinPrize.layoutParams = layoutParams
-                        iv.setImageResource(R.mipmap.win_51_100_prize)
-                        clWinPrize.visibility = View.VISIBLE
-                        tvWinPrize.text =
-                            AppContext.getContext().resources.getString(R.string.win_num_prize)
-                                .format(imGiftModel.multiple)
+                    in 100..499 -> {
+                        iv.visibility = View.GONE
+                        ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
+                        ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
                     }
 
-                    in 100..500 -> {
+                    in 500..999 -> {
                         iv.visibility = View.GONE
-                        svgaWinPrize.visibility = View.VISIBLE
-                        playSvg2("win_101_500_prize.svga")
-                        clWinPrize.visibility = View.GONE
-                        tvWinPrize2.visibility = View.VISIBLE
-                        tvWinPrize2.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_500_999)
                     }
-
-                    in 501..1000 -> {
+                    else -> {
                         iv.visibility = View.GONE
-                        svgaWinPrize.visibility = View.VISIBLE
                         UserInfo.getUserInfo()?.let {  userInfoModel ->
                             if (userInfoModel.id == imGiftModel.senderId && imGiftModel.giftId.toInt() == 202){
                                 vibrator?.vibrate(2500)
                             }
                         }
-                        playSvg2("win_501_1000_prize.svga")
-                        tvWinPrize2.visibility = View.VISIBLE
-                        tvWinPrize2.text =
-                            AppContext.getContext().resources.getString(R.string.win_num_prize)
-                                .format(imGiftModel.multiple)
+                        ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_1000)
+                        ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_1000)
                     }
-                    else -> {
-                        iv.visibility = View.GONE
-                        svgaWinPrize.visibility = View.VISIBLE
-                        UserInfo.getUserInfo()?.let {  userInfoModel ->
-                            if (userInfoModel.id == imGiftModel.senderId && imGiftModel.giftId.toInt() == 202){
-                                vibrator?.vibrate(2500)
+                }
+                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 {
+                        clPrize.visibility = View.VISIBLE
+                        ivPrizeBg.visibility = View.VISIBLE
+                        clPrize.removeCallbacks(winPrizeRunnable)
+                        clPrize.postDelayed(winPrizeRunnable, 1500)
+                        if (aniamtionRotate?.isRunning ==false){
+                            aniamtionRotate?.start()
                         }
-                        playSvg2("win_1001_prize.svga")
-                        tvWinPrize2.visibility = View.VISIBLE
-                        tvWinPrize2.text =
-                            AppContext.getContext().resources.getString(R.string.win_num_prize)
-                                .format(imGiftModel.multiple)
+                        if (aniamtionScale?.isRunning ==false){
+                            aniamtionScale?.start()
+                        }
+                        loadGiftPrizeNum(imGiftModel.multiple)
                     }
+
                 }
 
-                clWinPrize.removeCallbacks(winPrizeRunnable)
-                clWinPrize.postDelayed(winPrizeRunnable, 1500)
+
             }
         }
     }
@@ -325,6 +372,60 @@ class GiftDanDaoView : FrameLayout {
         }
     }
 
+    private fun loadGiftPrizeNum(giftCount: Int) {
+        binding?.apply {
+            val giftContStr = giftCount.toString()
+            if (giftContStr.length>imageViewPrizeData.size){
+                imageViewPrizeData.clear()
+                for (i in 0..giftContStr.length){
+                    val imageView = ImageView(context)
+                    imageViewPrizeData.add(imageView)
+                }
+            }
+            imageViewPrizeData[0].setImageResource(R.mipmap.ic_dan_dao_x)
+            llPrizeNum.removeAllViews()
+            llPrizeNum.addView(imageViewPrizeData[0])
+            giftCount.toString().toCharArray().forEachIndexed {  index,char ->
+                when(char){
+                    '0' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_zero)
+                    }
+                    '1' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_one)
+                    }
+                    '2' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_two)
+                    }
+                    '3' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_three)
+                    }
+                    '4' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_four)
+                    }
+                    '5' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_five)
+                    }
+                    '6' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_six)
+                    }
+                    '7' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_seven)
+                    }
+                    '8' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_eight)
+                    }
+                    '9' -> {
+                        imageViewPrizeData[index+1].setImageResource(R.mipmap.ic_dan_dao_big_nine)
+                    }
+                }
+                llPrizeNum.addView(imageViewPrizeData[index+1])
+                if (aniamtionNum?.isRunning ==false){
+                    aniamtionNum?.start()
+                }
+
+            }
+        }
+    }
     private fun loadGiftNum(giftCount: Int) {
         binding?.apply {
             val giftContStr = giftCount.toString()
@@ -406,11 +507,13 @@ class GiftDanDaoView : FrameLayout {
 
     private val winPrizeRunnable by lazy {
         Runnable {
+            LogUtil.d("winPrizeRunnable" , "clPrize")
             vibrator?.cancel()
             binding!!.clWinPrize.visibility = View.INVISIBLE
             binding!!.tvWinPrize.text = ""
             binding!!.svgaWinPrize.visibility = View.INVISIBLE
             binding!!.tvWinPrize2.text = ""
+            binding!!.clPrize.visibility = INVISIBLE
         }
     }
 
@@ -491,4 +594,19 @@ class GiftDanDaoView : FrameLayout {
         vibrator?.cancel()
     }
 
+    fun closeRoom(){
+        if (aniamtionRotate?.isRunning == true){
+            aniamtionRotate?.cancel()
+        }
+        if (aniamtionNum?.isRunning == true){
+            aniamtionNum?.cancel()
+        }
+        if (aniamtionScale?.isRunning == true){
+            aniamtionScale?.cancel()
+        }
+        aniamtionRotate?.removeAllListeners()
+        aniamtionNum?.removeAllListeners()
+        aniamtionScale?.removeAllListeners()
+    }
+
 }

+ 1 - 1
room/src/main/java/com/swago/room/lianmai/UserLianMaiDialog.kt

@@ -80,7 +80,7 @@ class UserLianMaiDialog : BaseXDFragment<DialogUserLianMaiBinding>(),IRoomActive
                             } else {
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    "These permissions are denied: $deniedList",
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
                                     Toast.LENGTH_LONG
                                 ).show()
                             }

+ 94 - 8
room/src/main/java/com/swago/room/piaotiao/WaftView.kt

@@ -10,18 +10,19 @@ import android.util.AttributeSet
 import android.view.LayoutInflater
 import android.view.View
 import android.widget.FrameLayout
-import android.widget.LinearLayout
+import com.opensource.svgaplayer.SVGADrawable
+import com.opensource.svgaplayer.SVGAParser
+import com.opensource.svgaplayer.SVGAVideoEntity
 import com.swago.baseswago.model.im.GamePrize
 import com.swago.baseswago.model.im.IPiaoTiao
+import com.swago.baseswago.model.im.PiaoTiaoRewardsData
 import com.swago.baseswago.model.live.gift.IMGiftModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.DpPxUtil
 import com.swago.baseswago.util.SwagoInfo
 import com.swago.room.R
-import com.swago.room.databinding.ViewItemGiftBinding
 import com.swago.room.databinding.ViewWaftBinding
-import com.swago.room.sound.SoundPoolPlayer
-import com.swago.room.widget.MarqueeTextView
+import java.net.URL
 import java.util.*
 
 /**
@@ -34,7 +35,7 @@ class WaftView : FrameLayout {
 
     private val imGiftModelList = LinkedList<IPiaoTiao>()
     private var binding : ViewWaftBinding? = null
-
+    private var svgaParser:SVGAParser? = null
     constructor(context: Context) : super(context)
     constructor(context: Context, mAttributeSet: AttributeSet?) : super(context, mAttributeSet){
         initView(context)
@@ -42,6 +43,7 @@ class WaftView : FrameLayout {
 
     private fun initView(context: Context) {
         binding = ViewWaftBinding.inflate(LayoutInflater.from(context), this, true)
+        svgaParser = SVGAParser(context)
     }
 
 
@@ -120,23 +122,50 @@ class WaftView : FrameLayout {
                     val sendName = "<font color='#FFDB43'>${next.senderName}</font>"
                     val giftName = "<font color='#FFDB43'>${localName}</font>"
                     val multiple = "<font color='#FFDB43'>${next.multiple}</font>"
-                    binding?.ll?.setBackgroundResource(R.mipmap.waft_big_prize)
+                    binding?.ivFunction?.visibility = View.GONE
+                    binding?.ivAvatar?.visibility = View.VISIBLE
+                    binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_big_prize)
+                    binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_big_prize)
+                    binding?.tvPrize?.text = "${next.multiple}"
                     binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_prize).format(sendName,giftName,multiple)}")
 
                 }else{
                     val sendName = "<font color='#FFDB43'>${next.senderName}</font>"
                     val giftName = "<font color='#FFDB43'>${localName}</font>"
                     val receiverName = "<font color='#FFDB43'>${next.receiverName}</font>"
-                    binding?.ll?.setBackgroundResource(R.mipmap.waft_bg)
+                    binding?.ivFunction?.visibility = View.GONE
+                    binding?.ivAvatar?.visibility = View.VISIBLE
+                    binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_send)
+                    binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_send)
+                    binding?.tvPrize?.text = ""
                     binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_gift_msg).format(sendName,giftName,receiverName)}")
                 }
+                if (!next.headSpecial.isNullOrEmpty()){
+                    binding?.svgAvatar?.visibility = View.VISIBLE
+                    svgaParser?.decodeFromURL(URL(next.headSpecial), object : SVGAParser.ParseCompletion{
+                        override fun onComplete(videoItem: SVGAVideoEntity) {
+                            val drawable = SVGADrawable(videoItem)
+                            binding?.svgAvatar?.setImageDrawable(drawable)
+                            binding?.svgAvatar?.startAnimation()
+                        }
+
+                        override fun onError() {
+                        }
+                    })
+                } else {
+                    binding?.svgAvatar?.visibility = View.GONE
+                }
             }
 
             is GamePrize -> {
                 val sendName = "<font color='#FFDB43'>${next.senderName}</font>"
                 val gameName = "<font color='#FFDB43'>${next.gameName}</font>"
                 val coin = "<font color='#FFDB43'>${next.coin}</font>"
-                binding?.ll?.setBackgroundResource(R.mipmap.waft_game_bg)
+                binding?.ivFunction?.visibility = View.GONE
+                binding?.ivAvatar?.visibility = View.VISIBLE
+                binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_game)
+                binding?.tvPrize?.setBackgroundResource(R.mipmap.ic_waft_game)
+                binding?.tvPrize?.text = ""
                 when(SwagoInfo.getLanguageCode()){
                     "id","ms" -> {
                         binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.game_prize).format(sendName,coin,gameName)}")
@@ -145,6 +174,62 @@ class WaftView : FrameLayout {
                         binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.game_prize).format(sendName,gameName,coin)}")
                     }
                 }
+                if (next.headSpecial.isNotEmpty()){
+                    svgaParser?.decodeFromURL(URL(next.headSpecial), object : SVGAParser.ParseCompletion{
+                        override fun onComplete(videoItem: SVGAVideoEntity) {
+                            val drawable = SVGADrawable(videoItem)
+                            binding?.svgAvatar?.setImageDrawable(drawable)
+                            binding?.svgAvatar?.startAnimation()
+                        }
+
+                        override fun onError() {
+                        }
+                    })
+                }
+            }
+            is PiaoTiaoRewardsData -> {
+                when(next.type) {
+                    505 -> {
+                        val sendName = "<font color='#FFDB43'>${next.userName}</font>"
+                        val coin = "<font color='#FFDB43'>${next.sort}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.congratulations_to_for_start_of_today).format(sendName,coin)}")
+                    }
+                    506 -> {
+                        val sendName = "<font color='#FFDB43'>${next.userName}</font>"
+                        val coin = "<font color='#FFDB43'>${next.sort}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.congratulations_to_for_king_of_game).format(sendName,coin)}")
+                    }
+                    507 -> {
+                        val sendName = "<font color='#FFDB43'>${next.userName}</font>"
+                        val coin = "<font color='#FFDB43'>${next.winCoin}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.so_lucky_golden_egg).format(sendName,coin)}")
+                    }
+                    508 -> {
+                        val coin = "<font color='#FFDB43'>${next.actCoin}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.prize_pool_golden_egg).format(coin)}")
+                    }
+                }
+
             }
 
         }
@@ -153,6 +238,7 @@ class WaftView : FrameLayout {
 
 
         binding?.marqueeTextView?.post {
+            binding?.marqueeTextView?.stopScroll()
             binding?.marqueeTextView?.startScroll()
         }
         binding?.let {

+ 1 - 1
room/src/main/java/com/swago/room/pk/PKAudienceAdapter.kt

@@ -15,7 +15,7 @@ class PKAudienceAdapter : BaseQuickAdapter<PKSeat,BaseViewHolder>(R.layout.item_
                 itemView.findViewById<CircleImageView>(R.id.ivAvatar).loadUrl(itemView.context,it.userAvatar)
                 when(layoutPosition){
                     0 -> {
-                        setImageResource(R.id.ivPosition,R.mipmap.first)
+                        setImageResource(R.id.ivPosition,R.mipmap.icon_pk_mvp)
                     }
                     1 -> {
                         setImageResource(R.id.ivPosition,R.mipmap.second)

+ 4 - 2
room/src/main/java/com/swago/room/pk/PKInviteDialog.kt

@@ -72,13 +72,13 @@ class PKInviteDialog : BaseXDFragment<DialogPkInviteBinding>(), RoomTimer.TimeTi
     }
 
     override fun initLiveData() {
-        pkVm.inviteSuccessLiveData.observe(this){
+        pkVm.inviteSuccessLiveData.observe(viewLifecycleOwner){
             timeCount = 30
             binding.tvTimeCount.visibility = View.VISIBLE
             binding.tvTimeCount.text = AppContext.getContext().resources.getString(R.string.inviting_time).format(timeCount)
         }
 
-        pkVm.cancelPKSuccessLiveData.observe(this){
+        pkVm.cancelPKSuccessLiveData.observe(viewLifecycleOwner){
             binding.tvInvite.visibility = View.VISIBLE
             binding.tvCancel.visibility = View.GONE
             binding.tvTimeCount.visibility = View.GONE
@@ -88,6 +88,8 @@ class PKInviteDialog : BaseXDFragment<DialogPkInviteBinding>(), RoomTimer.TimeTi
     override fun onDestroyView() {
         PKStateManager.removePKListener(this)
         RoomTimer.timeTickList.remove(this)
+        pkVm.inviteSuccessLiveData.removeObservers(viewLifecycleOwner)
+        pkVm.cancelPKSuccessLiveData.removeObservers(viewLifecycleOwner)
         super.onDestroyView()
     }
 

+ 11 - 17
room/src/main/java/com/swago/room/pk/PKLayoutView.kt

@@ -51,6 +51,9 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
     //主播获取PK信息
     var doGetPKInfoFun:(()->Unit)? = null
 
+    //跳转到对方Pk直播间
+    var doOtherRoomFun:((startPKModel: StartPKModel?)->Unit)? = null
+
     constructor(context: Context) : this(context, null)
     constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
     constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(
@@ -70,9 +73,9 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
         svgParserProgress = SVGAParser(context)
         playProgress("laugh.svga")
         binding?.let {
-            it.rvSelf.layoutManager = LinearLayoutManager(context)
+            it.rvSelf.layoutManager = LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
             it.rvSelf.adapter = selfAdapter
-            it.rvPeer.layoutManager = LinearLayoutManager(context)
+            it.rvPeer.layoutManager = LinearLayoutManager(context,LinearLayoutManager.HORIZONTAL,false)
             it.rvPeer.adapter = peerAdapter
 
             selfAdapter.setOnItemClickListener { _, _, position ->
@@ -81,6 +84,9 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
             peerAdapter.setOnItemClickListener { _, _, position ->
 
             }
+            it.clPeer.setOnClickListener {
+                doOtherRoomFun?.invoke(startPKModel)
+            }
         }
     }
 
@@ -90,7 +96,7 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
             svgProcessLayoutParams.startToStart = R.id.view
             svgProcessLayoutParams.topToBottom = R.id.view
             svgProcessLayoutParams.topMargin = DpPxUtil.dip2px(-3f)
-            svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/2
+            svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/2- DpPxUtil.dip2px(10f)
             svgProgress.layoutParams = svgProcessLayoutParams
         }
 
@@ -254,13 +260,7 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
                 val svgProcessLayoutParams = ConstraintLayout.LayoutParams(DpPxUtil.dip2px(20f),DpPxUtil.dip2px(20f))
                 svgProcessLayoutParams.startToStart = R.id.view
                 svgProcessLayoutParams.topToBottom = R.id.view
-                if (mProgress>50){
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress + DpPxUtil.dip2px(10f)
-                }else if(mProgress<50){
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress - DpPxUtil.dip2px(10f)
-                }else{
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress
-                }
+                svgProcessLayoutParams.marginStart = (DpPxUtil.getScreenWidth()/100f*mProgress).toInt() - DpPxUtil.dip2px(10f)
 
                 svgProcessLayoutParams.topMargin = DpPxUtil.dip2px(-3f)
                 svgProgress.layoutParams = svgProcessLayoutParams
@@ -288,13 +288,7 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
                 val svgProcessLayoutParams = ConstraintLayout.LayoutParams(DpPxUtil.dip2px(20f),DpPxUtil.dip2px(20f))
                 svgProcessLayoutParams.startToStart = R.id.view
                 svgProcessLayoutParams.topToBottom = R.id.view
-                if (mProgress>50){
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress + DpPxUtil.dip2px(10f)
-                }else if(mProgress<50){
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress - DpPxUtil.dip2px(10f)
-                }else{
-                    svgProcessLayoutParams.marginStart = DpPxUtil.getScreenWidth()/100*mProgress
-                }
+                svgProcessLayoutParams.marginStart = (DpPxUtil.getScreenWidth()/100f*mProgress).toInt() - DpPxUtil.dip2px(10f)
                 svgProcessLayoutParams.topMargin = DpPxUtil.dip2px(-3f)
                 svgProgress.layoutParams = svgProcessLayoutParams
             }

+ 3 - 0
room/src/main/java/com/swago/room/pk/PkVm.kt

@@ -17,6 +17,7 @@ import com.swago.room.R
 
 class PkVm(application: Application) : AbsMsgVm(application) {
     //接口调用
+    var pkState: ((startPk: Boolean) -> Unit)? = null
 
     /**
      * pK搜索对应主播
@@ -234,6 +235,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             PKStateManager.pkIPKListenerList.forEach { ipkListener ->
                                 ipkListener.startPK(it, true)
                             }
+                            pkState?.invoke(true)
                         }
                     }
                 }
@@ -279,6 +281,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             PKStateManager.pkIPKListenerList.forEach { ipkListener ->
                                 ipkListener.stopPK(it)
                             }
+                            pkState?.invoke(false)
                         }
                     }
                 }

+ 7 - 0
room/src/main/java/com/swago/room/user/UserRoomFragment.kt

@@ -63,6 +63,13 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
                 dialog.show(childFragmentManager, "BenefitBagDialog")
             }
         })
+
+        binding.pkLayoutView.doOtherRoomFun = {model ->
+            model?.let {
+                goToTargetRoom(it.oppositeUserId)
+            }
+
+        }
     }
 
 

+ 39 - 3
room/src/main/java/com/swago/room/vm/MsgVm.kt

@@ -9,11 +9,14 @@ import com.swago.baseswago.baseroom.viewmodel.AbsMsgVm
 import com.swago.baseswago.im.IRoomChat
 import com.swago.baseswago.im.ImConstant
 import com.swago.baseswago.im.ImConstant.anchor_close_room
+import com.swago.baseswago.im.ImConstant.break_egg_rewards
+import com.swago.baseswago.im.ImConstant.break_egg_sum
 import com.swago.baseswago.im.ImConstant.cancel_forbid_speak
 import com.swago.baseswago.im.ImConstant.delete_room_admin
 import com.swago.baseswago.im.ImConstant.follow_anchor_success
 import com.swago.baseswago.im.ImConstant.forbid_speak
 import com.swago.baseswago.im.ImConstant.force_close_live_room
+import com.swago.baseswago.im.ImConstant.game_key_rewards
 import com.swago.baseswago.im.ImConstant.game_win_big_prize
 import com.swago.baseswago.im.ImConstant.house_open_live
 import com.swago.baseswago.im.ImConstant.invite_user_on_mic
@@ -36,6 +39,7 @@ import com.swago.baseswago.im.ImConstant.room_dan_mu
 import com.swago.baseswago.im.ImConstant.send_wish_gift
 import com.swago.baseswago.im.ImConstant.set_room_admin
 import com.swago.baseswago.im.ImConstant.svg_gift
+import com.swago.baseswago.im.ImConstant.today_star_rewards
 import com.swago.baseswago.im.ImConstant.update_audience
 import com.swago.baseswago.im.ImConstant.update_mic_list_data
 import com.swago.baseswago.im.ImConstant.user_agree_invite_by_anchor
@@ -58,6 +62,7 @@ import com.swago.baseswago.model.live.gift.IMGiftModel
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.BitmapUtils
 import com.swago.baseswago.util.UserInfo
+import com.swago.room.R
 import com.swago.room.audio.AudioRoomManager
 import com.swago.room.audio.IAudioRoomListener
 import com.swago.room.bean.UserRoomModel
@@ -507,7 +512,7 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
                             if (userInfoModel.id == it.receiverId) {
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    "用户同意了您的邀请",
+                                    AppContext.getContext().getString(R.string.user_agreed_invitation),
                                     Toast.LENGTH_SHORT
                                 ).show()
                             }
@@ -529,7 +534,7 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
                                 //被邀请的用户弹窗
                                 Toast.makeText(
                                     AppContext.getContext(),
-                                    "用户拒绝了您的邀请",
+                                    AppContext.getContext().getString(R.string.user_refused_invitation),
                                     Toast.LENGTH_SHORT
                                 ).show()
                             }
@@ -781,7 +786,38 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
                 }
             }
         }
-
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(today_star_rewards) {
+            if (isReady) {
+                it.data?.let {
+                    it.type = 505
+                    waftFun?.invoke(it)
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(game_key_rewards) {
+            if (isReady) {
+                it.data?.let {
+                    it.type = 506
+                    waftFun?.invoke(it)
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_rewards) {
+            if (isReady) {
+                it.data?.let {
+                    it.type = 507
+                    waftFun?.invoke(it)
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_sum) {
+            if (isReady) {
+                it.data?.let {
+                    it.type = 508
+                    waftFun?.invoke(it)
+                }
+            }
+        }
     }
 
 

+ 2 - 2
room/src/main/java/com/swago/room/widget/AnchorFooterView.kt

@@ -131,10 +131,10 @@ class AnchorFooterView : ConstraintLayout, IFooter, IRoomActiveListener {
             override fun onClick() {
                 if (isMute){
                     AgoraManager.setMute(false)
-                    binding.ivMute.setImageResource(R.mipmap.live_unmute)
+                    binding.ivMute.setImageResource(R.mipmap.live_unmute_white)
                 }else{
                     AgoraManager.setMute(true)
-                    binding.ivMute.setImageResource(R.mipmap.live_mute)
+                    binding.ivMute.setImageResource(R.mipmap.live_mute_white)
                 }
                 isMute = !isMute
             }

+ 44 - 0
room/src/main/res/animator/scale.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+    android:ordering="sequentially">
+    <!-- 缩放动画 -->
+    <set android:ordering="together">
+        <objectAnimator
+            android:propertyName="scaleX"
+            android:valueFrom="4.0"
+            android:valueTo="1.0"
+            android:duration="400"/>
+
+        <objectAnimator
+            android:propertyName="scaleY"
+            android:valueFrom="4.0"
+            android:valueTo="1.0"
+            android:duration="400"/>
+    </set>
+    <set android:ordering="together">
+        <objectAnimator
+            android:propertyName="scaleX"
+            android:valueFrom="1.0"
+            android:valueTo="1.2"
+            android:duration="100"/>
+
+        <objectAnimator
+            android:propertyName="scaleY"
+            android:valueFrom="1.0"
+            android:valueTo="1.2"
+            android:duration="100"/>
+    </set>
+    <set android:ordering="together">
+        <objectAnimator
+            android:propertyName="scaleX"
+            android:valueFrom="1.2"
+            android:valueTo="1.0"
+            android:duration="100"/>
+
+        <objectAnimator
+            android:propertyName="scaleY"
+            android:valueFrom="1.2"
+            android:valueTo="1.0"
+            android:duration="100"/>
+    </set>
+</set>

+ 22 - 0
room/src/main/res/animator/scale_rotate.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <objectAnimator
+        android:propertyName="rotation"
+        android:valueFrom="0"
+        android:valueTo="360"
+        android:duration="600"
+        android:repeatCount="infinite"
+        android:repeatMode="restart"
+        android:interpolator="@android:anim/linear_interpolator"/>
+    <objectAnimator
+        android:propertyName="scaleX"
+        android:valueFrom="4.0"
+        android:valueTo="1.0"
+        android:duration="400"/>
+
+    <objectAnimator
+        android:propertyName="scaleY"
+        android:valueFrom="4.0"
+        android:valueTo="1.0"
+        android:duration="400"/>
+</set>

+ 6 - 0
room/src/main/res/drawable/live_clarity_check.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@mipmap/ic_clarity_hd" android:state_checked="true"/>
+ <item android:drawable="@mipmap/ic_clarity_sd" android:state_checked="false"/>
+ <item android:drawable="@mipmap/ic_clarity_sd"/>
+</selector>

+ 16 - 0
room/src/main/res/layout/activity_anchor_room.xml

@@ -158,6 +158,22 @@
                 android:drawablePadding="4dp"
                 android:gravity="center_horizontal"
                 android:background="@android:color/transparent"
+                android:layout_marginEnd="16dp"
+                android:layout_marginBottom="24dp"/>
+
+            <CheckBox
+                android:id="@+id/cbClarity"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:drawableTop="@drawable/live_clarity_check"
+                android:textColor="#ffffff"
+                android:textSize="14dp"
+                android:button="@null"
+                android:layout_marginTop="3dp"
+                android:text="@string/sd"
+                android:drawablePadding="4dp"
+                android:gravity="center_horizontal"
+                android:background="@android:color/transparent"
                 android:layout_marginBottom="24dp"/>
 
         </LinearLayout>

+ 2 - 2
room/src/main/res/layout/dialog_audio_action.xml

@@ -148,7 +148,7 @@
         <ImageView
             android:id="@+id/ivMuteMic"
             android:padding="10dp"
-            android:src="@mipmap/live_mute"
+            android:src="@mipmap/live_mute_white"
             android:layout_width="50dp"
             android:layout_height="50dp"/>
         <TextView
@@ -179,7 +179,7 @@
         <ImageView
             android:id="@+id/ivUnMuteMic"
             android:padding="10dp"
-            android:src="@mipmap/live_unmute"
+            android:src="@mipmap/live_unmute_white"
             android:layout_width="50dp"
             android:layout_height="50dp"/>
         <TextView

+ 1 - 1
room/src/main/res/layout/dialog_invited_by_anchor_mic.xml

@@ -66,7 +66,7 @@
                 android:id="@+id/tvAgree"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:drawableStart="@mipmap/live_unmute"
+                android:drawableStart="@mipmap/live_unmute_white"
                 android:gravity="center"
                 android:drawablePadding="5dp"
                 android:layout_gravity="center"

+ 16 - 12
room/src/main/res/layout/fragment_base_com.xml

@@ -141,27 +141,27 @@
 
     <com.swago.room.giftdandao.GiftDanDaoView
         android:id="@+id/danDaoView"
-        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        android:layout_marginBottom="480dp"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
+        android:layout_width="match_parent"
+        android:layout_marginTop="@dimen/dp_40"
+        android:layout_height="300dp"/>
 
     <com.swago.room.giftdandao.GiftDanDaoView
         android:id="@+id/danDaoView2"
-        android:layout_marginBottom="400dp"
-        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginTop="100dp"
+        app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
+        android:layout_width="match_parent"
+        android:layout_height="300dp"/>
 
     <com.swago.room.giftdandao.GiftDanDaoView
         android:id="@+id/danDaoView3"
-        android:layout_marginBottom="320dp"
-        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_marginTop="160dp"
+        app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"/>
+        android:layout_width="match_parent"
+        android:layout_height="300dp"/>
 
     <ViewStub
         android:id="@+id/joinRoomViewStub"
@@ -187,6 +187,10 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"/>
 
+    <com.swago.room.gift.control.XSvgPlayer
+        android:id="@+id/xJoinSvgaPlayer"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"/>
 
     <com.swago.room.gift.control.SvgDanDaoView
         android:id="@+id/svgDanDaoView"

+ 3 - 3
room/src/main/res/layout/item_pk_seat.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="28dp"
-    android:layout_height="28dp"
+    android:layout_width="36dp"
+    android:layout_height="36dp"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <de.hdodenhof.circleimageview.CircleImageView
-        android:layout_margin="2dp"
+        android:layout_margin="4dp"
         android:id="@+id/ivAvatar"
         app:civ_border_width="2dp"
         app:civ_border_color="#F8DC93"

+ 1 - 1
room/src/main/res/layout/layout_anchor_footer_view.xml

@@ -132,7 +132,7 @@
         android:background="@drawable/shape_80000000_20"
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintEnd_toStartOf="@+id/ivMore"
-        android:src="@mipmap/live_unmute"
+        android:src="@mipmap/live_unmute_white"
         android:padding="7dp"
         android:layout_width="40dp"
         android:layout_height="40dp"/>

+ 3 - 3
room/src/main/res/layout/layout_pk_view.xml

@@ -93,7 +93,7 @@
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toEndOf="@+id/ivPeerAvatar"
             app:layout_constraintBottom_toBottomOf="parent"
-            android:layout_width="0dp"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"/>
 
     </androidx.constraintlayout.widget.ConstraintLayout>
@@ -150,7 +150,7 @@
         android:layout_marginTop="10dp"
         app:layout_constraintStart_toStartOf="parent"
         android:layout_width="wrap_content"
-        android:layout_height="28dp"/>
+        android:layout_height="36dp"/>
 
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/rvPeer"
@@ -158,7 +158,7 @@
         android:layout_marginTop="10dp"
         app:layout_constraintEnd_toEndOf="parent"
         android:layout_width="wrap_content"
-        android:layout_height="28dp"/>
+        android:layout_height="36dp"/>
 
 
     <androidx.constraintlayout.widget.ConstraintLayout

+ 44 - 4
room/src/main/res/layout/view_item_gift.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+    android:layout_height="match_parent"
     android:id="@+id/clItemGift"
     android:visibility="invisible"
     tools:visibility="visible"
@@ -12,6 +12,7 @@
         android:id="@+id/clContainer"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
         android:layout_marginTop="50dp"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content">
@@ -154,10 +155,7 @@
             </LinearLayout>
 
         </androidx.constraintlayout.widget.ConstraintLayout>
-
-
     </androidx.constraintlayout.widget.ConstraintLayout>
-
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/clWinPrize"
         app:layout_constraintStart_toStartOf="parent"
@@ -216,5 +214,47 @@
         android:layout_width="0dp"
         android:maxLines="1"
         android:layout_height="wrap_content"/>
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/clPrize"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="invisible"
+        tools:visibility="visible"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+        <ImageView
+            android:id="@+id/iv_prize_bg"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:scaleType="centerInside"
+            android:layout_marginStart="40dp"
+            android:layout_marginTop="30dp"
+            android:layout_alignParentTop="true"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"/>
+        <ImageView
+            android:id="@+id/iv_prize_frame"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:scaleType="centerInside"
+            android:layout_marginTop="30dp"
+            android:layout_alignParentTop="true"
+            app:layout_constraintEnd_toEndOf="@+id/iv_prize_bg"
+            app:layout_constraintStart_toStartOf="@+id/iv_prize_bg"
+            app:layout_constraintTop_toTopOf="parent"/>
+        <LinearLayout
+            android:id="@+id/llPrizeNum"
+            android:orientation="horizontal"
+            app:layout_constraintEnd_toEndOf="@+id/iv_prize_frame"
+            app:layout_constraintStart_toStartOf="@+id/iv_prize_frame"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            android:layout_marginTop="40dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content">
+
+        </LinearLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 1 - 1
room/src/main/res/layout/view_red_envelope.xml

@@ -33,7 +33,7 @@
         android:id="@+id/tvTime"
         android:textSize="10dp"
         android:textColor="#FD4B5E"
-        tools:text="00:29"
+        tools:text="00:59"
         android:gravity="center"
         android:layout_marginBottom="3dp"
         app:layout_constraintStart_toStartOf="parent"

+ 74 - 6
room/src/main/res/layout/view_waft.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="350dp"
     android:layout_height="wrap_content"
     xmlns:app="http://schemas.android.com/apk/res-auto"
@@ -10,18 +10,86 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:orientation="horizontal"
     android:gravity="center_vertical"
-    android:background="@mipmap/waft_bg">
+    android:background="@mipmap/bg_waft_big_prize">
+    <ImageView
+        android:id="@+id/iv_prize"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginEnd="10dp"
+        android:background="@mipmap/ic_waft_big_prize"/>
+    <ImageView
+        android:id="@+id/iv_function"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:visibility="gone"
+        tools:visibility="visible"
+        android:layout_marginStart="@dimen/dp_10"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        android:background="@mipmap/ic_waft_big_prize"/>
+
+    <TextView
+        android:id="@+id/tv_prize"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="22sp"
+        tools:text="1234"
+        android:typeface="monospace"
+        android:textStyle="bold"
+        android:textColor="#FFF000"
+        android:gravity="center"
+        android:shadowDx="6"
+        android:shadowDy="6"
+        android:shadowRadius="4"
+        android:shadowColor="#FF6D00"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="@+id/iv_prize"
+        app:layout_constraintStart_toStartOf="@+id/iv_prize"/>
+
+    <de.hdodenhof.circleimageview.CircleImageView
+        android:id="@+id/ivAvatar"
+        android:src="@mipmap/default_avatar"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        android:visibility="gone"
+        tools:visibility="visible"
+        android:layout_marginStart="18dp"
+        android:layout_width="28dp"
+        android:layout_height="28dp"/>
+
+    <com.opensource.svgaplayer.SVGAImageView
+        android:id="@+id/svgAvatar"
+        android:layout_width="34dp"
+        android:layout_height="34dp"
+        android:visibility="visible"
+        android:layout_marginStart="14dp"
+        app:autoPlay="true"
+        app:loopCount="0"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"/>
 
     <com.swago.room.widget.MarqueeTextView
         android:id="@+id/marqueeTextView"
-        android:layout_marginStart="35dp"
-        android:layout_width="290dp"
+        android:layout_width="260dp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
         android:layout_height="wrap_content"
-        android:textSize="16dp"
+        android:layout_marginTop="20dp"
+        android:layout_marginBottom="20dp"
+        android:textSize="14dp"
         tools:text="ddddd"
         android:layout_gravity="center"
         android:textColor="@color/white"
         app:scroll_first_delay="1000"
         app:scroll_interval="6000"
         app:scroll_mode="mode_forever"/>
-</LinearLayout>
+</androidx.constraintlayout.widget.ConstraintLayout>

BIN
room/src/main/res/mipmap-xxhdpi/bg_waft_big_prize.png


BIN
room/src/main/res/mipmap-xxhdpi/bg_waft_function.png


BIN
room/src/main/res/mipmap-xxhdpi/bg_waft_game.png


BIN
room/src/main/res/mipmap-xxhdpi/bg_waft_send.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_bg_prize_1000.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_bg_prize_100_499.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1000.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_prize_frame_100_499.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1_99.png


BIN
room/src/main/res/mipmap-xxhdpi/gift_prize_frame_500_999.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_clarity_hd.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_clarity_sd.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_waft_big_prize.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_waft_function.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_waft_game.png


BIN
room/src/main/res/mipmap-xxhdpi/ic_waft_send.png


BIN
room/src/main/res/mipmap-xxhdpi/icon_pk_mvp.png


BIN
room/src/main/res/mipmap-xxhdpi/live_mute.png


+ 0 - 0
room/src/main/res/mipmap-xxhdpi/live_mute.webp → room/src/main/res/mipmap-xxhdpi/live_mute_white.webp


BIN
room/src/main/res/mipmap-xxhdpi/live_unmute.png


+ 0 - 0
room/src/main/res/mipmap-xxhdpi/live_unmute.webp → room/src/main/res/mipmap-xxhdpi/live_unmute_white.webp


BIN
room/src/main/res/mipmap-xxhdpi/waft_bg.webp


BIN
room/src/main/res/mipmap-xxhdpi/waft_big_prize.webp


BIN
room/src/main/res/mipmap-xxhdpi/waft_game_bg.webp


+ 1 - 1
user/src/main/java/com/swago/user/SettingActivity.kt

@@ -32,7 +32,7 @@ class SettingActivity : BaseXActivity<ActivitySettingBinding>() {
         setBackView(binding.toolbar.ivBack)
         binding.toolbar.tvTitle.text = AppContext.getContext().resources.getString(R.string.setting)
 
-        binding.tvVersion.text = getVersionName()
+        binding.tvVersion.text = getVersionName() + "(1)"
 
         binding.tvUserAgreement.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {

+ 1 - 1
user/src/main/java/com/swago/user/recharge/RechargeActivity.kt

@@ -159,7 +159,7 @@ class RechargeActivity : BaseXActivity<ActivityRechargeBinding>(),IPayCallback {
     override fun onUnConsumeOrder(data: List<Purchase>) {
         lifecycleScope.launch(Dispatchers.Main) {
             data.forEach {
-                val orderLostDialog = OrderLostDialog.newInstance(it.orderId)
+                val orderLostDialog = OrderLostDialog.newInstance(it.orderId?:"")
                 orderLostDialog.commitLostOrderFun = {
                     payVm.payOrderToServer(it, 4)
                 }