tongmengxiao 4 ماه پیش
والد
کامیت
adc98c14f9

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

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

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

@@ -26,9 +26,9 @@
         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"/>

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

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

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

@@ -170,7 +170,7 @@ 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" -> {
@@ -203,7 +203,7 @@ class WaftView : FrameLayout {
                 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
@@ -211,11 +211,11 @@ class WaftView : FrameLayout {
                         binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
                         binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
                         binding?.tvPrize?.text = ""
-                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.congratulations_to_for_start_of_today).format(sendName,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
@@ -223,7 +223,7 @@ class WaftView : FrameLayout {
                         binding?.ivPrize?.setImageResource(R.mipmap.ic_waft_function)
                         binding?.ivFunction?.setImageResource(R.mipmap.ic_waft_function)
                         binding?.tvPrize?.text = ""
-                        binding?.marqueeTextView?.text =  Html.fromHtml(AppContext.getContext().resources.getString(R.string.congratulations_to_for_king_of_game).format(sendName,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>"

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

@@ -174,18 +174,18 @@ class PKLayoutView : ConstraintLayout, IRoomActiveListener, IPKListener,
             if (svgProgress.isAnimating){
                 svgProgress.stopAnimation()
             }
-            selfAdapter.setAudienceMvp()
-            peerAdapter.setAudienceMvp()
             // 3赢 4输  5平局
             pkResult =punishPKModel.roomResult
             when(punishPKModel.roomResult){
                 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")
@@ -333,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()
         }
     }

+ 4 - 7
room/src/main/java/com/swago/room/widget/MarqueeTextView.java

@@ -101,13 +101,10 @@ public class MarqueeTextView extends TextView {
         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,  isRtl? -distance: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,  isRtl ? -distance : distance, 0, duration);

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

@@ -77,7 +77,7 @@
 
     <com.swago.room.widget.MarqueeTextView
         android:id="@+id/marqueeTextView"
-        android:layout_width="230dp"
+        android:layout_width="260dp"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toTopOf="parent"
@@ -85,7 +85,7 @@
         android:layout_height="wrap_content"
         android:layout_marginTop="20dp"
         android:layout_marginBottom="20dp"
-        android:textSize="14dp"
+        android:textSize="14sp"
         tools:text="ddddd"
         android:textColor="@color/white"
         app:scroll_first_delay="1000"

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