Ver código fonte

feat: 领取奖励

tongmengxiao 4 meses atrás
pai
commit
52a8c8fdd2
23 arquivos alterados com 547 adições e 23 exclusões
  1. 12 0
      baseswago/src/main/java/com/swago/baseswago/inter/RoomApi.kt
  2. 11 0
      baseswago/src/main/java/com/swago/baseswago/model/MomentModel.java
  3. 16 0
      baseswago/src/main/java/com/swago/baseswago/model/live/OnlineRewardsModel.kt
  4. 0 0
      baseswago/src/main/res/mipmap-xxhdpi/ic_coin_store.png
  5. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_pk.png
  6. BIN
      baseswago/src/main/res/mipmap-xxhdpi/icon_rewards.png
  7. 5 0
      home/src/main/java/com/swago/home/innerhome/HomeAdapter.kt
  8. 10 0
      home/src/main/res/layout/item_home.xml
  9. 27 1
      room/src/main/java/com/swago/room/base/BaseComFragment.kt
  10. 54 0
      room/src/main/java/com/swago/room/dialog/GetRewardsDialog.kt
  11. 192 0
      room/src/main/java/com/swago/room/reward/RewardView.kt
  12. 17 14
      room/src/main/java/com/swago/room/user/UserRoomFragment.kt
  13. 28 0
      room/src/main/java/com/swago/room/vm/RoomVm.kt
  14. 5 0
      room/src/main/res/drawable/shape_b131f6_12.xml
  15. 101 0
      room/src/main/res/layout/dialog_get_rewards.xml
  16. 21 7
      room/src/main/res/layout/fragment_base_com.xml
  17. 1 1
      room/src/main/res/layout/layout_user_footer_view.xml
  18. 47 0
      room/src/main/res/layout/view_rewards.xml
  19. BIN
      room/src/main/res/mipmap-xxhdpi/bg_dialog_rewards.png
  20. BIN
      room/src/main/res/mipmap-xxhdpi/bg_get_reward.png
  21. BIN
      room/src/main/res/mipmap-xxhdpi/bg_rewards_buttom.png
  22. BIN
      room/src/main/res/mipmap-xxhdpi/bg_time_reward.png
  23. BIN
      room/src/main/res/mipmap-xxhdpi/icon_mandate.png

+ 12 - 0
baseswago/src/main/java/com/swago/baseswago/inter/RoomApi.kt

@@ -735,5 +735,17 @@ interface RoomApi {
     @POST("v1/rtc/system/upload/broadcast")
     suspend fun uploadBroadcast(@Field("room_id")room_id:String):Any
 
+    /**
+     * 查询直播间在线时长与奖励领取情况
+     *
+     */
+    @POST("v1/rtc/broadcast/get/onlineduration")
+    suspend fun getOnlineRewards():OnlineRewardsModel
 
+    /**
+     * 领取在线奖励
+     */
+    @FormUrlEncoded
+    @POST("v1/rtc/broadcast/receive/onlineduration")
+    suspend fun receiveOnlineRewards(@Field("duration")duration:String):Any
 }

+ 11 - 0
baseswago/src/main/java/com/swago/baseswago/model/MomentModel.java

@@ -37,6 +37,7 @@ public class MomentModel implements Parcelable {
     private String badge_special;
     private String join_special;
     private String chat_special;
+    private int is_pk;
 
     public MomentModel(){
 
@@ -63,6 +64,7 @@ public class MomentModel implements Parcelable {
         badge_special = in.readString();
         join_special = in.readString();
         chat_special = in.readString();
+        is_pk = in.readInt();
     }
 
     @Override
@@ -87,6 +89,7 @@ public class MomentModel implements Parcelable {
         dest.writeString(badge_special);
         dest.writeString(join_special);
         dest.writeString(chat_special);
+        dest.writeInt(is_pk);
     }
 
     @Override
@@ -281,4 +284,12 @@ public class MomentModel implements Parcelable {
     public void setChat_special(String chat_special) {
         this.chat_special = chat_special;
     }
+
+    public int getIs_pk() {
+        return is_pk;
+    }
+
+    public void setIs_pk(int is_pk) {
+        this.is_pk = is_pk;
+    }
 }

+ 16 - 0
baseswago/src/main/java/com/swago/baseswago/model/live/OnlineRewardsModel.kt

@@ -0,0 +1,16 @@
+package com.swago.baseswago.model.live
+
+data class OnlineRewardsModel (
+    val five:Boolean,
+    val ten:Boolean,
+    val fifteen:Boolean,
+    val thirty:Boolean,
+    val onlineDuration:Int,
+    val coin:CoinOnlineBean,
+    )
+
+data class CoinOnlineBean (
+    val five:Int,
+    val ten:Int,
+    val fifteen:Int,
+    val thirty:Int)

+ 0 - 0
user/src/main/res/mipmap-xxhdpi/ic_coin_store.png → baseswago/src/main/res/mipmap-xxhdpi/ic_coin_store.png


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


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


+ 5 - 0
home/src/main/java/com/swago/home/innerhome/HomeAdapter.kt

@@ -49,6 +49,11 @@ class HomeAdapter  : BaseQuickAdapter<MomentModel, BaseViewHolder>(R.layout.item
 
                 setVisible(R.id.ivPassword , false)
             }
+            if (item.is_pk == 1){
+                setVisible(R.id.ivPk , true)
+            } else {
+                setVisible(R.id.ivPk , false)
+            }
 //            setImageResource(R.id.ivCountry,R.drawable.flag_ac)
         }
     }

+ 10 - 0
home/src/main/res/layout/item_home.xml

@@ -33,6 +33,16 @@
         android:src="@mipmap/ic_live_lock"
         android:visibility="gone"/>
 
+    <ImageView
+        android:id="@+id/ivPk"
+        android:layout_width="25dp"
+        android:layout_height="25dp"
+        android:layout_marginTop="2dp"
+        android:layout_marginStart="10dp"
+        app:layout_constraintTop_toTopOf="@+id/ivLive"
+        app:layout_constraintLeft_toLeftOf="parent"
+        android:visibility="gone"
+        android:src="@mipmap/icon_pk"/>
 
     <com.swago.baseswago.cusview.BoldTextView
         android:id="@+id/tvName"

+ 27 - 1
room/src/main/java/com/swago/room/base/BaseComFragment.kt

@@ -58,6 +58,7 @@ import com.swago.room.databinding.FragmentBaseComBinding
 import com.swago.room.dialog.AudienceListDialog
 import com.swago.room.dialog.FanClubAnchorDialog
 import com.swago.room.dialog.FanClubForUserDialog
+import com.swago.room.dialog.GetRewardsDialog
 import com.swago.room.dialog.JoinFanClubDialog
 import com.swago.room.dialog.LevelUpDialog
 import com.swago.room.dialog.MessageListDialog
@@ -208,7 +209,6 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
         audioGiftManager.audioGiftViewList.add(binding.audioAllGiftView)
         //进场特效
         msgVm.joinRoomManager.initViewStub(binding.joinRoomViewStub, activity)
-        //
         binding.danMuView.setActivity(activity)
         binding.hongbaoPiaotiao.setActivity(activity)
         binding.hongbaoPiaotiao.goToTargetRoom = {
@@ -576,6 +576,15 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
             binding.ivRedEnvelopeView.addRedEnvelopList(it)
         }
 
+        //查询直播间在线时长与奖励领取情况
+        roomVm.onlineRewardsData.observe(this){
+            if (it.onlineDuration > 30){
+                binding.ivRewards.visibility = View.GONE
+            } else {
+                binding.ivRewards.setOnlineCoin(it)
+            }
+        }
+
         //IM下发新的红包
         msgVm.newRedEnvelopeCome = {
             binding.ivRedEnvelopeView.addIMRedEnvelope(it)
@@ -668,6 +677,16 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
                 }
             }.show(childFragmentManager, "RedEnvelopResultDialog")
         }
+
+        //领取直播积分
+        binding.ivRewards.openGetCoins = { duration, coins,nextCoins,nextTimes ->
+            GetRewardsDialog.newInstance(duration, coins,nextCoins,nextTimes ).apply {
+                this.openGetCoins = {
+                    roomVm.receiveOnlineRewards(it)
+                }
+            }.show(childFragmentManager,"GetRewardsDialog")
+        }
+
         pkVm.pkState = { pkState ->
             binding.bannerView.visibility = if (pkState) View.INVISIBLE else View.VISIBLE
             binding.videoPlayBannerView.visibility = if (pkState) View.INVISIBLE else View.VISIBLE
@@ -869,6 +888,13 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
                 } else {
                     binding.ivBenefit.visibility = View.GONE
                 }
+
+                if (it.user_wealth_level.toInt()>=10){
+                    //查询直播间在线时长与奖励领取情况
+                    roomVm.getOnlineRewards()
+                } else {
+                    binding.ivRewards.visibility = View.VISIBLE
+                }
             }
         }
 

+ 54 - 0
room/src/main/java/com/swago/room/dialog/GetRewardsDialog.kt

@@ -0,0 +1,54 @@
+package com.swago.room.dialog
+
+import android.os.Bundle
+import android.view.Gravity
+import com.swago.baseswago.dialog.BaseXDFragment
+import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.baseswago.util.TimeUtil
+import com.swago.room.databinding.DialogCanStartLiveBinding
+import com.swago.room.databinding.DialogGetRewardsBinding
+import java.sql.Time
+
+class GetRewardsDialog : BaseXDFragment<DialogGetRewardsBinding>() {
+    private var duration :String =""
+    var openGetCoins:((duration:String) ->Unit)? = null
+    init {
+        setGravity(Gravity.CENTER)
+        setDimAmount(0.5f)
+        setCanCancel(false)
+    }
+
+    companion object{
+        fun newInstance(duration : String, coins : Int, nextCoins : Int,nextTimes : Int ): GetRewardsDialog {
+            val args = Bundle()
+            args.putString("duration",duration)
+            args.putInt("coins",coins)
+            args.putInt("nextCoins",nextCoins)
+            args.putInt("nextTimes",nextTimes)
+            val fragment = GetRewardsDialog()
+            fragment.arguments = args
+            return fragment
+        }
+    }
+
+    override fun initOther() {
+        arguments?.let {
+            duration = it.getString("duration","")
+            val coins = it.getInt("coins")
+            val nextCoins = it.getInt("nextCoins")
+            val nextTimes = it.getInt("nextTimes")
+            binding.tvCoins.text = "+${coins}"
+
+        }
+
+        binding.tvSure.setOnClickListener(object: NoDoubleClickListener(){
+            override fun onClick() {
+                openGetCoins?.invoke(duration)
+                dismissAllowingStateLoss()
+            }
+        })
+    }
+
+    override fun initLiveData() {
+    }
+}

+ 192 - 0
room/src/main/java/com/swago/room/reward/RewardView.kt

@@ -0,0 +1,192 @@
+package com.swago.room.reward
+
+import android.animation.Animator
+import android.animation.ObjectAnimator
+import android.content.Context
+import android.util.AttributeSet
+import android.view.LayoutInflater
+import android.view.View
+import android.widget.FrameLayout
+import android.widget.Toast
+import com.swago.baseswago.baseroom.IRoomActiveListener
+import com.swago.baseswago.baseroom.IRoomInfo
+import com.swago.baseswago.baseroom.RoomTimer
+import com.swago.baseswago.baseroom.SwagoRoomManager
+import com.swago.baseswago.model.RedEnvelope
+import com.swago.baseswago.model.live.OnlineRewardsModel
+import com.swago.baseswago.util.AppContext
+import com.swago.baseswago.util.LogUtil
+import com.swago.baseswago.util.NoDoubleClickListener
+import com.swago.baseswago.util.TimeUtil
+import com.swago.room.R
+import com.swago.room.databinding.ViewRewardsBinding
+
+
+class RewardView : FrameLayout, IRoomActiveListener, RoomTimer.TimeTickListener {
+    private var  binding: ViewRewardsBinding? = null
+    private var timeL = 0L
+    private var duration:String = ""
+    private var nextCoins:Int = 0
+    private var coins:Int = 0
+    private var nextTime:Int = 0
+    private var rewardsModel: OnlineRewardsModel ?= null
+    private var scaleXAnimator:ObjectAnimator ?= null
+    private var scaleYAnimator:ObjectAnimator ?= null
+    var openGetCoins:((duration:String,coins:Int,nextCoins:Int,nextTime:Int) ->Unit)? = null
+    private
+    constructor(context: Context) : this(context, null)
+    constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
+    constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(
+        context,
+        attrs,
+        defStyle
+    ){
+        initView()
+    }
+    private fun initView() {
+        SwagoRoomManager.addListener(this)
+        RoomTimer.timeTickList.add(this)
+        binding = ViewRewardsBinding.inflate(LayoutInflater.from(context), this, true)
+
+        binding?.ivRewards?.setOnClickListener(object: NoDoubleClickListener(){
+            override fun onClick() {
+                if (rewardsModel == null){
+                    Toast.makeText(AppContext.getContext(), "10级以上用户可以领取", Toast.LENGTH_SHORT).show()
+                    return
+                }
+                timeL ++
+                scaleXAnimator?.cancel()
+                scaleYAnimator?.cancel()
+                binding?.tvTime?.setBackgroundResource(R.mipmap.bg_time_reward)
+                openGetCoins?.invoke(duration,coins,nextCoins,nextTime)
+            }
+        })
+        startAnimation()
+    }
+
+     private fun startAnimation(){
+         // 创建X轴放大的动画
+          scaleXAnimator = ObjectAnimator.ofFloat(binding?.clReward, "scaleX", 1.0f, 1.05f)
+         scaleXAnimator?.setDuration(500)
+         scaleXAnimator?.repeatCount = ObjectAnimator.INFINITE
+         scaleXAnimator?.repeatMode = ObjectAnimator.REVERSE
+
+         // 创建Y轴放大的动画
+         scaleYAnimator = ObjectAnimator.ofFloat(binding?.clReward, "scaleY", 1.0f, 1.05f)
+         scaleYAnimator?.setDuration(500)
+         scaleYAnimator?.repeatCount = ObjectAnimator.INFINITE
+         scaleYAnimator?.repeatMode = ObjectAnimator.REVERSE
+
+     }
+    override fun changeRoom(iRoomInfo: IRoomInfo) {
+
+    }
+
+    override fun leaveRoom(iRoomInfo: IRoomInfo) {
+        visibility = View.GONE
+    }
+
+    override fun joinedRoom(iRoomInfo: IRoomInfo) {
+    }
+
+    override fun endRoom(iRoomInfo: IRoomInfo?) {
+
+    }
+
+    override fun closeRoomed() {
+        RoomTimer.timeTickList.remove(this)
+        SwagoRoomManager.removeListener(this)
+    }
+
+    override fun onTimeCount(time: Int) {
+        when{
+            timeL== 300L -> {
+                // 启动动画
+                duration ="five"
+                scaleXAnimator?.start()
+                scaleYAnimator?.start()
+                binding?.tvTime?.setBackgroundResource(R.mipmap.bg_get_reward)
+                binding?.tvTime?.text = "Get!"
+            }
+
+            timeL== 600L -> {
+                // 启动动画
+                duration ="ten"
+                scaleXAnimator?.start()
+                scaleYAnimator?.start()
+                binding?.tvTime?.setBackgroundResource(R.mipmap.bg_get_reward)
+                binding?.tvTime?.text = "Get!"
+            }
+
+           timeL== 900L -> {
+                // 启动动画
+                duration ="fifteen"
+                scaleXAnimator?.start()
+                scaleYAnimator?.start()
+                binding?.tvTime?.setBackgroundResource(R.mipmap.bg_get_reward)
+                binding?.tvTime?.text = "Get!"
+            }
+            timeL== 1800L -> {
+                // 启动动画
+                duration ="thirty"
+                scaleXAnimator?.start()
+                scaleYAnimator?.start()
+                binding?.tvTime?.setBackgroundResource(R.mipmap.bg_get_reward)
+                binding?.tvTime?.text = "Get!"
+            }
+
+            timeL> 1800L -> {
+                scaleXAnimator?.cancel()
+                scaleYAnimator?.cancel()
+                visibility = View.GONE
+            }
+            else -> {
+                timeL ++
+                binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
+            }
+        }
+
+    }
+
+    fun setOnlineCoin(model: OnlineRewardsModel){
+        timeL = model.onlineDuration * 60L
+        timeL ++
+        rewardsModel = model
+        if (!model.five){
+            coins = model.coin.five
+            nextCoins = model.coin.ten
+            nextTime = 10
+            binding?.tvCoins?.text = "+${model.coin.five}"
+            visibility = View.VISIBLE
+            binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
+            return
+        }
+        if (!model.ten){
+            coins = model.coin.ten
+            nextCoins = model.coin.fifteen
+            nextTime = 15
+            binding?.tvCoins?.text = "+${model.coin.ten}"
+            visibility = View.VISIBLE
+            binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
+            return
+        }
+        if (!model.fifteen){
+            coins = model.coin.fifteen
+            nextCoins = model.coin.thirty
+            nextTime = 30
+            binding?.tvCoins?.text = "+${model.coin.fifteen}"
+            visibility = View.VISIBLE
+            binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
+            return
+        }
+        if (!model.thirty){
+            coins = model.coin.thirty
+            nextCoins = 0
+            nextTime = 0
+            binding?.tvCoins?.text = "+${model.coin.thirty}"
+            visibility = View.VISIBLE
+            binding?.tvTime?.text = TimeUtil.convertMinSecond(timeL)
+            return
+        }
+    }
+}

+ 17 - 14
room/src/main/java/com/swago/room/user/UserRoomFragment.kt

@@ -50,26 +50,14 @@ import kotlinx.coroutines.launch
  *description:
  */
 class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
-    private var dialog:BenefitBagDialog ?= null
     private var isSameDate:Boolean = false
     override fun initOther() {
         super.initOther()
         isSameDate = SpUtil.readString("last_visit_date") == TimeUtil.getCurrentDate()
         SpUtil.putString("last_visit_date", TimeUtil.getCurrentDate())
-        dialog = BenefitBagDialog.newInstance()
-        dialog?.benefitIconDismissFun = {
-            UserInfo.getUserInfo()?.let {
-                if (it.is_benefit == 0) {
-                    binding.ivBenefit.visibility = View.VISIBLE
-                } else {
-                    binding.ivBenefit.visibility = View.GONE
-                }
-            }
-        }
-
         binding.ivBenefit.setOnClickListener(object : NoDoubleClickListener() {
             override fun onClick() {
-                dialog?.show(childFragmentManager, "BenefitBagDialog")
+                openBenefitBagDialog()
             }
         })
 
@@ -296,7 +284,7 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
         }
         if (!isSameDate){
             isSameDate = true
-            dialog?.show(childFragmentManager, "BenefitBagDialog")
+            openBenefitBagDialog()
         }
     }
 
@@ -307,6 +295,21 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
         super.closeRoomed()
     }
 
+    private fun openBenefitBagDialog(){
+        BenefitBagDialog.newInstance().apply {
+            this.benefitIconDismissFun = {
+                UserInfo.getUserInfo()?.let {
+                    if (it.is_benefit == 0) {
+                        this@UserRoomFragment.binding.ivBenefit.visibility = View.VISIBLE
+                    } else {
+                        this@UserRoomFragment.binding.ivBenefit.visibility = View.GONE
+                    }
+                }
+            }
+        }.show(childFragmentManager, "BenefitBagDialog")
+    }
+
+
     /*********************PK**************************/
     override fun startPK(startPKModel: StartPKModel, isGetDataFromIM: Boolean) {
     }

+ 28 - 0
room/src/main/java/com/swago/room/vm/RoomVm.kt

@@ -520,4 +520,32 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
         }
     }
 
+    /**
+     *查询直播间在线时长与奖励领取情况
+     * */
+    val onlineRewardsData by lazy {
+        MutableLiveData<OnlineRewardsModel>()
+    }
+    fun getOnlineRewards(){
+        requestData2(false) {
+            requestData {
+                val data = ApiManager.roomApi.getOnlineRewards()
+                onlineRewardsData.value = data
+            }
+        }
+    }
+
+    fun receiveOnlineRewards(duration:String){
+        requestData2(false) {
+            requestData {
+                 ApiManager.roomApi.receiveOnlineRewards(duration)
+                Toast.makeText(
+                    AppContext.getContext(),
+                    "success",
+                    Toast.LENGTH_SHORT
+                ).show()
+            }
+        }
+    }
+
 }

+ 5 - 0
room/src/main/res/drawable/shape_b131f6_12.xml

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

+ 101 - 0
room/src/main/res/layout/dialog_get_rewards.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_marginStart="40dp"
+        android:layout_marginEnd="40dp"
+        android:background="@mipmap/bg_dialog_rewards"
+        app:layout_constraintTop_toTopOf="parent"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/tvTitle"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="150dp"
+            android:textSize="16sp"
+            android:textStyle="bold"
+            android:textColor="@color/_ffffff"
+            android:text="Congratulations!"
+            android:drawablePadding="2dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+        <TextView
+            android:id="@+id/tvGet"
+            app:layout_constraintTop_toBottomOf="@+id/tvTitle"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="12dp"
+            android:textSize="14sp"
+            android:textColor="@color/_ffffff"
+            android:text="You get"
+            android:drawablePadding="2dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/clCoins"
+            android:layout_width="match_parent"
+            android:layout_height="64dp"
+            android:layout_marginStart="24dp"
+            android:layout_marginEnd="24dp"
+            android:background="@drawable/shape_b131f6_12"
+            app:layout_constraintTop_toBottomOf="@+id/tvGet">
+            <TextView
+                android:id="@+id/tvCoins"
+                android:gravity="center"
+                android:textSize="27sp"
+                android:textColor="#fff"
+                tools:text= "+0"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintBottom_toBottomOf="parent"
+                android:drawableLeft="@mipmap/icon_coin"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"/>
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <TextView
+            android:id="@+id/tvHint"
+            app:layout_constraintTop_toBottomOf="@+id/clCoins"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_marginTop="10dp"
+            android:textSize="12sp"
+            android:layout_marginStart="24dp"
+            android:layout_marginEnd="24dp"
+            android:gravity="center"
+            android:textColor="@color/_ffffff"
+            android:text="Continue in the room for 25 mins to earn another 100 coins."
+            android:drawablePadding="2dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+
+        <TextView
+            android:id="@+id/tvSure"
+            android:textSize="18sp"
+            android:textColor="#704200"
+            android:text="Get"
+            android:gravity="center"
+            android:layout_marginStart="24dp"
+            android:layout_marginEnd="24dp"
+            android:layout_marginBottom="10dp"
+            android:textStyle="bold"
+            app:layout_constraintBottom_toBottomOf="parent"
+            android:background="@mipmap/bg_rewards_buttom"
+            app:layout_constraintTop_toBottomOf="@+id/tvHint"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            android:layout_width="0dp"
+            android:layout_height="80dp"/>
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 21 - 7
room/src/main/res/layout/fragment_base_com.xml

@@ -103,7 +103,20 @@
         tools:visibility="visible"
         android:visibility="gone"
         android:layout_marginRight="2dp"
-        android:layout_marginTop="280dp"
+        android:layout_marginTop="390dp"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+
+    <com.swago.room.reward.RewardView
+        android:id="@+id/ivRewards"
+        app:layout_constraintTop_toBottomOf="@+id/ivBenefit"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginEnd="10dp"
+        tools:visibility="visible"
+        android:visibility="gone"
+        android:layout_marginTop="@dimen/dp_10"
+        android:src="@mipmap/icon_rewards"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
@@ -153,7 +166,13 @@
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         android:layout_width="match_parent"
-        android:layout_height="300dp"/>
+        android:layout_height="300dp">
+
+        <com.swago.room.audio.widget.AudioContainGiftView
+            android:id="@+id/audioAllGiftView"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+    </com.swago.room.giftdandao.GiftDanDaoView>
 
     <com.swago.room.giftdandao.GiftDanDaoView
         android:id="@+id/danDaoView3"
@@ -228,9 +247,4 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
-    <com.swago.room.audio.widget.AudioContainGiftView
-        android:id="@+id/audioAllGiftView"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-
 </androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -89,7 +89,7 @@
         app:layout_constraintTop_toTopOf="parent"
         app:layout_constraintStart_toEndOf="@+id/cl_Message"
         android:background="@drawable/shape_80000000_20"
-        android:src="@mipmap/icon_agent"
+        android:src="@mipmap/icon_mandate"
         android:padding="7dp"
         android:layout_width="40dp"
         android:layout_height="40dp"/>

+ 47 - 0
room/src/main/res/layout/view_rewards.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="52dp"
+    android:layout_height="52dp"
+    android:id="@+id/clReward"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
+
+    <ImageView
+        android:id="@+id/ivRewards"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:src="@mipmap/icon_rewards"
+        android:layout_marginEnd="@dimen/dp_4"
+        android:layout_marginTop="@dimen/dp_4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:id="@+id/tvTime"
+        android:textColor="#fff"
+        tools:text="0"
+        android:gravity="center_horizontal"
+        android:textSize="8sp"
+        android:background="@mipmap/bg_time_reward"
+        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_width="29dp"
+        android:layout_height="15dp"/>
+    
+    <TextView
+        android:id="@+id/tvCoins"
+        android:textSize="10dp"
+        android:textColor="#fff"
+        tools:text="0"
+        android:layout_marginEnd="@dimen/dp_4"
+        android:gravity="center"
+        android:drawableLeft="@mipmap/ic_coin_store"
+        android:layout_marginBottom="3dp"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+    
+
+</androidx.constraintlayout.widget.ConstraintLayout>

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


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


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


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


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