tongmengxiao 4 месяцев назад
Родитель
Сommit
bf1aa388c9
29 измененных файлов с 198 добавлено и 50 удалено
  1. 5 0
      app/src/main/java/com/swago/app/SplashActivity.kt
  2. 22 0
      baseswago/src/main/java/com/swago/baseswago/cusview/CustomLoadMoreView.kt
  3. 1 0
      baseswago/src/main/java/com/swago/baseswago/model/im/GamePrize.kt
  4. 2 1
      baseswago/src/main/java/com/swago/baseswago/model/live/pk/ProcessPKModel.kt
  5. 2 1
      baseswago/src/main/java/com/swago/baseswago/util/SwagoRefreshUtil.kt
  6. 15 5
      baseswago/src/main/java/com/swago/glide.kt
  7. 60 0
      baseswago/src/main/res/layout/custom_view_load_more.xml
  8. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_audioing.png
  9. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_living.png
  10. 1 1
      baseswago/src/main/res/values-ar/strings.xml
  11. 3 3
      baseswago/src/main/res/values-zh/strings.xml
  12. 3 0
      home/src/main/java/com/swago/home/HomeActivity.kt
  13. 5 1
      home/src/main/java/com/swago/home/MessageFragment.kt
  14. 4 4
      home/src/main/res/layout/item_home.xml
  15. 3 2
      home/src/main/res/layout/item_official.xml
  16. 2 2
      lib_beauty/src/main/java/com/swago/lib_beauty/BeautyConfig.kt
  17. BIN
      room/src/main/assets/win_1001_prize.svga
  18. BIN
      room/src/main/assets/win_101_500_prize.svga
  19. BIN
      room/src/main/assets/win_501_1000_prize.svga
  20. 3 3
      room/src/main/java/com/swago/room/gift/control/SvgDanDaoView.kt
  21. 2 0
      room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt
  22. 30 13
      room/src/main/java/com/swago/room/piaotiao/WaftView.kt
  23. 8 1
      room/src/main/java/com/swago/room/pk/PKAudienceAdapter.kt
  24. 2 0
      room/src/main/java/com/swago/room/pk/PKLayoutView.kt
  25. 2 2
      room/src/main/java/com/swago/room/pk/PkVm.kt
  26. 11 4
      room/src/main/java/com/swago/room/widget/MarqueeTextView.java
  27. 8 4
      room/src/main/res/layout/layout_svg_dan_dao_view.xml
  28. 4 3
      room/src/main/res/layout/view_waft.xml
  29. BIN
      room/src/main/res/mipmap-xxhdpi/win_51_100_prize.webp

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

@@ -176,6 +176,11 @@ class SplashActivity : AppCompatActivity() {
         })
     }
 
+    override fun onResume() {
+        super.onResume()
+        isRunning = true
+    }
+
     override fun onDestroy() {
         super.onDestroy()
         countDownTimer.cancel()

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

+ 2 - 1
baseswago/src/main/java/com/swago/baseswago/model/live/pk/ProcessPKModel.kt

@@ -11,5 +11,6 @@ data class ProcessPKModel(
 
 data class PKSeat(
     var userId:String = "",
-    var userAvatar:String=""
+    var userAvatar:String="",
+    var seatMvp:Boolean=false
 )

+ 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


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

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

@@ -50,6 +50,7 @@ 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 val listFragment =
         arrayListOf(HomeFragment(), MessageFragment(), MineFragment())
@@ -66,6 +67,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
         SpUtil.putInt("isHomeBack" , 1)
         //检查版本更新
         checkVersionForUpdate()
+        messageFragment = listFragment[1] as MessageFragment
 
         binding.viewPager.offscreenPageLimit = 3
         binding.rg.setOnCheckedChangeListener { _, checkedId ->
@@ -74,6 +76,7 @@ class HomeActivity : BaseXActivity<ActivityHomeBinding>(), IPayCallback {
                     binding.viewPager.currentItem = 0
                 }
                 R.id.rbMessage -> {
+                    messageFragment?.setMessageSum()
                     binding.viewPager.currentItem = 1
                 }
                 R.id.rbMine -> {

+ 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

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

@@ -15,12 +15,12 @@
 
     <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"

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

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


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

+ 2 - 0
room/src/main/java/com/swago/room/giftdandao/GiftDanDaoView.kt

@@ -334,6 +334,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 +386,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' -> {

+ 30 - 13
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)
                 }
             }
 
@@ -168,16 +174,17 @@ class WaftView : FrameLayout {
                 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,6 +192,11 @@ class WaftView : FrameLayout {
                         override fun onError() {
                         }
                     })
+                } else {
+                    binding?.svgAvatar?.visibility = INVISIBLE
+                }
+                context?.let {
+                    binding?.ivAvatar?.loadUrl(it,next.userHeadImgUrl)
                 }
             }
             is PiaoTiaoRewardsData -> {
@@ -194,39 +206,47 @@ class WaftView : FrameLayout {
                         val coin = "<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,coin))
                     }
                     506 -> {
                         val sendName = "<font color='#FFDB43'>${next.userName}</font>"
                         val coin = "<font color='#FFDB43'>${next.sort}</font>"
                         binding?.ivFunction?.visibility = View.VISIBLE
                         binding?.ivAvatar?.visibility = View.GONE
+                        binding?.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,coin))
                     }
                     507 -> {
                         val sendName = "<font color='#FFDB43'>${next.userName}</font>"
                         val coin = "<font color='#FFDB43'>${next.winCoin}</font>"
                         binding?.ivFunction?.visibility = View.VISIBLE
                         binding?.ivAvatar?.visibility = View.GONE
+                        binding?.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)

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

@@ -174,6 +174,8 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
             if (svgProgress.isAnimating){
                 svgProgress.stopAnimation()
             }
+            selfAdapter.setAudienceMvp()
+            peerAdapter.setAudienceMvp()
             // 3赢 4输  5平局
             pkResult =punishPKModel.roomResult
             when(punishPKModel.roomResult){

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

@@ -113,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)
 

+ 11 - 4
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,20 @@ 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);
+                    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 +173,7 @@ public class MarqueeTextView extends TextView {
                 return;
             }
             mPaused = true;
-            mXPaused = -1 * getWidth();
+            mXPaused = isRtl ? -calculateScrollingLen() : -getWidth();
             mFirst = false;
             this.resumeScroll();
         }

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

+ 4 - 3
room/src/main/res/layout/view_waft.xml

@@ -77,7 +77,7 @@
 
     <com.swago.room.widget.MarqueeTextView
         android:id="@+id/marqueeTextView"
-        android:layout_width="260dp"
+        android:layout_width="230dp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent"
@@ -87,9 +87,10 @@
         android:layout_marginBottom="20dp"
         android:textSize="14dp"
         tools:text="ddddd"
-        android:layout_gravity="center"
         android:textColor="@color/white"
         app:scroll_first_delay="1000"
         app:scroll_interval="6000"
-        app:scroll_mode="mode_forever"/>
+        android:layout_gravity="center"
+        app:scroll_mode="mode_forever"
+        android:textDirection="locale"/>
 </androidx.constraintlayout.widget.ConstraintLayout>

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