8 Incheckningar 48ab2497e4 ... 33e2d4e31e

Upphovsman SHA1 Meddelande Datum
  tongmengxiao 33e2d4e31e fix: 34 4 månader sedan
  tongmengxiao 3ba0969c69 fix: hongbao 60 4 månader sedan
  tongmengxiao d79f5c2766 fix: systemcount 4 månader sedan
  tongmengxiao cd2feeb50e fix:系统消息Im 4 månader sedan
  tongmengxiao adc98c14f9 fix: mvp 4 månader sedan
  tongmengxiao 666ac2d172 feat: 6116 4 månader sedan
  tongmengxiao bf1aa388c9 fix: pk string 4 månader sedan
  tongmengxiao ed1569a2cd feat: targetSdkVersion 34 5 månader sedan
63 ändrade filer med 523 tillägg och 355 borttagningar
  1. 5 5
      app/build.gradle
  2. 4 0
      app/src/main/AndroidManifest.xml
  3. 42 2
      app/src/main/java/com/swago/app/SplashActivity.kt
  4. 3 3
      baseswago/build.gradle
  5. 2 0
      baseswago/src/main/java/com/swago/baseswago/activity/WebViewActivity.kt
  6. 22 0
      baseswago/src/main/java/com/swago/baseswago/cusview/CustomLoadMoreView.kt
  7. 10 1
      baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt
  8. 4 0
      baseswago/src/main/java/com/swago/baseswago/im/ImConstant.kt
  9. 9 1
      baseswago/src/main/java/com/swago/baseswago/model/UnreadMessageVm.kt
  10. 3 1
      baseswago/src/main/java/com/swago/baseswago/model/home/OfficialSumModel.kt
  11. 1 0
      baseswago/src/main/java/com/swago/baseswago/model/im/GamePrize.kt
  12. 4 2
      baseswago/src/main/java/com/swago/baseswago/util/DianJiuUtil.kt
  13. 4 0
      baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt
  14. 5 15
      baseswago/src/main/java/com/swago/baseswago/util/IMUtil.kt
  15. 1 0
      baseswago/src/main/java/com/swago/baseswago/util/LogProducer.kt
  16. 1 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoInfo.kt
  17. 2 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoRefreshUtil.kt
  18. 15 5
      baseswago/src/main/java/com/swago/glide.kt
  19. 60 0
      baseswago/src/main/res/layout/custom_view_load_more.xml
  20. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_audioing.png
  21. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_living.png
  22. 3 3
      baseswago/src/main/res/values-ar/strings.xml
  23. 5 5
      baseswago/src/main/res/values-in/strings.xml
  24. 6 6
      baseswago/src/main/res/values-ms/strings.xml
  25. 5 5
      baseswago/src/main/res/values-zh/strings.xml
  26. 3 3
      baseswago/src/main/res/values/strings.xml
  27. 2 2
      home/build.gradle
  28. 29 4
      home/src/main/java/com/swago/home/HomeActivity.kt
  29. 35 13
      home/src/main/java/com/swago/home/HomeFragment.kt
  30. 5 1
      home/src/main/java/com/swago/home/MessageFragment.kt
  31. 14 0
      home/src/main/java/com/swago/home/innerhome/HomeVm.kt
  32. 7 0
      home/src/main/java/com/swago/home/official/OfficialMessageActivity.kt
  33. 7 7
      home/src/main/res/layout/item_home.xml
  34. 3 2
      home/src/main/res/layout/item_official.xml
  35. 2 2
      lib_beauty/src/main/java/com/swago/lib_beauty/BeautyConfig.kt
  36. 2 2
      lib_country_picker/build.gradle
  37. 0 32
      lib_country_picker/src/main/assets/code.json
  38. 2 2
      login/build.gradle
  39. 4 0
      login/src/main/java/com/swago/login/FBLogin.kt
  40. 68 3
      login/src/main/java/com/swago/login/LoginActivity.kt
  41. 2 2
      room/build.gradle
  42. 2 1
      room/src/main/AndroidManifest.xml
  43. BIN
      room/src/main/assets/win_1001_prize.svga
  44. BIN
      room/src/main/assets/win_101_500_prize.svga
  45. BIN
      room/src/main/assets/win_501_1000_prize.svga
  46. 0 98
      room/src/main/java/com/swago/room/dialog/ClarityVideoDialog.kt
  47. 5 5
      room/src/main/java/com/swago/room/gift/ComboView.kt
  48. 3 3
      room/src/main/java/com/swago/room/gift/control/SvgDanDaoView.kt
  49. 18 40
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt
  50. 33 16
      room/src/main/java/com/swago/room/piaotiao/WaftView.kt
  51. 8 1
      room/src/main/java/com/swago/room/pk/PKAudienceAdapter.kt
  52. 4 0
      room/src/main/java/com/swago/room/pk/PKLayoutView.kt
  53. 5 2
      room/src/main/java/com/swago/room/pk/PkVm.kt
  54. 10 1
      room/src/main/java/com/swago/room/service/AgoraForegroundService.java
  55. 14 10
      room/src/main/java/com/swago/room/widget/MarqueeTextView.java
  56. 2 2
      room/src/main/java/com/swago/room/widget/UserFooterView.kt
  57. 8 4
      room/src/main/res/layout/layout_svg_dan_dao_view.xml
  58. 6 5
      room/src/main/res/layout/view_waft.xml
  59. BIN
      room/src/main/res/mipmap-xxhdpi/gift_prize_frame_1_99.png
  60. BIN
      room/src/main/res/mipmap-xxhdpi/win_51_100_prize.webp
  61. 2 2
      tuikit/build.gradle
  62. 2 2
      user/build.gradle
  63. 0 32
      user/src/main/assets/code.json

+ 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 6115
-        versionName "6.1.1.5"
+        targetSdkVersion 34
+        versionCode 6116
+        versionName "6.1.1.6"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 

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

@@ -13,6 +13,9 @@
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.CAMERA"/>
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA"/>
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
     <uses-permission android:name="android.permission.RECORD_AUDIO"/>
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
@@ -21,6 +24,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" />

+ 42 - 2
app/src/main/java/com/swago/app/SplashActivity.kt

@@ -1,6 +1,7 @@
 package com.swago.app
 
 import android.Manifest
+import android.content.Intent
 import android.os.Build
 import android.os.Bundle
 import android.os.CountDownTimer
@@ -38,7 +39,32 @@ class SplashActivity : AppCompatActivity() {
     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) {
+                        splashVm.getApiDomain()
+                        splashVm.jumpToLoginLiveData.observe(this){
+                            if (!it){
+                                ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
+                                finish()
+                            }
+                        }
+                    } else {
+                        Toast.makeText(
+                            this@SplashActivity,
+                            getString(com.swago.login.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,
@@ -117,6 +143,7 @@ class SplashActivity : AppCompatActivity() {
             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
@@ -132,10 +159,11 @@ class SplashActivity : AppCompatActivity() {
 
         mSplashImage?.setOnClickListener(object :NoDoubleClickListener() {
             override fun onClick() {
+                countDownTimer.cancel()
                 configModel?.rotation_url?.let {
                     ARouter.getInstance().build(ARouteConstant.Base.webView)
                         .withString("url", it)
-                        .navigation()
+                        .navigation(this@SplashActivity,1001)
                 }
             }
         })
@@ -151,8 +179,20 @@ class SplashActivity : AppCompatActivity() {
         })
     }
 
+    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()
+        }
+    }
 }

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

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

+ 10 - 1
baseswago/src/main/java/com/swago/baseswago/im/GroupMsgParser.kt

@@ -52,6 +52,7 @@ import com.swago.baseswago.im.ImConstant.room_dan_mu
 import com.swago.baseswago.im.ImConstant.send_wish_gift
 import com.swago.baseswago.im.ImConstant.set_room_admin
 import com.swago.baseswago.im.ImConstant.svg_gift
+import com.swago.baseswago.im.ImConstant.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
@@ -62,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
@@ -413,7 +415,14 @@ class GroupMsgParser : IGroupNewMsgParser {
                     )
                     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){

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

@@ -262,6 +262,10 @@ object ImConstant {
      * 砸金蛋奖池金额
      * */
     const val break_egg_sum = 508
+    /**
+     * 系统消息
+     * */
+    const val system_message = 509
 
 
     /**********游戏相关IM********/

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

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

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

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

+ 4 - 0
baseswago/src/main/java/com/swago/baseswago/util/FileUtil.kt

@@ -2,6 +2,7 @@ package com.swago.baseswago.util
 
 import android.app.Application
 import android.content.Context
+import android.os.Build
 import java.io.*
 import java.lang.Exception
 import java.util.*
@@ -25,6 +26,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))

+ 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 - 0
baseswago/src/main/java/com/swago/baseswago/util/LogProducer.kt

@@ -65,6 +65,7 @@ object LogProducer {
         val jsonContentsObject =JSONObject()
         jsonContentsObject.put("type", type)
         jsonContentsObject.put("device_info", SwagoInfo.getDeviceInfo())
+        jsonContentsObject.put("android_os", SwagoInfo.getAndroidOS())
         jsonContentsObject.put("device_system", "android")
         jsonContentsObject.put("app_channel", SwagoInfo.getChannel())
         jsonContentsObject.put("app_version",SwagoInfo.getVersionCode())

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

@@ -14,7 +14,7 @@ import java.util.*
  *description:
  */
 object SwagoInfo {
-    var key = "bGtobGtqc3NoYWtkaXNiZGRxeWxrb3NoZ2R0YmZnZGU="
+    var key = "bGtobGtqc3NoYWtzaGRzaWhzaWRoc2lzaWR0YmZnZGU="
     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({

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

@@ -5,6 +5,7 @@ import android.content.Context
 import android.graphics.Bitmap
 import android.graphics.BitmapFactory
 import android.graphics.NinePatch
+import android.graphics.drawable.BitmapDrawable
 import android.graphics.drawable.Drawable
 import android.graphics.drawable.NinePatchDrawable
 import android.os.Build
@@ -54,13 +55,14 @@ fun ImageView.loadUrl(context: Context,url:String){
 
 fun ImageView.loadNoPlaceUrl(context: Context,url:String,call: (success:Boolean) -> Unit){
     Glide.with(context)
+        .asBitmap()
         .load(url)
         .centerCrop()
-        .listener(object :RequestListener<Drawable>{
+        .listener(object :RequestListener<Bitmap>{
             override fun onLoadFailed(
                 e: GlideException?,
                 model: Any?,
-                target: Target<Drawable>?,
+                target: Target<Bitmap>?,
                 isFirstResource: Boolean
             ): Boolean {
                 call.invoke(false)
@@ -68,9 +70,9 @@ fun ImageView.loadNoPlaceUrl(context: Context,url:String,call: (success:Boolean)
             }
 
             override fun onResourceReady(
-                resource: Drawable?,
+                resource: Bitmap?,
                 model: Any?,
-                target: Target<Drawable>?,
+                target: Target<Bitmap>?,
                 dataSource: DataSource?,
                 isFirstResource: Boolean
             ): Boolean {
@@ -79,7 +81,15 @@ fun ImageView.loadNoPlaceUrl(context: Context,url:String,call: (success:Boolean)
             }
 
         })
-        .into(this)
+        .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){

+ 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


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

@@ -172,7 +172,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>
@@ -251,8 +251,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>

+ 5 - 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>
@@ -263,8 +263,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>

+ 6 - 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>
@@ -263,8 +263,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>

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

@@ -140,7 +140,7 @@
     <string name="share_to">分享至</string>
     <string name="app_not_install">应用未安装</string>
     <string name="follow_anchor">刚刚关注了主播,再也不用担心错过直播啦~</string>
-    <string name="big_prize">真是幸运!%s送出%s赢得了%s倍\n奖励,恭喜他!</string>
+    <string name="big_prize">真是幸运!%s送出%s赢得了%s倍奖励,恭喜他!</string>
     <string name="update_now">立即更新</string>
 
     <string name="special">特殊</string>
@@ -251,8 +251,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>
@@ -356,8 +356,8 @@
     <string name="congratulations_to_for_king_of_game">恭喜%s成为本场游戏之王活动第%s名</string>
     <string name="so_lucky_golden_egg">太幸运啦,恭喜%s在砸金蛋活动中得到%s金币奖励</string>
     <string name="prize_pool_golden_egg">砸金蛋活动奖池已经达到%s,大家快去参与呀</string>
-    <string name="hd">HD</string>
-    <string name="sd">SD</string>
+    <string name="hd">高清</string>
+    <string name="sd">标清</string>
     <string name="login_cancel">取消登录</string>
     <string name="these_permissions_denied">权限被拒绝</string>
     <string name="login_fail">登录失败</string>

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

@@ -283,8 +283,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>
@@ -368,7 +368,7 @@
     <string name="select_all">Select all</string>
     <string name="add_to_my_music">Add to my music</string>
     <string name="sure_delete_this_music">Are you sure you want to delete this music?</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="beauty_filter">beauty&amp;filter</string>

+ 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 - 4
home/src/main/java/com/swago/home/HomeActivity.kt

@@ -31,6 +31,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
@@ -50,6 +51,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())
@@ -60,12 +63,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())
         SpUtil.putInt("isHomeBack" , 1)
         //检查版本更新
         checkVersionForUpdate()
+        messageFragment = listFragment[1] as MessageFragment
 
         binding.viewPager.offscreenPageLimit = 3
         binding.rg.setOnCheckedChangeListener { _, checkedId ->
@@ -74,6 +78,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
                     binding.viewPager.currentItem = 0
                 }
                 R.id.rbMessage -> {
+                    messageFragment?.setMessageSum()
                     binding.viewPager.currentItem = 1
                 }
                 R.id.rbMine -> {
@@ -130,6 +135,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)
+        }
     }
 
     /**
@@ -301,9 +321,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?) {
@@ -317,4 +334,12 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
             })
         }
     }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        if (conversationListener != null) {
+            IMUtil.removeConversationListener(conversationListener!!)
+            conversationListener = null
+        }
+    }
 }

+ 35 - 13
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.view.View
 import android.widget.Toast
 import androidx.fragment.app.activityViewModels
@@ -118,20 +119,41 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
         binding.ivLive.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
                 binding.ivLive.isEnabled = false
-                PermissionX.init(this@HomeFragment)
-                    .permissions(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
-                    .request { allGranted, grantedList, deniedList ->
-                        if (allGranted) {
-                            ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
-                        } else {
-                            binding.ivLive.isEnabled = true
-                            Toast.makeText(
-                                AppContext.getContext(),
-                                AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
-                                Toast.LENGTH_LONG
-                            ).show()
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE){
+                    PermissionX.init(this@HomeFragment)
+                        .permissions(Manifest.permission.CAMERA,
+                            Manifest.permission.RECORD_AUDIO,
+                            Manifest.permission.FOREGROUND_SERVICE_CAMERA,
+                            Manifest.permission.FOREGROUND_SERVICE_MICROPHONE)
+                        .request { allGranted, grantedList, deniedList ->
+                            if (allGranted) {
+                                ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
+                            } else {
+                                binding.ivLive.isEnabled = true
+                                Toast.makeText(
+                                    AppContext.getContext(),
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    Toast.LENGTH_LONG
+                                ).show()
+                            }
                         }
-                    }
+                } else {
+                    PermissionX.init(this@HomeFragment)
+                        .permissions(Manifest.permission.CAMERA,
+                            Manifest.permission.RECORD_AUDIO)
+                        .request { allGranted, grantedList, deniedList ->
+                            if (allGranted) {
+                                ARouter.getInstance().build(ARouteConstant.Room.anchor).navigation()
+                            } else {
+                                binding.ivLive.isEnabled = true
+                                Toast.makeText(
+                                    AppContext.getContext(),
+                                    AppContext.getContext().getString(R.string.these_permissions_denied)+" $deniedList",
+                                    Toast.LENGTH_LONG
+                                ).show()
+                            }
+                        }
+                }
             }
         })
 

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

@@ -34,7 +34,7 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
     private var jumpDetail = true
 
     override fun loadData() {
-        officialVm.getMsgSum()
+
     }
 
     override fun initOther() {
@@ -105,6 +105,10 @@ class MessageFragment : BaseXFragment<FragmentMessageBinding>() {
         }
     }
 
+     fun setMessageSum(){
+         officialVm.getMsgSum()
+     }
+
     override fun onResume() {
         super.onResume()
         jumpDetail = true

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

@@ -7,9 +7,11 @@ import com.swago.baseswago.im.IMGroupNewMsgListener
 import com.swago.baseswago.im.ImConstant.bind_anchor
 import com.swago.baseswago.im.ImConstant.change_user_name
 import com.swago.baseswago.im.ImConstant.close_account
+import com.swago.baseswago.im.ImConstant.system_message
 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.BindAnchorData
 import com.swago.baseswago.model.im.ChangeNameData
 import com.swago.baseswago.model.im.CloseAccountData
@@ -26,6 +28,7 @@ class HomeVm(application: Application) : BaseViewModel(application) {
 
     var bindAnchorFun:((data: BindAnchorData) -> Unit)? = null
     var closeAccountFun:((data: CloseAccountData) -> Unit)? = null
+    var systemMessageFun:((data: OfficialSumModel) -> Unit)? = null
 
     val imGroupNewMsgListener = IMGroupNewMsgListener()
 
@@ -59,6 +62,17 @@ class HomeVm(application: Application) : BaseViewModel(application) {
                 }
             }
         }
+        imGroupNewMsgListener.handleMsgType<CusNewMsgBean<OfficialSumModel>>(
+            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

@@ -8,9 +8,12 @@ import com.chad.library.adapter.base.BaseQuickAdapter
 import com.swago.baseswago.activity.BaseListActivity
 import com.swago.baseswago.cusview.SwagoRecyclerView
 import com.swago.baseswago.dialog.InviteBindingDialog
+import com.swago.baseswago.model.UnreadMessageVm
+import com.swago.baseswago.model.ViewModelProviderUtil
 import com.swago.baseswago.model.home.OfficialMsgModel
 import com.swago.baseswago.model.im.BindAnchorData
 import com.swago.baseswago.util.AppContext
+import com.swago.baseswago.util.SpUtil
 import com.swago.home.R
 import com.swago.home.databinding.ActivityOfficialMessageBinding
 
@@ -22,6 +25,7 @@ class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding,
 
     private val officialVm by viewModels<OfficialVm>()
     private lateinit var inviteData: BindAnchorData
+    private lateinit var unreadMessageVm: UnreadMessageVm
 
     override val smartRecyclerView: SwagoRecyclerView<OfficialMsgModel.ListBean> by lazy {
         binding.swagoRv as SwagoRecyclerView<OfficialMsgModel.ListBean>
@@ -63,5 +67,8 @@ class OfficialMessageActivity : BaseListActivity<ActivityOfficialMessageBinding,
             InviteBindingDialog.newInstance(inviteData)
                 .show(supportFragmentManager, "InviteBindingDialog")
         }
+        unreadMessageVm = ViewModelProviderUtil.getUnreadMessageViewModel(application)
+        unreadMessageVm.setSystemUnreadCount(0)
+        SpUtil.putString("systemCount" , "0")
     }
 }

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

@@ -15,20 +15,20 @@
 
     <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_constraintRight_toRightOf="parent"
-        android:layout_width="18dp"
-        android:layout_height="18dp"/>
+        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"
+        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_beauty/src/main/java/com/swago/lib_beauty/BeautyConfig.kt

@@ -14,7 +14,7 @@ object BeautyConfig {
     var BUNDLE_FACE_BEAUTIFICATION = "model" + File.separator + "face_beautification.bundle"
 
 
-    val defaultParams = arrayListOf<Double>(0.7,0.7,0.7,0.0,0.0,0.5,0.0,0.0,
-        0.3,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.3,0.5,0.5,0.0,0.5,0.5,0.7,0.5,0.0)
+    val defaultParams = arrayListOf<Double>(0.3,0.3,0.7,0.0,0.0,0.5,0.0,0.0,
+        0.2,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.3,0.5,0.5,0.0,0.5,0.5,0.7,0.5,0.0)
 
 }

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

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

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

+ 68 - 3
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,
+                                        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
@@ -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
@@ -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
@@ -278,4 +338,9 @@ class LoginActivity : BaseXActivity<ActivityLoginBinding>() {
             }
         }
     }
+
+    override fun onDestroy() {
+        super.onDestroy()
+        FBLogin.unregisterCallback()
+    }
 }

+ 2 - 2
room/build.gradle

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

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

@@ -16,7 +16,8 @@
             android:screenOrientation="portrait"/>
         <activity android:name=".music.LocalMusicActivity"
             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


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

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

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

+ 18 - 40
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt

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

+ 33 - 16
room/src/main/java/com/swago/room/piaotiao/WaftView.kt

@@ -20,6 +20,7 @@ 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.ViewWaftBinding
 import java.net.URL
@@ -36,6 +37,7 @@ 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)
@@ -44,6 +46,7 @@ class WaftView : FrameLayout {
     private fun initView(context: Context) {
         binding = ViewWaftBinding.inflate(LayoutInflater.from(context), this, true)
         svgaParser = SVGAParser(context)
+        this.context = context
     }
 
 
@@ -127,7 +130,7 @@ class WaftView : FrameLayout {
                     binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_big_prize)
                     binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_big_prize)
                     binding?.tvPrize?.text = "${next.multiple}"
-                    binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_prize).format(sendName,giftName,multiple)}")
+                    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>"
@@ -138,13 +141,13 @@ class WaftView : FrameLayout {
                     binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_send)
                     binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_send)
                     binding?.tvPrize?.text = ""
-                    binding?.marqueeTextView?.text = Html.fromHtml("\u200E${AppContext.getContext().resources.getString(R.string.big_gift_msg).format(sendName,giftName,receiverName)}")
+                    binding?.marqueeTextView?.text = Html.fromHtml(AppContext.getContext().resources.getString(R.string.big_gift_msg).format(sendName,giftName,receiverName))
                 }
                 if (!next.headSpecial.isNullOrEmpty()){
-                    binding?.svgAvatar?.visibility = View.VISIBLE
                     svgaParser?.decodeFromURL(URL(next.headSpecial), object : SVGAParser.ParseCompletion{
                         override fun onComplete(videoItem: SVGAVideoEntity) {
                             val drawable = SVGADrawable(videoItem)
+                            binding?.svgAvatar?.visibility = View.VISIBLE
                             binding?.svgAvatar?.setImageDrawable(drawable)
                             binding?.svgAvatar?.startAnimation()
                         }
@@ -153,7 +156,10 @@ class WaftView : FrameLayout {
                         }
                     })
                 } else {
-                    binding?.svgAvatar?.visibility = View.GONE
+                    binding?.svgAvatar?.visibility = View.INVISIBLE
+                }
+                context?.let {
+                    binding?.ivAvatar?.loadUrl(it,next.senderAvatar)
                 }
             }
 
@@ -164,20 +170,21 @@ class WaftView : FrameLayout {
                 binding?.ivFunction?.visibility = View.GONE
                 binding?.ivAvatar?.visibility = View.VISIBLE
                 binding?.ll?.setBackgroundResource(R.mipmap.bg_waft_game)
-                binding?.tvPrize?.setBackgroundResource(R.mipmap.ic_waft_game)
+                binding?.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()
                         }
@@ -185,48 +192,61 @@ class WaftView : FrameLayout {
                         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 coin = "<font color='#FFDB43'>${next.sort}</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("\u200E${AppContext.getContext().resources.getString(R.string.congratulations_to_for_start_of_today).format(sendName,coin)}")
+                        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 coin = "<font color='#FFDB43'>${next.sort}</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("\u200E${AppContext.getContext().resources.getString(R.string.congratulations_to_for_king_of_game).format(sendName,coin)}")
+                        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("\u200E${AppContext.getContext().resources.getString(R.string.so_lucky_golden_egg).format(sendName,coin)}")
+                        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("\u200E${AppContext.getContext().resources.getString(R.string.prize_pool_golden_egg).format(coin)}")
+                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.prize_pool_golden_egg).format(coin))
                     }
                 }
 
@@ -234,9 +254,6 @@ class WaftView : FrameLayout {
 
         }
 
-
-
-
         binding?.marqueeTextView?.post {
             binding?.marqueeTextView?.stopScroll()
             binding?.marqueeTextView?.startScroll()

+ 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.icon_pk_mvp)
+                        setImageResource(R.id.ivPosition,if (isAudienceMvp) R.mipmap.icon_pk_mvp else R.mipmap.first)
                     }
                     1 -> {
                         setImageResource(R.id.ivPosition,R.mipmap.second)

+ 4 - 0
room/src/main/java/com/swago/room/pk/PKLayoutView.kt

@@ -180,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")
@@ -331,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()
         }
     }

+ 5 - 2
room/src/main/java/com/swago/room/pk/PkVm.kt

@@ -97,6 +97,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             ipkListener.stopPK(stopPKModel)
                         }
                     }
+                    pkState?.invoke(false)
                 }
                 2 -> {
                     if (PKStateManager.roomState != PKStateManager.PK) {
@@ -113,8 +114,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)
 
@@ -129,6 +130,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             ipkListener.processChangePK(processPKModel, false)
                         }
                     }
+                    pkState?.invoke(true)
                 }
                 3, 4, 5 -> {
                     if (PKStateManager.roomState != PKStateManager.PUNISH) {
@@ -160,6 +162,7 @@ class PkVm(application: Application) : AbsMsgVm(application) {
                             ipkListener.processChangePK(processPKModel, false)
                         }
                     }
+                    pkState?.invoke(true)
                 }
             }
         }

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

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

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

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

@@ -19,7 +19,7 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         android:layout_marginEnd="10dp"
-        android:background="@mipmap/ic_waft_big_prize"/>
+        android:src="@mipmap/ic_waft_big_prize"/>
     <ImageView
         android:id="@+id/iv_function"
         android:layout_width="wrap_content"
@@ -30,7 +30,7 @@
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        android:background="@mipmap/ic_waft_big_prize"/>
+        android:src="@mipmap/ic_waft_big_prize"/>
 
     <TextView
         android:id="@+id/tv_prize"
@@ -85,11 +85,12 @@
         android:layout_height="wrap_content"
         android:layout_marginTop="20dp"
         android:layout_marginBottom="20dp"
-        android:textSize="14dp"
+        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"/>
+        android:layout_gravity="center"
+        app:scroll_mode="mode_forever"
+        android:textDirection="locale"/>
 </androidx.constraintlayout.widget.ConstraintLayout>

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


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


+ 2 - 2
tuikit/build.gradle

@@ -1,10 +1,10 @@
 apply plugin: 'com.android.library'
 android {
-    compileSdkVersion 33
+    compileSdkVersion 34
 
     defaultConfig {
         minSdkVersion 21
-        targetSdkVersion 33
+        targetSdkVersion 34
         versionCode 1
         versionName "5.5.892"
 

+ 2 - 2
user/build.gradle

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

+ 0 - 32
user/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,