1
0

24 Коммитууд f88db1a1c0 ... 0f2feefc05

Эзэн SHA1 Мессеж Огноо
  tongmengxiao 0f2feefc05 feat: 1407 4 сар өмнө
  tongmengxiao 47f77186e9 feat: delete foreground service 4 сар өмнө
  tongmengxiao eb874fc5ef feat: 34 前台服务 4 сар өмнө
  tongmengxiao 5d583682e2 fix: leak 4 сар өмнө
  tongmengxiao e4382c8db9 feat: 屏蔽 4 сар өмнө
  tongmengxiao d071894116 fix: hongbao 60 4 сар өмнө
  tongmengxiao 8a6931733b feat: delete country 4 сар өмнө
  tongmengxiao bca6519c1e fix: systemcount 4 сар өмнө
  tongmengxiao eae93dff78 fix: 系统消息Im 4 сар өмнө
  tongmengxiao 6745ec4c49 fix: mvp 4 сар өмнө
  tongmengxiao ffa4301d4b feat: version 1406 4 сар өмнө
  tongmengxiao 3916dd1f1f fix: pk string 4 сар өмнө
  tongmengxiao 8898b45c2d feat: READ_MEDIA_VISUAL_USER_SELECTED 4 сар өмнө
  tongmengxiao 1dbc816f4d feat: 优化 5 сар өмнө
  tongmengxiao 0b6e7fc5d3 feat: 本地化 5 сар өмнө
  tongmengxiao 74f28cfc79 feat: 开屏页 5 сар өмнө
  tongmengxiao 1db6b6cca1 feat: 活动飘条 5 сар өмнө
  tongmengxiao 8b53eff077 feat: 送礼倍数 5 сар өмнө
  tongmengxiao 93878487cc feat: splash 5 сар өмнө
  tongmengxiao 03a7292791 feat: pk优化;2C 5 сар өмнө
  tongmengxiao ab27833739 feat: targetsdkVersion 34 5 сар өмнө
  tongmengxiao bb7718acbc fix: game message icon 5 сар өмнө
  tongmengxiao 899d57d876 feat: update google 支付 5 сар өмнө
  tongmengxiao b2c28ffb15 feat: 换开麦闭麦图 5 сар өмнө
100 өөрчлөгдсөн 1330 нэмэгдсэн , 338 устгасан
  1. 5 5
      app/build.gradle
  2. 1 0
      app/src/main/AndroidManifest.xml
  3. 117 4
      app/src/main/java/com/swago/app/SplashActivity.kt
  4. 6 1
      app/src/main/java/com/swago/app/SplashVm.kt
  5. 17 0
      app/src/main/res/layout/activity_splash.xml
  6. 4 4
      baseswago/build.gradle
  7. 1 1
      baseswago/src/main/java/com/swago/baseswago/PersonDataDFragment.kt
  8. 2 0
      baseswago/src/main/java/com/swago/baseswago/activity/WebViewActivity.kt
  9. 22 0
      baseswago/src/main/java/com/swago/baseswago/cusview/CustomLoadMoreView.kt
  10. 1 1
      baseswago/src/main/java/com/swago/baseswago/dialog/BenefitBagDialog.kt
  11. 1 1
      baseswago/src/main/java/com/swago/baseswago/dialog/PayDialog.kt
  12. 46 1
      baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt
  13. 21 0
      baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt
  14. 3 0
      baseswago/src/main/java/com/swago/baseswago/model/ConfigModel.kt
  15. 9 1
      baseswago/src/main/java/com/swago/baseswago/model/UnreadMessageVm.kt
  16. 3 1
      baseswago/src/main/java/com/swago/baseswago/model/home/OfficialSumModel.kt
  17. 2 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. 4 2
      baseswago/src/main/java/com/swago/baseswago/util/DianJiuUtil.kt
  21. 16 1
      baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt
  22. 5 15
      baseswago/src/main/java/com/swago/baseswago/util/IMUtil.kt
  23. 1 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoInfo.kt
  24. 2 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoRefreshUtil.kt
  25. 48 0
      baseswago/src/main/java/com/swago/glide.kt
  26. 5 0
      baseswago/src/main/res/drawable/shape_66000000_28.xml
  27. 60 0
      baseswago/src/main/res/layout/custom_view_load_more.xml
  28. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_audioing.png
  29. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_living.png
  30. 12 3
      baseswago/src/main/res/values-ar/strings.xml
  31. 14 5
      baseswago/src/main/res/values-in/strings.xml
  32. 15 6
      baseswago/src/main/res/values-ms/strings.xml
  33. 11 2
      baseswago/src/main/res/values-zh/strings.xml
  34. 12 3
      baseswago/src/main/res/values/strings.xml
  35. 2 2
      build.gradle
  36. 2 2
      home/build.gradle
  37. 29 6
      home/src/main/java/com/swago/home/HomeActivity.kt
  38. 4 2
      home/src/main/java/com/swago/home/HomeFragment.kt
  39. 8 2
      home/src/main/java/com/swago/home/MessageFragment.kt
  40. 14 0
      home/src/main/java/com/swago/home/innerhome/HomeVm.kt
  41. 7 0
      home/src/main/java/com/swago/home/official/OfficialMessageActivity.kt
  42. 9 9
      home/src/main/res/layout/item_home.xml
  43. 3 2
      home/src/main/res/layout/item_official.xml
  44. 2 2
      lib_country_picker/build.gradle
  45. 0 32
      lib_country_picker/src/main/assets/code.json
  46. 2 2
      login/build.gradle
  47. 5 1
      login/src/main/java/com/swago/login/FBLogin.kt
  48. 76 11
      login/src/main/java/com/swago/login/LoginActivity.kt
  49. 2 2
      room/build.gradle
  50. 2 3
      room/src/main/AndroidManifest.xml
  51. BIN
      room/src/main/assets/win_1001_prize.svga
  52. BIN
      room/src/main/assets/win_101_500_prize.svga
  53. BIN
      room/src/main/assets/win_501_1000_prize.svga
  54. 1 16
      room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt
  55. 0 2
      room/src/main/java/com/swago/room/audio/AudioSeatAdapter.kt
  56. 1 1
      room/src/main/java/com/swago/room/audio/UserByAnchorInviteDialog.kt
  57. 7 2
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  58. 4 2
      room/src/main/java/com/swago/room/game/GamePlayDialog.kt
  59. 5 5
      room/src/main/java/com/swago/room/gift/ComboView.kt
  60. 3 3
      room/src/main/java/com/swago/room/gift/control/SvgDanDaoView.kt
  61. 3 0
      room/src/main/java/com/swago/room/gift/control/SvgPlayerManager.kt
  62. 15 8
      room/src/main/java/com/swago/room/gift/control/XSvgPlayer.kt
  63. 1 0
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoManager.kt
  64. 162 66
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt
  65. 1 1
      room/src/main/java/com/swago/room/lianmai/UserLianMaiDialog.kt
  66. 3 1
      room/src/main/java/com/swago/room/manager/JoinRoomManager.kt
  67. 120 12
      room/src/main/java/com/swago/room/piaotiao/WaftView.kt
  68. 8 1
      room/src/main/java/com/swago/room/pk/PKAudienceAdapter.kt
  69. 4 2
      room/src/main/java/com/swago/room/pk/PKInviteDialog.kt
  70. 15 17
      room/src/main/java/com/swago/room/pk/PKLayoutView.kt
  71. 7 2
      room/src/main/java/com/swago/room/pk/PkVm.kt
  72. 10 1
      room/src/main/java/com/swago/room/service/AgoraForegroundService.java
  73. 7 0
      room/src/main/java/com/swago/room/user/UserRoomFragment.kt
  74. 59 5
      room/src/main/java/com/swago/room/vm/MsgVm.kt
  75. 2 2
      room/src/main/java/com/swago/room/widget/AnchorFooterView.kt
  76. 14 10
      room/src/main/java/com/swago/room/widget/MarqueeTextView.java
  77. 2 2
      room/src/main/java/com/swago/room/widget/UserFooterView.kt
  78. 44 0
      room/src/main/res/animator/scale.xml
  79. 22 0
      room/src/main/res/animator/scale_rotate.xml
  80. 2 2
      room/src/main/res/layout/dialog_audio_action.xml
  81. 1 1
      room/src/main/res/layout/dialog_invited_by_anchor_mic.xml
  82. 16 12
      room/src/main/res/layout/fragment_base_com.xml
  83. 1 1
      room/src/main/res/layout/item_audio_seat.xml
  84. 3 3
      room/src/main/res/layout/item_pk_seat.xml
  85. 1 1
      room/src/main/res/layout/layout_anchor_footer_view.xml
  86. 3 3
      room/src/main/res/layout/layout_pk_view.xml
  87. 8 4
      room/src/main/res/layout/layout_svg_dan_dao_view.xml
  88. 44 4
      room/src/main/res/layout/view_item_gift.xml
  89. 1 1
      room/src/main/res/layout/view_red_envelope.xml
  90. 77 8
      room/src/main/res/layout/view_waft.xml
  91. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_big_prize.png
  92. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_function.png
  93. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_game.png
  94. BIN
      room/src/main/res/mipmap-xxhdpi/bg_waft_send.png
  95. BIN
      room/src/main/res/mipmap-xxhdpi/gift_bg_prize_1000.png
  96. BIN
      room/src/main/res/mipmap-xxhdpi/gift_bg_prize_100_499.png
  97. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1000.png
  98. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_100_499.png
  99. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_500_999.png
  100. BIN
      room/src/main/res/mipmap-xxhdpi/ic_waft_big_prize.png

+ 5 - 5
app/build.gradle

@@ -8,15 +8,15 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
-    buildToolsVersion "33.0.2"
+    compileSdkVersion 34
+    buildToolsVersion "34.0.0"
 
     defaultConfig {
         applicationId "com.swago.app"
         minSdkVersion 21
-        targetSdkVersion 33
-        versionCode 1405
-        versionName "1.4.0.5"
+        targetSdkVersion 34
+        versionCode 1407
+        versionName "1.4.0.7"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -21,6 +21,7 @@
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
     <uses-permission android:name="android.permission.VIBRATE"/>
     <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
+    <uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
     <uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
     <uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
     <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

+ 117 - 4
app/src/main/java/com/swago/app/SplashActivity.kt

@@ -1,27 +1,43 @@
 package com.swago.app
 
 import android.Manifest
+import android.content.Intent
 import android.os.Build
 import android.os.Bundle
+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.permissionx.guolindev.PermissionX
 import com.swago.baseswago.constant.ARouteConstant
+import com.swago.baseswago.model.ConfigModel
+import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.loadNoPlaceUrl
 
 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)
-
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
             PermissionX.init(this@SplashActivity)
                 .permissions(
                     Manifest.permission.READ_MEDIA_IMAGES,
+                    Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
                 )
                 .request { allGranted, grantedList, deniedList ->
                     if (allGranted) {
@@ -35,7 +51,31 @@ class SplashActivity : AppCompatActivity() {
                     } else {
                         Toast.makeText(
                             this@SplashActivity,
-                            "These permissions are denied: $deniedList",
+                            getString(R.string.these_permissions_denied)+" $deniedList",
+                            Toast.LENGTH_LONG
+                        ).show()
+                        ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
+                        finish()
+                    }
+                }
+        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+            PermissionX.init(this@SplashActivity)
+                .permissions(
+                    Manifest.permission.READ_MEDIA_IMAGES,
+                )
+                .request { allGranted, grantedList, deniedList ->
+                    if (allGranted) {
+                        splashVm.getApiDomain()
+                        splashVm.jumpToLoginLiveData.observe(this){
+                            if (!it){
+                                ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
+                                finish()
+                            }
+                        }
+                    } else {
+                        Toast.makeText(
+                            this@SplashActivity,
+                            getString(R.string.these_permissions_denied)+" $deniedList",
                             Toast.LENGTH_LONG
                         ).show()
                         ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
@@ -60,7 +100,7 @@ class SplashActivity : AppCompatActivity() {
                     } else {
                         Toast.makeText(
                             this@SplashActivity,
-                            "These permissions are denied: $deniedList",
+                            getString(R.string.these_permissions_denied)+" $deniedList",
                             Toast.LENGTH_LONG
                         ).show()
                         ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
@@ -68,5 +108,78 @@ class SplashActivity : AppCompatActivity() {
                     }
                 }
         }
+        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 {
+                configModel = it
+                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() {
+                countDownTimer.cancel()
+                configModel?.rotation_url?.let {
+                    ARouter.getInstance().build(ARouteConstant.Base.webView)
+                        .withString("url", it)
+                        .navigation(this@SplashActivity,1001)
+                }
+            }
+        })
+
+        mSplashTime?.setOnClickListener(object :NoDoubleClickListener(){
+            override fun onClick() {
+                countDownTimer.cancel()
+                if (isRunning){
+                    isRunning = false
+                    splashVm.loginByAuto()
+                }
+            }
+        })
+    }
+
+    override fun onResume() {
+        super.onResume()
+        isRunning = true
+    }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        countDownTimer.cancel()
+    }
+
+    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+        super.onActivityResult(requestCode, resultCode, data)
+        if (resultCode == RESULT_OK && requestCode == 1001){
+            splashVm.loginByAuto()
+        }
     }
 }

+ 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
                 }
             }
 

+ 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>

+ 4 - 4
baseswago/build.gradle

@@ -5,12 +5,12 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
-    buildToolsVersion "33.0.2"
+    compileSdkVersion 34
+    buildToolsVersion "34.0.0"
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 
@@ -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"

+ 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()
                                 }

+ 2 - 0
baseswago/src/main/java/com/swago/baseswago/activity/WebViewActivity.kt

@@ -199,10 +199,12 @@ class WebViewActivity : BaseXActivity<ActivityWebBinding>() {
                     if (it.contains(url)  || it.contains("withdrawal")) {
                         webView.goBack()
                     } else {
+                        setResult(RESULT_OK)
                         finish()
                     }
                 }
             } else {
+                setResult(RESULT_OK)
                 finish()
             }
         }

+ 22 - 0
baseswago/src/main/java/com/swago/baseswago/cusview/CustomLoadMoreView.kt

@@ -0,0 +1,22 @@
+package com.swago.baseswago.cusview
+
+import com.chad.library.R
+import com.chad.library.adapter.base.loadmore.LoadMoreView
+
+class CustomLoadMoreView : LoadMoreView() {
+    override fun getLayoutId(): Int {
+        return com.swago.baseswago.R.layout.custom_view_load_more
+    }
+
+    override fun getLoadingViewId(): Int {
+        return R.id.load_more_loading_view
+    }
+
+    override fun getLoadFailViewId(): Int {
+        return R.id.load_more_load_fail_view
+    }
+
+    override fun getLoadEndViewId(): Int {
+        return R.id.load_more_load_end_view
+    }
+}

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

@@ -132,7 +132,7 @@ class BenefitBagDialog : BaseXDFragment<DialogBenefitBagBinding>(), 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
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)
                 }

+ 46 - 1
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,8 @@ 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.system_message
+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 +63,7 @@ import com.swago.baseswago.im.ImConstant.user_join_room
 import com.swago.baseswago.im.ImConstant.user_like
 import com.swago.baseswago.im.ImConstant.user_refuse_invite_by_anchor
 import com.swago.baseswago.model.RedEnvelope
+import com.swago.baseswago.model.home.OfficialSumModel
 import com.swago.baseswago.model.im.*
 import com.swago.baseswago.model.live.ForceCloseModel
 import com.swago.baseswago.model.live.ReceiveModel
@@ -375,7 +381,46 @@ 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)
+                }
+                system_message -> {
+                    parameterizedTypeImpl = ParameterizedTypeImpl(
+                        arrayOf<Type>(OfficialSumModel::class.java),
+                        CusNewMsgBean::class.java,
+                        CusNewMsgBean::class.java
+                    )
+                    parserModel = gson.fromJson(resultString,parameterizedTypeImpl)
+                }
             }
             parserModel?.v2TIMMessage = v2TIMMessage
         }catch (e:Exception){

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

@@ -246,6 +246,27 @@ 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
+    /**
+     * 系统消息
+     * */
+    const val system_message = 509
+
 
     /**********游戏相关IM********/
     const val fruit_game = 1001

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

@@ -12,9 +12,12 @@ 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,
+    val android_app_version:String = "",
     val store_url:String="",//应用时长地址
     val link_url:String="",//渠道包下载地址
     val upgrade:String="",//版本描述

+ 9 - 1
baseswago/src/main/java/com/swago/baseswago/model/UnreadMessageVm.kt

@@ -6,11 +6,19 @@ import com.swago.baseswago.util.BaseViewModel
 
 class UnreadMessageVm (application: Application) : BaseViewModel(application){
 
+    var imMessage = 0L
+    var systemMessage = 0L
+
     val unreadMessageData by lazy {
         MutableLiveData<Long>()
     }
 
     fun setTotalUnreadCount(count: Long) {
-        unreadMessageData.value = count
+        imMessage = count
+        unreadMessageData.value = imMessage + systemMessage
+    }
+    fun setSystemUnreadCount(count: Long){
+        systemMessage = count
+        unreadMessageData.value = imMessage + systemMessage
     }
 }

+ 3 - 1
baseswago/src/main/java/com/swago/baseswago/model/home/OfficialSumModel.kt

@@ -7,5 +7,7 @@ package com.swago.baseswago.model.home
 data class OfficialSumModel(
     val message_content:String,
     val unread_total:String,
-    val message_time:String
+    val message_time:String,
+    val userId:String,
+    val unreadTotal:Long
 )

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

@@ -5,4 +5,6 @@ class GamePrize:IPiaoTiao{
     val senderId:String=""
     val gameName:String=""
     val coin:String=""
+    val headSpecial:String=""
+    val userHeadImgUrl: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;
+    }
 }

+ 4 - 2
baseswago/src/main/java/com/swago/baseswago/util/DianJiuUtil.kt

@@ -42,8 +42,10 @@ object DianJiuUtil {
     fun ninePatchImageDrawable(context: Context, bitmap: Bitmap, drawable: (e: NinePatchDrawable?) -> Unit) {
         bitmap.density = 480
         val chunk = bitmap.ninePatchChunk
-        if (NinePatch.isNinePatchChunk(chunk)){
-            drawable.invoke(NinePatchDrawable(context.resources,bitmap,chunk,NinePatchChunk.deserialize(chunk)?.mPaddings,null))
+        chunk?.let {
+            if (NinePatch.isNinePatchChunk(chunk)){
+                drawable.invoke(NinePatchDrawable(context.resources,bitmap,chunk,NinePatchChunk.deserialize(chunk)?.mPaddings,null))
+            }
         }
         drawable.invoke(null)
     }

+ 16 - 1
baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt

@@ -1,6 +1,7 @@
 package com.swago.baseswago.util
 
 import android.app.Application
+import android.os.Build
 import java.io.*
 import java.lang.Exception
 import java.util.*
@@ -23,6 +24,9 @@ object FileUtil {
     }
 
     fun upZipFile(zipFile: String, zipUpPath: String) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
+            dalvik.system.ZipPathValidator.clearCallback()
+        }
         if (zipFile.isEmpty()) return
         if (!zipFile.endsWith(".zip")) {
             deleteFile(File(zipFile))
@@ -94,9 +98,20 @@ object FileUtil {
                 }
             }
             val ret = File(lastDir, dirs[dirs.size - 1])
+            validatePath(ret,baseDir)
             ret
         } else {
-            File(baseDir, absFileName)
+            val ret = File(baseDir, absFileName)
+            validatePath(ret, baseDir)
+            ret
+        }
+    }
+
+    private fun validatePath(file: File, baseDir: String) {
+        val canonicalBasePath = File(baseDir).canonicalPath
+        val canonicalFilePath = file.canonicalPath
+        if (!canonicalFilePath.startsWith("$canonicalBasePath${File.separator}")) {
+            throw IOException("Entry is outside of the target dir: ${file.path}")
         }
     }
 

+ 5 - 15
baseswago/src/main/java/com/swago/baseswago/util/IMUtil.kt

@@ -89,21 +89,11 @@ object IMUtil {
     /**
      * 未读消息数
      * */
-    fun updateUnreadMessageCount(call:(total:Long)->Unit){
-        V2TIMManager.getConversationManager().getTotalUnreadMessageCount(object :V2TIMValueCallback<Long>{
-            override fun onSuccess(totalUnreadCount: Long) {
-                call.invoke(totalUnreadCount)
-            }
-
-            override fun onError(code: Int, desc: String?) {
+    fun updateUnreadMessageCount(conversationListener: V2TIMConversationListener){
+        V2TIMManager.getConversationManager().addConversationListener(conversationListener)
+    }
 
-            }
-        })
-        V2TIMManager.getConversationManager().addConversationListener(object :V2TIMConversationListener(){
-            override fun onTotalUnreadMessageCountChanged(totalUnreadCount: Long) {
-                super.onTotalUnreadMessageCountChanged(totalUnreadCount)
-                call.invoke(totalUnreadCount)
-            }
-        })
+    fun removeConversationListener(conversationListener: V2TIMConversationListener){
+        V2TIMManager.getConversationManager().removeConversationListener(conversationListener)
     }
 }

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

@@ -14,7 +14,7 @@ import java.util.*
  *description:
  */
 object SwagoInfo {
-    var key = "MTQwMzQ1Njc4OWFiY2RlZzAxNTRzZGhzb3NqZGNkZWY="
+    var key = "MTQwMzQ1Njc4OWFiY2RlZzAxNTM0NzI4MjM5ZGNrZGg="
     private var versionCode = ""
     private var languageCode = "en"
     var languageId = 0

+ 2 - 1
baseswago/src/main/java/com/swago/baseswago/util/SwagoRefreshUtil.kt

@@ -4,6 +4,7 @@ import androidx.recyclerview.widget.RecyclerView
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.loadmore.SimpleLoadMoreView
+import com.swago.baseswago.cusview.CustomLoadMoreView
 import com.zy.multistatepage.MultiStateContainer
 import com.zy.multistatepage.state.EmptyState
 import com.zy.multistatepage.state.ErrorState
@@ -38,7 +39,7 @@ class SwagoRefreshUtil<T>(
         adapter.setEnableLoadMore(isNeedLoadMore)
         if (isNeedLoadMore) {
             adapter.setPreLoadNumber(preLoadPage)
-            val loadMoreView = SimpleLoadMoreView()
+            val loadMoreView = CustomLoadMoreView()
             adapter.setLoadMoreView(loadMoreView)
             loadMoreView.setLoadMoreEndGone(true)
             adapter.setOnLoadMoreListener({

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

@@ -1,6 +1,9 @@
 package com.swago
 
 import android.content.Context
+import android.graphics.Bitmap
+import android.graphics.drawable.BitmapDrawable
+import android.graphics.drawable.Drawable
 import android.os.Build
 import android.text.BidiFormatter
 import android.text.TextDirectionHeuristics
@@ -8,8 +11,14 @@ 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
 import java.util.*
@@ -36,6 +45,45 @@ fun ImageView.loadUrl(context: Context,url:String){
         .into(this)
 }
 
+fun ImageView.loadNoPlaceUrl(context: Context,url:String,call: (success:Boolean) -> Unit){
+    Glide.with(context)
+        .asBitmap()
+        .load(url)
+        .centerCrop()
+        .listener(object :RequestListener<Bitmap>{
+            override fun onLoadFailed(
+                e: GlideException?,
+                model: Any?,
+                target: Target<Bitmap>?,
+                isFirstResource: Boolean
+            ): Boolean {
+                call.invoke(false)
+                return false
+            }
+
+            override fun onResourceReady(
+                resource: Bitmap?,
+                model: Any?,
+                target: Target<Bitmap>?,
+                dataSource: DataSource?,
+                isFirstResource: Boolean
+            ): Boolean {
+                call.invoke(true)
+                return false
+            }
+
+        })
+        .into(object : CustomTarget<Bitmap>(){
+            override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
+                background = BitmapDrawable(context.resources,resource)
+            }
+
+            override fun onLoadCleared(placeholder: Drawable?) {
+
+            }
+        })
+}
+
 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>

+ 60 - 0
baseswago/src/main/res/layout/custom_view_load_more.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="@dimen/dp_40">
+
+    <LinearLayout
+        android:id="@+id/load_more_loading_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:orientation="horizontal">
+
+        <ProgressBar
+            android:id="@+id/loading_progress"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            style="?android:attr/progressBarStyleSmall"
+            android:layout_marginRight="@dimen/dp_4"/>
+
+        <TextView
+            android:id="@+id/loading_text"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/dp_4"
+            android:text="@string/loading"
+            android:textColor="@android:color/black"
+            android:textSize="@dimen/sp_14"/>
+    </LinearLayout>
+
+    <FrameLayout
+        android:id="@+id/load_more_load_fail_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone">
+
+
+        <TextView
+            android:id="@+id/tv_prompt"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="@string/Load_data_error"/>
+
+    </FrameLayout>
+
+    <FrameLayout
+        android:id="@+id/load_more_load_end_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:text="@string/There_is_nothing_here"
+            android:textColor="@android:color/darker_gray"/>
+    </FrameLayout>
+</FrameLayout>

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


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


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

@@ -171,7 +171,7 @@
     <string name="remaining_time_of_ban">الوقت المتبقي حظر من البث</string>
     <string name="got_it">يفهم</string>
     <string name="force_closed_by_admin">تم إغلاق غرفة البث الخاصة بك من قبل المسؤول</string>
-    <string name="game_prize">%s ربح للتو%s عملات معدنية في %s، هذا رائع!</string>
+    <string name="game_prize">محظوظ جدًا، تهانينا لـ  %s  في لعبة %sلفوزها بالعملات الذهبية %s !</string>
     <string name="select_pk_anchor">اختر مضيف PK</string>
     <string name="please_enter_the_host_id_name">الرجاء إدخال ايدي المضيف</string>
     <string name="invite_pk">دعوة PK</string>
@@ -230,8 +230,8 @@
     <string name="do_you_confirm_change_pwd">هل تتأكد من تغيير الباسورد؟</string>
     <string name="red_bag_detail">تلقي تفاصيل المغلف الأحمر</string>
     <string name="lucky_best">تسليم اكثر</string>
-    <string name="red_bg_piao_tiao">أرسل %s مظروفًا أحمر، وسيكون جاهزًا للتسليم في 30 ثانية، يرجى الاستعداد!</string>
-    <string name="red_bg_piao_tiao_big">أرسل %s مظروفًا أحمر في روم %s، وسيكون جاهزًا للتسليم في 30 ثانية، يرجى الاستعداد!</string>
+    <string name="red_bg_piao_tiao">أرسل %s مظروفًا أحمر، وسيكون جاهزًا للتسليم في 60 ثانية، يرجى الاستعداد!</string>
+    <string name="red_bg_piao_tiao_big">أرسل %s مظروفًا أحمر في روم %s، وسيكون جاهزًا للتسليم في 60 ثانية، يرجى الاستعداد!</string>
     <string name="please_input_new_pwd">الرجاء إدخال كلمة مرور جديدة</string>
     <string name="enter_current_password">الرجاء دخل الباسورد القديم</string>
     <string name="current_password">الباسورد الحالي</string>
@@ -324,4 +324,13 @@
     <string name="no_time_limit">لا يوجد حد زمني</string>
     <string name="already_owned">مملوكة</string>
     <string name="using">استخدام</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="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>

+ 14 - 5
baseswago/src/main/res/values-in/strings.xml

@@ -126,9 +126,9 @@
     <string name="live_room_black">Daftar hitam live room</string>
     <string name="anchor_black">Daftar hitam host</string>
     <string name="edit">mengubah</string>
-    <string name="level">tingkatan</string>
-    <string name="withdrawal">withdraw</string>
-    <string name="top_up">isi ulang</string>
+    <string name="level">Tingkatan</string>
+    <string name="withdrawal">Withdraw</string>
+    <string name="top_up">Isi ulang</string>
     <string name="app_settings">App Settings</string>
     <string name="nickname">Nickname</string>
     <string name="confirm">Konfirmasi</string>
@@ -234,8 +234,8 @@
     <string name="do_you_confirm_change_pwd">Yakin ubah kata sandi?</string>
     <string name="red_bag_detail">Rincian ampau yg diterima</string>
     <string name="lucky_best">Paling beruntung</string>
-    <string name="red_bg_piao_tiao">%s bagi ampau,stlh 30 detik mulai rebut,siapkan dlu.</string>
-    <string name="red_bg_piao_tiao_big">%s bagi satu ampau di room %s,stlh 30 detik mulai rebut,siapkan dlu.</string>
+    <string name="red_bg_piao_tiao">%s bagi ampau,stlh 60 detik mulai rebut,siapkan dlu.</string>
+    <string name="red_bg_piao_tiao_big">%s bagi satu ampau di room %s,stlh 60 detik mulai rebut,siapkan dlu.</string>
     <string name="please_input_new_pwd">Masukan pw baru</string>
     <string name="enter_current_password">Masukkan pw skrg</string>
     <string name="current_password">Pw skrg</string>
@@ -328,4 +328,13 @@
     <string name="no_time_limit">Tidak ada batas waktu</string>
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</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="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>

+ 15 - 6
baseswago/src/main/res/values-ms/strings.xml

@@ -126,10 +126,10 @@
     <string name="live_room_black">senarai hitam siaran langsung</string>
     <string name="anchor_black">senarai hitam host</string>
     <string name="edit">edit</string>
-    <string name="level">tahap</string>
-    <string name="withdrawal">pengeluaran</string>
-    <string name="top_up">tambah nilai</string>
-    <string name="app_settings">sediakan</string>
+    <string name="level">Tahap</string>
+    <string name="withdrawal">Pengeluaran</string>
+    <string name="top_up">Tambah nilai</string>
+    <string name="app_settings">Sediakan</string>
     <string name="nickname">nama pangilan</string>
     <string name="confirm">mengesahkan</string>
     <string name="say_hi">kata hi</string>
@@ -231,8 +231,8 @@
     <string name="do_you_confirm_change_pwd">Adakah anda pasti mahu menukar kata laluan anda?</string>
     <string name="red_bag_detail">Butiran sampul merah</string>
     <string name="lucky_best">paling bertuah</string>
-    <string name="red_bg_piao_tiao">%s menghantar sampul merah, dan ia akan direbut dalam masa 30-an, sila bersedia!</string>
-    <string name="red_bg_piao_tiao_big">%s menghantar sampul merah dalam bilik siaran langsung %s, dan ia akan mula meraih selepas 30-an, sila bersedia!</string>
+    <string name="red_bg_piao_tiao">%s menghantar sampul merah, dan ia akan direbut dalam masa 60-an, sila bersedia!</string>
+    <string name="red_bg_piao_tiao_big">%s menghantar sampul merah dalam bilik siaran langsung %s, dan ia akan mula meraih selepas 60-an, sila bersedia!</string>
     <string name="please_input_new_pwd">请输入新密码</string>
     <string name="enter_current_password">Enter current password</string>
     <string name="current_password">Current password</string>
@@ -325,4 +325,13 @@
     <string name="no_time_limit">Tidak ada batas waktu</string>
     <string name="already_owned">dimiliki</string>
     <string name="using">digunakan</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="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>

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

@@ -230,8 +230,8 @@
     <string name="do_you_confirm_change_pwd">您确定要修改您的密码么?</string>
     <string name="red_bag_detail">查看红包领取详情</string>
     <string name="lucky_best">手气最佳</string>
-    <string name="red_bg_piao_tiao">%s发出了一个红包,30s后开抢,请做好准备!</string>
-    <string name="red_bg_piao_tiao_big">%s在%s的直播间发出了一个红包,30s后开抢,请做好准备!</string>
+    <string name="red_bg_piao_tiao">%s发出了一个红包,60s后开抢,请做好准备!</string>
+    <string name="red_bg_piao_tiao_big">%s在%s的直播间发出了一个红包,60s后开抢,请做好准备!</string>
     <string name="please_input_new_pwd">请输入新密码</string>
     <string name="enter_current_password">请输入当前密码</string>
     <string name="current_password">当前密码</string>
@@ -324,4 +324,13 @@
     <string name="no_time_limit">不限时间</string>
     <string name="already_owned">已拥有</string>
     <string name="using">使用中</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="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>

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

@@ -252,8 +252,8 @@
     <string name="do_you_confirm_change_pwd">sure you want to change your password?</string>
     <string name="red_bag_detail">View details of red envelope receivement </string>
     <string name="lucky_best">luckiest</string>
-    <string name="red_bg_piao_tiao">%s sent out a red envelope, and it will be up for grabs in 30s, please get ready!</string>
-    <string name="red_bg_piao_tiao_big">%s sent out a red envelope in %s\'s live broadcast room, it will be up for grabs in 30s, please get ready!</string>
+    <string name="red_bg_piao_tiao">%s sent out a red envelope, and it will be up for grabs in 60s, please get ready!</string>
+    <string name="red_bg_piao_tiao_big">%s sent out a red envelope in %s\'s live broadcast room, it will be up for grabs in 60s, please get ready!</string>
     <string name="please_input_new_pwd">please input new password </string>
     <string name="enter_current_password">Enter current password</string>
     <string name="current_password">Current password</string>
@@ -332,7 +332,7 @@
     <string name="Password_rooms_do_not_count_as_hours">Lock room times didn\'t count into</string>
     <string name="clear_cache">clear cache</string>
     <string name="clear_cache_success">Clearance successful</string>
-    <string name="dress_up">my decorations</string>
+    <string name="dress_up">My decorations</string>
     <string name="mall">Mall</string>
     <string name="buy_it_now">Buy it now</string>
     <string name="entrance_effects">Entrance effects</string>
@@ -346,4 +346,13 @@
     <string name="no_time_limit">No time limit</string>
     <string name="already_owned">owned</string>
     <string name="using">using</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="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 {
@@ -15,7 +15,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'

+ 2 - 2
home/build.gradle

@@ -5,11 +5,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
+    compileSdkVersion 34
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 

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

@@ -29,6 +29,7 @@ import com.swago.home.databinding.ActivityHomeBinding
 import com.swago.home.innerhome.HomeVm
 import com.swago.home.official.OfficialVm
 import com.swago.home.update.UpdateDialog
+import com.tencent.imsdk.v2.V2TIMConversationListener
 import com.tencent.qcloud.tim.uikit.TUIKit
 import com.tencent.qcloud.tim.uikit.base.IUIKitCallBack
 import com.tencent.qcloud.tim.uikit.config.TUIKitConfigs
@@ -48,6 +49,8 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
     private val homeVm by viewModels<HomeVm>()
     private val payVm by viewModels<PayVm>()
     private lateinit var unreadMessageVm: UnreadMessageVm
+    private var messageFragment: MessageFragment? = null
+    private var conversationListener: V2TIMConversationListener?=null
 
     private val listFragment =
         arrayListOf(HomeFragment(), MessageFragment(), MineFragment())
@@ -58,12 +61,13 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
 
     override fun initOther() {
         unreadMessageVm = ViewModelProviderUtil.getUnreadMessageViewModel(application)
-        TUIKit.init(this, UrlConstant.getImId(), TUIKitConfigs.getConfigs())
+        TUIKit.init(application, UrlConstant.getImId(), TUIKitConfigs.getConfigs())
         PayManager.init()
         IMMessageManager.groupMessageParser.add(GroupMsgParser())
 
         //检查版本更新
         checkVersionForUpdate()
+        messageFragment = listFragment[1] as MessageFragment
 
         binding.viewPager.offscreenPageLimit = 3
         binding.rg.setOnCheckedChangeListener { _, checkedId ->
@@ -72,6 +76,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
                     binding.viewPager.currentItem = 0
                 }
                 R.id.rbMessage -> {
+                    messageFragment?.setMessageSum()
                     binding.viewPager.currentItem = 1
                 }
                 R.id.rbMine -> {
@@ -128,7 +133,21 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
             }
 
         }
-
+        conversationListener = object : V2TIMConversationListener(){
+            override fun onTotalUnreadMessageCountChanged(totalUnreadCount: Long) {
+                super.onTotalUnreadMessageCountChanged(totalUnreadCount)
+                val systemCount = SpUtil.readString("systemCount")
+                if (!systemCount.isNullOrEmpty()){
+                    unreadMessageVm.systemMessage = systemCount.toLong()
+                }
+                unreadMessageVm.setTotalUnreadCount(totalUnreadCount)
+            }
+        }
+        IMUtil.updateUnreadMessageCount(conversationListener!!)
+        homeVm.systemMessageFun = {
+            SpUtil.putString("systemCount" , it.unreadTotal.toString())
+            unreadMessageVm.setSystemUnreadCount(it.unreadTotal)
+        }
     }
 
     /**
@@ -253,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)
                 }
@@ -281,9 +300,6 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
                 IUIKitCallBack {
                 override fun onSuccess(data: Any?) {
                     IMUtil.joinGroup(null)
-                    IMUtil.updateUnreadMessageCount {unread->
-                        unreadMessageVm.setTotalUnreadCount(unread)
-                    }
                 }
 
                 override fun onError(module: String?, errCode: Int, errMsg: String?) {
@@ -297,4 +313,11 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
             })
         }
     }
+    override fun onDestroy() {
+        super.onDestroy()
+        if (conversationListener != null) {
+            IMUtil.removeConversationListener(conversationListener!!)
+            conversationListener = null
+        }
+    }
 }

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

@@ -5,6 +5,7 @@ import android.content.Context
 import android.content.Intent
 import android.graphics.Color
 import android.graphics.Typeface
+import android.os.Build
 import android.widget.Toast
 import androidx.viewpager.widget.ViewPager
 import com.alibaba.android.arouter.launcher.ARouter
@@ -107,7 +108,8 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
             override fun onClick() {
                 binding.ivLive.isEnabled = false
                 PermissionX.init(this@HomeFragment)
-                    .permissions(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
+                    .permissions(Manifest.permission.CAMERA,
+                        Manifest.permission.RECORD_AUDIO)
                     .request { allGranted, grantedList, deniedList ->
                         if (allGranted) {
                             ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
@@ -115,7 +117,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()
                         }

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

@@ -40,7 +40,7 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
     private var jumpDetail = true
 
     override fun loadData() {
-        officialVm.getMsgSum()
+
     }
 
     override fun initOther() {
@@ -55,7 +55,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()
                     }
@@ -111,6 +111,12 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
         }
     }
 
+     fun setMessageSum(){
+         if (isAdded){
+             officialVm.getMsgSum()
+         }
+     }
+
     override fun onResume() {
         super.onResume()
         jumpDetail = true

+ 14 - 0
home/src/main/java/com/swago/home/innerhome/HomeVm.kt

@@ -4,11 +4,13 @@ import android.app.Application
 import androidx.lifecycle.MutableLiveData
 import com.swago.baseswago.http.SwagoException
 import com.swago.baseswago.im.IMGroupNewMsgListener
+import com.swago.baseswago.im.ImConstant
 import com.swago.baseswago.im.ImConstant.change_user_name
 import com.swago.baseswago.im.ImConstant.close_account
 import com.swago.baseswago.inter.ApiManager
 import com.swago.baseswago.model.MomentModel
 import com.swago.baseswago.model.home.BannerModel
+import com.swago.baseswago.model.home.OfficialSumModel
 import com.swago.baseswago.model.im.ChangeNameData
 import com.swago.baseswago.model.im.CloseAccountData
 import com.swago.baseswago.model.im.CusNewMsgBean
@@ -24,6 +26,7 @@ class HomeVm(application: Application) : BaseViewModel(application) {
     var closeAccountFun:((data: CloseAccountData) -> Unit)? = null
 
     val imGroupNewMsgListener = IMGroupNewMsgListener()
+    var systemMessageFun:((data: OfficialSumModel) -> Unit)? = null
 
     init {
         imGroupNewMsgListener.attach()
@@ -44,6 +47,17 @@ class HomeVm(application: Application) : BaseViewModel(application) {
 
             }
         }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<OfficialSumModel>>(
+            ImConstant.system_message
+        ){
+            it.data?.let {model ->
+                UserInfo.getUserInfo()?.let { userInfo ->
+                    if (model.userId == userInfo.id){
+                        systemMessageFun?.invoke(model)
+                    }
+                }
+            }
+        }
     }
 
     override fun onCleared() {

+ 7 - 0
home/src/main/java/com/swago/home/official/OfficialMessageActivity.kt

@@ -6,8 +6,11 @@ import androidx.recyclerview.widget.RecyclerView
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.swago.baseswago.activity.BaseListActivity
 import com.swago.baseswago.cusview.SwagoRecyclerView
+import com.swago.baseswago.model.UnreadMessageVm
+import com.swago.baseswago.model.ViewModelProviderUtil
 import com.swago.baseswago.model.home.OfficialMsgModel
 import com.swago.baseswago.util.AppContext
+import com.swago.baseswago.util.SpUtil
 import com.swago.home.R
 import com.swago.home.databinding.ActivityOfficialMessageBinding
 
@@ -18,6 +21,7 @@ import com.swago.home.databinding.ActivityOfficialMessageBinding
 class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding, OfficialMsgModel.ListBean>() {
 
     private val officialVm by viewModels<OfficialVm>()
+    private lateinit var unreadMessageVm: UnreadMessageVm
 
     override val smartRecyclerView: SwagoRecyclerView<OfficialMsgModel.ListBean> by lazy {
         binding.swagoRv as SwagoRecyclerView<OfficialMsgModel.ListBean>
@@ -45,5 +49,8 @@ class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding,
                 smartRecyclerView.onFetchDataFinish(it,true)
             }
         }
+        unreadMessageVm = ViewModelProviderUtil.getUnreadMessageViewModel(application)
+        unreadMessageVm.setSystemUnreadCount(0)
+        SpUtil.putString("systemCount" , "0")
     }
 }

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

@@ -15,21 +15,21 @@
 
     <ImageView
         android:id="@+id/ivLive"
-        android:layout_marginEnd="8dp"
-        android:layout_marginTop="8dp"
+        android:layout_marginEnd="10dp"
+        android:layout_marginTop="10dp"
         app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        android:layout_width="18dp"
-        android:layout_height="18dp"/>
+        app:layout_constraintRight_toRightOf="parent"
+        android:layout_width="28dp"
+        android:layout_height="28dp"/>
 
     <ImageView
         android:id="@+id/ivPassword"
         android:layout_width="22dp"
         android:layout_height="15dp"
-        android:layout_marginTop="8dp"
-        android:layout_marginStart="8dp"
-        app:layout_constraintTop_toTopOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
+        android:layout_marginTop="10dp"
+        android:layout_marginStart="10dp"
+        app:layout_constraintTop_toTopOf="@+id/ivLive"
+        app:layout_constraintLeft_toLeftOf="parent"
         android:src="@mipmap/ic_live_lock"
         android:visibility="gone"/>
 

+ 3 - 2
home/src/main/res/layout/item_official.xml

@@ -24,12 +24,13 @@
         android:layout_marginTop="10dp"
         android:layout_marginEnd="15dp"
         android:layout_marginStart="15dp"
-        android:textSize="12dp"
+        android:textSize="12sp"
         android:textColor="#aaaaaa"
         tools:text="dsdsd"
+        android:textDirection="locale"
         app:layout_constraintTop_toBottomOf="@+id/tvTitle"
         app:layout_constraintStart_toStartOf="parent"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"/>
 
     <com.swago.baseswago.cusview.MediumTextView

+ 2 - 2
lib_country_picker/build.gradle

@@ -4,11 +4,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
+    compileSdkVersion 34
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 

+ 0 - 32
lib_country_picker/src/main/assets/code.json

@@ -327,14 +327,6 @@
     "locale": "CR",
     "tc": "哥斯達黎加"
   },
-  {
-    "sc": "古巴",
-    "code": 53,
-    "pinyin": "GUBA",
-    "en": "Cuba",
-    "locale": "CU",
-    "tc": "古巴"
-  },
   {
     "sc": "塞浦路斯",
     "code": 357,
@@ -599,14 +591,6 @@
     "locale": "ID",
     "tc": "印度尼西亞"
   },
-  {
-    "sc": "伊朗",
-    "code": 98,
-    "pinyin": "YILANG",
-    "en": "Iran",
-    "locale": "IR",
-    "tc": "伊朗"
-  },
   {
     "sc": "伊拉克",
     "code": 964,
@@ -999,14 +983,6 @@
     "locale": "NG",
     "tc": "尼日利亞"
   },
-  {
-    "sc": "朝鲜",
-    "code": 850,
-    "pinyin": "CHAOXIAN",
-    "en": "North Korea",
-    "locale": "KP",
-    "tc": "朝鮮"
-  },
   {
     "sc": "挪威",
     "code": 47,
@@ -1335,14 +1311,6 @@
     "locale": "CH",
     "tc": "瑞士"
   },
-  {
-    "sc": "叙利亚",
-    "code": 963,
-    "pinyin": "XULIYA",
-    "en": "Syria",
-    "locale": "SY",
-    "tc": "敘利亞"
-  },
   {
     "sc": "中国台湾",
     "code": 886,

+ 2 - 2
login/build.gradle

@@ -5,11 +5,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
+    compileSdkVersion 34
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 

+ 5 - 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()
                 }
 
@@ -44,6 +44,10 @@ object FBLogin {
         LoginManager.getInstance().logInWithReadPermissions(activity, listOf("public_profile"))
     }
 
+    fun unregisterCallback(){
+        LoginManager.getInstance().unregisterCallback(manager)
+    }
+
     fun onActivityResult(requestCoe: Int, resultCode: Int, data: Intent) {
         manager.onActivityResult(requestCoe, resultCode, data)
     }

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

@@ -58,7 +58,25 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
         binding.clFaceBook.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {
                 if (SwagoShareUtils.isInstall(this@LoginActivity,FACEBOOK)){
-                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
+                        PermissionX.init(this@LoginActivity)
+                            .permissions(
+                                Manifest.permission.READ_MEDIA_IMAGES,
+                                Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
+                            )
+                            .request { allGranted, grantedList, deniedList ->
+                                if (allGranted) {
+                                    FBLogin.login(this@LoginActivity)
+                                } else {
+                                    FBLogin.login(this@LoginActivity)
+                                    Toast.makeText(
+                                        this@LoginActivity,
+                                        AppContext.getContext().resources.getString(R.string.these_permissions_denied)+ "$deniedList",
+                                        Toast.LENGTH_LONG
+                                    ).show()
+                                }
+                            }
+                    }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
                         PermissionX.init(this@LoginActivity)
                             .permissions(
                                 Manifest.permission.READ_MEDIA_IMAGES
@@ -70,7 +88,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     FBLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        AppContext.getContext().resources.getString(R.string.these_permissions_denied)+ "$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -87,7 +105,7 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
                                     FBLogin.login(this@LoginActivity)
                                     Toast.makeText(
                                         this@LoginActivity,
-                                        "These permissions are denied: $deniedList",
+                                        AppContext.getContext().resources.getString(R.string.these_permissions_denied)+ "$deniedList",
                                         Toast.LENGTH_LONG
                                     ).show()
                                 }
@@ -102,7 +120,25 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
         binding.clGoogle.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {
                 if (SwagoShareUtils.isInstall(this@LoginActivity,GOOGLE)) {
-                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
+                        PermissionX.init(this@LoginActivity)
+                            .permissions(
+                                Manifest.permission.READ_MEDIA_IMAGES,
+                                Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
+                            )
+                            .request { allGranted, grantedList, deniedList ->
+                                if (allGranted) {
+                                    GoogleLogin.login(this@LoginActivity)
+                                } else {
+                                    GoogleLogin.login(this@LoginActivity)
+                                    Toast.makeText(
+                                        this@LoginActivity,
+                                        getString(R.string.these_permissions_denied)+"$deniedList",
+                                        Toast.LENGTH_LONG
+                                    ).show()
+                                }
+                            }
+                    }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
                         PermissionX.init(this@LoginActivity)
                             .permissions(
                                 Manifest.permission.READ_MEDIA_IMAGES
@@ -114,7 +150,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 +167,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()
                                 }
@@ -183,7 +219,31 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
 
         binding.ivAccountLogin.setOnClickListener(object:NoDoubleClickListener(){
             override fun onClick() {
-                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
+                    PermissionX.init(this@LoginActivity)
+                        .permissions(
+                            Manifest.permission.READ_MEDIA_IMAGES,
+                            Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED
+                        )
+                        .request { allGranted, grantedList, deniedList ->
+                            if (allGranted) {
+                                SwagoLoading.showLoadingDialog(this@LoginActivity)
+                                val account = binding.etAccount.text.toString()
+                                val secret = binding.etSecret.text.toString()
+                                loginVm.loginByAccount(account, secret)
+                            } else {
+                                SwagoLoading.showLoadingDialog(this@LoginActivity)
+                                val account = binding.etAccount.text.toString()
+                                val secret = binding.etSecret.text.toString()
+                                loginVm.loginByAccount(account, secret)
+                                Toast.makeText(
+                                    this@LoginActivity,
+                                    getString(R.string.these_permissions_denied)+" $deniedList",
+                                    Toast.LENGTH_LONG
+                                ).show()
+                            }
+                        }
+                }else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU){
                     PermissionX.init(this@LoginActivity)
                         .permissions(
                             Manifest.permission.READ_MEDIA_IMAGES
@@ -201,7 +261,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 +284,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 +315,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 +323,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()
                         }
@@ -278,4 +338,9 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
             }
         }
     }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        FBLogin.unregisterCallback()
+    }
 }

+ 2 - 2
room/build.gradle

@@ -5,11 +5,11 @@ plugins {
 }
 
 android {
-    compileSdkVersion 33
+    compileSdkVersion 34
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "1.0"
 

+ 2 - 3
room/src/main/AndroidManifest.xml

@@ -14,9 +14,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name=".wishgift.FanClubRuleActivity"
             android:screenOrientation="portrait"/>
-        <activity android:name=".black.BlackRoomActivity"
-            android:screenOrientation="portrait"/>
-        <service android:name=".service.AgoraForegroundService"/>
+        <service android:name=".service.AgoraForegroundService"
+            android:foregroundServiceType="microphone|camera|mediaPlayback"/>
     </application>
 
 </manifest>

BIN
room/src/main/assets/win_1001_prize.svga


BIN
room/src/main/assets/win_101_500_prize.svga


BIN
room/src/main/assets/win_501_1000_prize.svga


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

@@ -51,9 +51,6 @@ import com.swago.room.lianmai.LianMaiVm
 import com.swago.room.pk.IPKListener
 import com.swago.room.pk.PKStateManager
 import com.swago.room.pk.PkVm
-import com.swago.room.service.AgoraForegroundService
-import com.swago.room.service.AgoraForegroundService.ACTION_START_FOREGROUND_SERVICE
-import com.swago.room.service.AgoraForegroundService.ACTION_STOP_FOREGROUND_SERVICE
 import com.swago.room.vm.MsgVm
 import com.swago.room.vm.RoomOtherVm
 import com.swago.room.vm.RoomVm
@@ -76,8 +73,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
     private val pkVm by viewModels<PkVm>()
     private val lianMaiVm by viewModels<LianMaiVm>()
 
-    private var agoraService: Intent? = null
-
     private val fragments = arrayListOf(NoContentFragment(), AnchorRoomFragment())
 
     private val adapter = SwagoAdapter(fragments, supportFragmentManager)
@@ -109,7 +104,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
         AudioRoomManager.addListener(this)
         initPeerAnchorLayoutParams()
         window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
-        agoraService = Intent(this, AgoraForegroundService::class.java)
         AgoraManager.initializeEngine(this, this)
         AgoraManager.setVideoConfiguration()
         AgoraManager.setVideoAudio(pullVideo = true, pullAudio = true, pushVideo = true, pushAudio = true)
@@ -214,7 +208,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()
                             }
@@ -376,25 +370,16 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
 
     override fun onResume() {
         super.onResume()
-        agoraService?.let {
-            it.action = ACTION_STOP_FOREGROUND_SERVICE
-            startService(it)
-        }
     }
 
     override fun onPause() {
         super.onPause()
-        agoraService?.let {
-            it.action = ACTION_START_FOREGROUND_SERVICE
-            startService(it)
-        }
     }
 
     override fun onDestroy() {
         anchorCloseDialog = null
         PKStateManager.removePKListener(this)
         AudioRoomManager.removeListener(this)
-        agoraService?.let { stopService(it) }
         super.onDestroy()
     }
 

+ 0 - 2
room/src/main/java/com/swago/room/audio/AudioSeatAdapter.kt

@@ -1,6 +1,5 @@
 package com.swago.room.audio
 
-import android.graphics.drawable.Drawable
 import android.view.View
 import com.chad.library.adapter.base.BaseQuickAdapter
 import com.chad.library.adapter.base.BaseViewHolder
@@ -10,7 +9,6 @@ import com.opensource.svgaplayer.SVGAParser
 import com.opensource.svgaplayer.SVGAVideoEntity
 import com.swago.baseswago.cusview.SwagoImageView
 import com.swago.baseswago.model.live.audio.AudioSeatModel
-import com.swago.baseswago.util.LogUtil
 import com.swago.room.R
 import java.net.URL
 

+ 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()
                                 }

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

@@ -58,6 +58,7 @@ import com.swago.room.databinding.FragmentBaseComBinding
 import com.swago.room.dialog.AudienceListDialog
 import com.swago.room.dialog.FanClubAnchorDialog
 import com.swago.room.dialog.FanClubForUserDialog
+import com.swago.room.dialog.FooterMoreDialog
 import com.swago.room.dialog.JoinFanClubDialog
 import com.swago.room.dialog.LevelUpDialog
 import com.swago.room.dialog.MessageListDialog
@@ -225,7 +226,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 {
@@ -295,7 +296,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()
                                                 }
@@ -669,6 +670,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() {

+ 4 - 2
room/src/main/java/com/swago/room/game/GamePlayDialog.kt

@@ -29,6 +29,7 @@ import com.swago.baseswago.util.*
 import com.swago.room.R
 import com.swago.room.bean.UserRoomModel
 import com.swago.room.databinding.DialogGamePlayBinding
+import com.tencent.qcloud.tim.uikit.utils.ScreenUtil
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
@@ -83,6 +84,7 @@ class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListe
         SwagoRoomManager.addListener(this)
         arguments?.let {
             url = it.getString(URL, "")
+            gameType = it.getString(GAME_TYPE,"")
             if (url.startsWith("file://")){
                 localGameUrl = url
             }
@@ -95,9 +97,9 @@ class GamePlayDialog : BaseXDFragment<DialogGamePlayBinding>(), IRoomActiveListe
                 imageViewLayoutParams.leftToLeft = R.id.cl
                 imageViewLayoutParams.leftMargin = DpPxUtil.dip2px(10f)
                 if (gameType == "9"){
-                    imageViewLayoutParams.bottomMargin = DpPxUtil.dip2px(390f)
+                    imageViewLayoutParams.bottomMargin =  ScreenUtil.getScreenWidth(getActivity())
                 } else {
-                    imageViewLayoutParams.bottomMargin = DpPxUtil.dip2px(340f)
+                    imageViewLayoutParams.bottomMargin = ScreenUtil.getScreenWidth(getActivity()) - ScreenUtil.getPxByDp(40f)
                 }
                 val imageView = ImageView(activity)
                 imageView.setBackgroundResource(R.drawable.shape_80000000_20)

+ 5 - 5
room/src/main/java/com/swago/room/gift/ComboView.kt

@@ -135,17 +135,17 @@ class ComboView : View {
 
     }
 
-    override fun onDraw(canvas: Canvas?) {
+    override fun onDraw(canvas: Canvas) {
         super.onDraw(canvas)
         //画内圆
-        canvas?.drawCircle(centerX,centerY,dp2px(30f),innerPaint)
+        canvas.drawCircle(centerX,centerY,dp2px(30f),innerPaint)
         //画倒计时
 //        canvas?.drawPath(path,anchorPaint)
         //画缩小框
-        canvas?.drawCircle(centerX,centerY,scaleRadius,scalePaint)
+        canvas.drawCircle(centerX,centerY,scaleRadius,scalePaint)
         //画文字
-        canvas?.drawText(combo,centerX-comboRect.width()/2f,dp2px(45f),textComboPaint)
-        canvas?.drawText(time,centerX-timeRect.width()/2f,dp2px(65f),timerPaint)
+        canvas.drawText(combo,centerX-comboRect.width()/2f,dp2px(45f),textComboPaint)
+        canvas.drawText(time,centerX-timeRect.width()/2f,dp2px(65f),timerPaint)
     }
 
     private fun dp2px(value: Float): Float {

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

@@ -81,9 +81,9 @@ class SvgDanDaoView : ConstraintLayout {
             val sendName = "<font color='#FFDB43'>${next.senderName}</font>"
             val giftName = "<font color='#FFDB43'>${localName}</font>"
             val receiverName = "<font color='#FFDB43'>${next.receiverName}</font>"
-            marqueeTextView.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_gift) .format(sendName, giftName, receiverName)}")
+            marqueeTextView.text = Html.fromHtml(AppContext.getContext().resources.getString(R.string.big_gift) .format(sendName, giftName, receiverName))
             marqueeTextView.post {
-                marqueeTextView.startScroll()
+                marqueeTextView.isSelected = true
             }
             animatorSet = createAnim(cl)
             animatorSet?.start()
@@ -102,7 +102,7 @@ class SvgDanDaoView : ConstraintLayout {
             }
 
             override fun onAnimationEnd(animation: Animator) {
-                binding?.marqueeTextView?.stopScroll()
+                binding?.marqueeTextView?.isSelected = false
                 cl.visibility = View.GONE
                 animatorSet = null
                 loopNextWaft()

+ 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

+ 15 - 8
room/src/main/java/com/swago/room/gift/control/XSvgPlayer.kt

@@ -50,11 +50,11 @@ 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 {
+                    binding?.apply {
                         val drawable = SVGADrawable(videoItem)
                         svgaImageView.visibility = View.VISIBLE
                         svgaImageView.setImageDrawable(drawable)
@@ -129,15 +129,22 @@ 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)
+            }
 
         }
     }

+ 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

+ 162 - 66
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,82 +240,60 @@ class GiftDanDaoView : FrameLayout {
                 }
             }
 
-
             clItemGift.removeCallbacks(showRunnable)
             clItemGift.postDelayed(showRunnable, 3000)
             if (imGiftModel.multiple != 0) {
                 when (imGiftModel.multiple) {
-                    in 1..50 -> {
-                        iv.visibility = View.VISIBLE
-                        tvWinPrize2.visibility = View.GONE
-                        svgaWinPrize.visibility = View.GONE
-                        val layoutParams = tvWinPrize.layoutParams as ConstraintLayout.LayoutParams
-                        layoutParams.marginStart = DpPxUtil.dip2px(10f)
-                        tvWinPrize.layoutParams = layoutParams
-                        iv.setImageResource(R.mipmap.win_1_50_prize)
-                        clWinPrize.visibility = View.VISIBLE
-                        tvWinPrize.text =
-                            AppContext.getContext().resources.getString(R.string.win_num_prize)
-                                .format(imGiftModel.multiple)
-                    }
-
-                    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..500 -> {
-                        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)
-                    }
-
-                    in 501..1000 -> {
-                        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)
+                    in 1..99 -> {
+                        ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
+                        ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
+                    }
+
+                    in 100..499 -> {
+                        ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
+                        ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_100_499)
+                    }
+
+                    in 500..999 -> {
+                        ivPrizeBg.setImageResource(R.mipmap.gift_bg_prize_100_499)
+                        ivPrizeFrame.setImageResource(R.mipmap.gift_prize_frame_500_999)
                     }
                     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_1001_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)
                     }
                 }
-
-                clWinPrize.removeCallbacks(winPrizeRunnable)
-                clWinPrize.postDelayed(winPrizeRunnable, 1500)
+                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()
+                    }
+                    if (aniamtionScale?.isRunning ==false){
+                        aniamtionScale?.start()
+                    }
+                    loadGiftPrizeNum(imGiftModel.multiple)
+                }
             }
         }
     }
@@ -287,6 +310,7 @@ class GiftDanDaoView : FrameLayout {
             }
             imageViewData[0].setImageResource(R.mipmap.ic_dan_dao_x)
             llNum.addView(imageViewData[0])
+            llNum.layoutDirection = View.LAYOUT_DIRECTION_LTR
             giftCount.toString().toCharArray().forEachIndexed {  index,char ->
                 when(char){
                     '0' -> {
@@ -325,6 +349,61 @@ 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])
+            llPrizeNum.layoutDirection = View.LAYOUT_DIRECTION_LTR
+            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 +485,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 +572,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()
                             }

+ 3 - 1
room/src/main/java/com/swago/room/manager/JoinRoomManager.kt

@@ -30,6 +30,7 @@ import com.swago.loadUrl
 import com.swago.room.R
 import de.hdodenhof.circleimageview.CircleImageView
 import java.io.File
+import java.lang.ref.WeakReference
 import java.net.URL
 import java.util.LinkedList
 
@@ -59,7 +60,8 @@ class JoinRoomManager : IRoomActiveListener {
 
     fun initViewStub(viewStub: ViewStub?, activity: FragmentActivity?) {
         mActivity = activity
-        svgParser = SVGAParser(mActivity)
+        val activityRef = WeakReference(mActivity)
+        svgParser = SVGAParser(activityRef.get())
         viewStub?.apply {
             val view = this.inflate()
             svgaImageView = view.findViewById(R.id.svgaImageView)

+ 120 - 12
room/src/main/java/com/swago/room/piaotiao/WaftView.kt

@@ -10,18 +10,21 @@ 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.loadUrl
 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.lang.ref.WeakReference
+import java.net.URL
 import java.util.*
 
 /**
@@ -34,7 +37,8 @@ class WaftView : FrameLayout {
 
     private val imGiftModelList = LinkedList<IPiaoTiao>()
     private var binding : ViewWaftBinding? = null
-
+    private var svgaParser:SVGAParser? = null
+    private var context:Context ?= null
     constructor(context: Context) : super(context)
     constructor(context: Context, mAttributeSet: AttributeSet?) : super(context, mAttributeSet){
         initView(context)
@@ -42,6 +46,9 @@ class WaftView : FrameLayout {
 
     private fun initView(context: Context) {
         binding = ViewWaftBinding.inflate(LayoutInflater.from(context), this, true)
+        val activityRef = WeakReference(context)
+        svgaParser = SVGAParser(activityRef.get())
+        this.context = context
     }
 
 
@@ -120,14 +127,40 @@ 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?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_prize).format(sendName,giftName,multiple)}")
+                    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(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?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_gift_msg).format(sendName,giftName,receiverName)}")
+                    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(AppContext.getContext().resources.getString(R.string.big_gift_msg).format(sendName,giftName,receiverName))
+                }
+                if (!next.headSpecial.isNullOrEmpty()){
+                    svgaParser?.decodeFromURL(URL(next.headSpecial), object : SVGAParser.ParseCompletion{
+                        override fun onComplete(videoItem: SVGAVideoEntity) {
+                            val drawable = SVGADrawable(videoItem)
+                            binding?.svgAvatar?.visibility = View.VISIBLE
+                            binding?.svgAvatar?.setImageDrawable(drawable)
+                            binding?.svgAvatar?.startAnimation()
+                        }
+
+                        override fun onError() {
+                        }
+                    })
+                } else {
+                    binding?.svgAvatar?.visibility = View.INVISIBLE
+                }
+                context?.let {
+                    binding?.ivAvatar?.loadUrl(it,next.senderAvatar)
                 }
             }
 
@@ -135,15 +168,89 @@ class WaftView : FrameLayout {
                 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?.ivPrize?.setImageResource(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)}")
+                        binding?.marqueeTextView?.text = Html.fromHtml(AppContext.getContext().resources.getString(R.string.game_prize).format(sendName,coin,gameName))
                     }
                     else -> {
-                        binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.game_prize).format(sendName,gameName,coin)}")
+                        binding?.marqueeTextView?.text = Html.fromHtml(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?.visibility = VISIBLE
+                            binding?.svgAvatar?.setImageDrawable(drawable)
+                            binding?.svgAvatar?.startAnimation()
+                        }
+
+                        override fun onError() {
+                        }
+                    })
+                } else {
+                    binding?.svgAvatar?.visibility = INVISIBLE
+                }
+                context?.let {
+                    binding?.ivAvatar?.loadUrl(it,next.userHeadImgUrl)
+                }
+            }
+            is PiaoTiaoRewardsData -> {
+                when(next.type) {
+                    505 -> {
+                        val sendName = "<font color='#FFDB43'>${next.userName}</font>"
+                        val sort = "<font color='#FFDB43'>${next.sort}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.svgAvatar?.visibility = View.INVISIBLE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.congratulations_to_for_start_of_today).format(sendName,sort))
+                    }
+                    506 -> {
+                        val sendName = "<font color='#FFDB43'>${next.userName}</font>"
+                        val sort = "<font color='#FFDB43'>${next.sort}</font>"
+                        binding?.ivFunction?.visibility = View.VISIBLE
+                        binding?.ivAvatar?.visibility = View.GONE
+                        binding?.svgAvatar?.visibility = View.INVISIBLE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.congratulations_to_for_king_of_game).format(sendName,sort))
+                    }
+                    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?.svgAvatar?.visibility = View.INVISIBLE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml(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?.svgAvatar?.visibility = View.INVISIBLE
+                        binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_function)
+                        binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
+                        binding?.tvPrize?.text = ""
+                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.prize_pool_golden_egg).format(coin))
                     }
                 }
+
             }
 
         }
@@ -152,6 +259,7 @@ class WaftView : FrameLayout {
 
 
         binding?.marqueeTextView?.post {
+            binding?.marqueeTextView?.stopScroll()
             binding?.marqueeTextView?.startScroll()
         }
         binding?.let {

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

@@ -9,13 +9,20 @@ import de.hdodenhof.circleimageview.CircleImageView
 
 class PKAudienceAdapter : BaseQuickAdapter<PKSeat,BaseViewHolder>(R.layout.item_pk_seat, arrayListOf()) {
 
+    var isAudienceMvp:Boolean = false
+    fun setAudienceMvp(){
+        if (data.size > 0){
+            isAudienceMvp = true
+            notifyItemChanged(0)
+        }
+    }
     override fun convert(helper: BaseViewHolder?, item: PKSeat?) {
         helper?.apply {
             item?.let {
                 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,if (isAudienceMvp) R.mipmap.icon_pk_mvp else R.mipmap.first)
                     }
                     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()
     }
 

+ 15 - 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
         }
 
@@ -174,10 +180,12 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
                 3 -> {
                     playPKResultSvg("pk_win.svga")
                     playProgress("laugh.svga")
+                    selfAdapter.setAudienceMvp()
                 }
                 4 -> {
                     playPKResultSvg("pk_fail.svga")
                     playProgress("cry.svga")
+                    peerAdapter.setAudienceMvp()
                 }
                 5 -> {
                     playPKResultSvg("pk_balance.svga")
@@ -254,13 +262,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 +290,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
             }
@@ -337,8 +333,10 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
             tvPunishTime.text = "00:00"
             tvPkTime.text = "00:00"
             selfAdapter.data.clear()
+            selfAdapter.isAudienceMvp = false
             selfAdapter.notifyDataSetChanged()
             peerAdapter.data.clear()
+            peerAdapter.isAudienceMvp = false
             peerAdapter.notifyDataSetChanged()
         }
     }

+ 7 - 2
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搜索对应主播
@@ -112,8 +113,8 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             startPKModel.oppositeAvatar = data.oppositeAvatar
                             startPKModel.oppositeName = data.oppositeUserName
                             startPKModel.oppositeRoomId = data.oppositeRoomId
-                            startPKModel.pkEndTime = startPKModel.pkEndTime
-                            startPKModel.pkResultTime = startPKModel.pkResultTime
+                            startPKModel.pkEndTime = data.pkEndTime
+                            startPKModel.pkResultTime = data.pkResultTime
                             startPKModel.pkId = data.pkId
                             ipkListener.startPK(startPKModel, false)
 
@@ -128,6 +129,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             ipkListener.processChangePK(processPKModel, false)
                         }
                     }
+                    pkState?.invoke(true)
                 }
                 3, 4, 5 -> {
                     if (PKStateManager.roomState != PKStateManager.PUNISH) {
@@ -159,6 +161,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             ipkListener.processChangePK(processPKModel, false)
                         }
                     }
+                    pkState?.invoke(true)
                 }
             }
         }
@@ -234,6 +237,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             PKStateManager.pkIPKListenerList.forEach { ipkListener ->
                                 ipkListener.startPK(it, true)
                             }
+                            pkState?.invoke(true)
                         }
                     }
                 }
@@ -279,6 +283,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             PKStateManager.pkIPKListenerList.forEach { ipkListener ->
                                 ipkListener.stopPK(it)
                             }
+                            pkState?.invoke(false)
                         }
                     }
                 }

+ 10 - 1
room/src/main/java/com/swago/room/service/AgoraForegroundService.java

@@ -6,6 +6,7 @@ import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.app.Service;
 import android.content.Intent;
+import android.content.pm.ServiceInfo;
 import android.graphics.BitmapFactory;
 import android.os.Build;
 import android.os.IBinder;
@@ -96,7 +97,15 @@ public class AgoraForegroundService extends Service {
         // Build the notification.
         Notification notification = builder.build();
         // Start foreground service.
-        startForeground(1, notification);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){
+            int serviceTypes = ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE |
+                    ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA |
+                    ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK;
+            startForeground(1, notification,serviceTypes);
+        } else {
+            startForeground(1, notification);
+        }
+
     }
 
     private void stopForegroundService() {

+ 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)
+            }
+
+        }
     }
 
 

+ 59 - 5
room/src/main/java/com/swago/room/vm/MsgVm.kt

@@ -6,14 +6,18 @@ import com.swago.baseswago.baseroom.IRoomInfo
 import com.swago.baseswago.baseroom.RoleType
 import com.swago.baseswago.baseroom.SwagoRoomManager
 import com.swago.baseswago.baseroom.viewmodel.AbsMsgVm
+import com.swago.baseswago.constant.UrlConstant
 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 +40,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
@@ -57,7 +62,9 @@ import com.swago.baseswago.model.live.audio.*
 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.SwagoInfo
 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
@@ -349,9 +356,9 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
         }
         //游戏中奖飘条
         imGroupNewMsgListener.handleMsgType<CusNewMsgBean<GamePrize>>(game_win_big_prize) {
-            SwagoRoomManager.iRoomInfo?.let { iRoomInfo ->
+            UrlConstant.getConfigModel()?.let { configModel ->
                 it.data?.let {
-                    if (isReady) {
+                    if (isReady && configModel.android_app_version != SwagoInfo.getVersionCode()) {
                         //游戏飘条
                         waftFun?.invoke(it)
                     }
@@ -507,7 +514,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 +536,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 +788,54 @@ class MsgVm(application: Application) : AbsMsgVm(application) {
                 }
             }
         }
-
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(today_star_rewards) {
+            if (isReady) {
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()){
+                        it.data?.let {
+                            it.type = 505
+                            waftFun?.invoke(it)
+                        }
+                    }
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(game_key_rewards) {
+            if (isReady) {
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 506
+                            waftFun?.invoke(it)
+                        }
+                    }
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_rewards) {
+            if (isReady) {
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 507
+                            waftFun?.invoke(it)
+                        }
+                    }
+                }
+            }
+        }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<PiaoTiaoRewardsData>>(break_egg_sum) {
+            if (isReady) {
+                UrlConstant.getConfigModel()?.let { configModel ->
+                    if (configModel.android_app_version != SwagoInfo.getVersionCode()) {
+                        it.data?.let {
+                            it.type = 508
+                            waftFun?.invoke(it)
+                        }
+                    }
+                }
+            }
+        }
     }
 
 

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

@@ -115,10 +115,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
             }

+ 14 - 10
room/src/main/java/com/swago/room/widget/MarqueeTextView.java

@@ -11,6 +11,8 @@ import android.view.animation.LinearInterpolator;
 import android.widget.Scroller;
 import android.widget.TextView;
 
+import com.swago.baseswago.util.LogUtil;
+import com.swago.baseswago.util.SwagoInfo;
 import com.swago.room.R;
 /**
  * @date 2021/7/11 15:44
@@ -41,6 +43,7 @@ public class MarqueeTextView extends TextView {
     private int mScrollMode;
     /** 初次滚动时间间隔 */
     private int mFirstScrollDelay;
+    private boolean isRtl = false;
 
     public MarqueeTextView(Context context) {
         this(context, null);
@@ -63,13 +66,16 @@ public class MarqueeTextView extends TextView {
         typedArray.recycle();
         setSingleLine();
         setEllipsize(null);
+        isRtl = SwagoInfo.INSTANCE.isMirror();
+        setTextAlignment(isRtl ? TEXT_ALIGNMENT_VIEW_END:TEXT_ALIGNMENT_VIEW_START );
+
     }
 
     /**
      * 开始滚动
      */
     public void startScroll() {
-        mXPaused = 0;
+        mXPaused = isRtl? calculateScrollingLen() / 4 : 0;
         mPaused = true;
         mFirst = true;
         resumeScroll();
@@ -91,19 +97,17 @@ public class MarqueeTextView extends TextView {
         }
         int scrollingLen = calculateScrollingLen();
         final int distance = scrollingLen -  mXPaused;
+        LogUtil.INSTANCE.d("MarqueeTextView","calculateScrollingLen" +calculateScrollingLen() +":distance"+distance+":mXPaused"+mXPaused);
         final int duration = (Double.valueOf(mRollingInterval * distance * 1.00000
                 / scrollingLen)).intValue();
         if (mFirst) {
-            new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
-                @Override
-                public void run() {
-                    mScroller.startScroll(mXPaused, 0, distance, 0, duration);
-                    invalidate();
-                    mPaused = false;
-                }
+            new Handler(Looper.getMainLooper()).postDelayed(() -> {
+                mScroller.startScroll(mXPaused, 0,  isRtl? -distance:distance, 0, duration);
+                invalidate();
+                mPaused = false;
             }, mFirstScrollDelay);
         } else {
-            mScroller.startScroll(mXPaused, 0, distance, 0, duration);
+            mScroller.startScroll(mXPaused, 0,  isRtl ? -distance : distance, 0, duration);
             invalidate();
             mPaused = false;
         }
@@ -166,7 +170,7 @@ public class MarqueeTextView extends TextView {
                 return;
             }
             mPaused = true;
-            mXPaused = -1 * getWidth();
+            mXPaused = isRtl ? -calculateScrollingLen() : -getWidth();
             mFirst = false;
             this.resumeScroll();
         }

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

@@ -45,7 +45,7 @@ class UserFooterView : ConstraintLayout, IFooter,IRoomActiveListener {
     }
 
     private fun initView() {
-        visibility = View.GONE
+        visibility = View.INVISIBLE
         SwagoRoomManager.addListener(this)
         binding = LayoutUserFooterViewBinding.inflate(LayoutInflater.from(context), this, true)
         binding.ivChat.setOnClickListener(object : NoDoubleClickListener() {
@@ -100,7 +100,7 @@ class UserFooterView : ConstraintLayout, IFooter,IRoomActiveListener {
 
 
     override fun changeRoom(iRoomInfo: IRoomInfo) {
-        visibility = View.GONE
+        visibility = View.INVISIBLE
     }
 
     override fun leaveRoom(iRoomInfo: IRoomInfo) {

+ 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>

+ 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"

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

@@ -39,7 +39,7 @@
         android:id="@+id/ivAudioState"
         app:layout_constraintEnd_toEndOf="@+id/clAvatar"
         app:layout_constraintBottom_toBottomOf="@+id/clAvatar"
-        android:src="@mipmap/live_mute"
+        android:src="@mipmap/live_mute_white"
         android:visibility="invisible"
         tools:visibility="visible"
         android:layout_width="15dp"

+ 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

@@ -119,7 +119,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

+ 8 - 4
room/src/main/res/layout/layout_svg_dan_dao_view.xml

@@ -26,7 +26,7 @@
         android:layout_width="20dp"
         android:layout_height="20dp"/>
 
-    <com.swago.room.widget.MarqueeTextView
+    <TextView
         android:id="@+id/marqueeTextView"
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
@@ -38,8 +38,12 @@
         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"/>
+        android:singleLine="true"
+        android:ellipsize="marquee"
+        android:marqueeRepeatLimit="marquee_forever"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:scrollHorizontally="true"
+        android:freezesText="true"/>
 
 </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"

+ 77 - 8
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,87 @@
     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:src="@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:src="@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="14sp"
         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>
+        android:layout_gravity="center"
+        app:scroll_mode="mode_forever"
+        android:textDirection="locale"/>
+</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_500_999.png


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


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно