|
@@ -3,10 +3,12 @@ package com.swago.room.user
|
|
import android.view.View
|
|
import android.view.View
|
|
import android.widget.Toast
|
|
import android.widget.Toast
|
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
|
|
+import com.alibaba.android.arouter.launcher.ARouter
|
|
import com.google.gson.Gson
|
|
import com.google.gson.Gson
|
|
import com.swago.baseswago.PersonDataDFragment
|
|
import com.swago.baseswago.PersonDataDFragment
|
|
import com.swago.baseswago.baseroom.IRoomInfo
|
|
import com.swago.baseswago.baseroom.IRoomInfo
|
|
import com.swago.baseswago.baseroom.SwagoRoomManager
|
|
import com.swago.baseswago.baseroom.SwagoRoomManager
|
|
|
|
+import com.swago.baseswago.constant.ARouteConstant
|
|
import com.swago.baseswago.dialog.BenefitBagDialog
|
|
import com.swago.baseswago.dialog.BenefitBagDialog
|
|
import com.swago.baseswago.dialog.EnterPasswordDialog
|
|
import com.swago.baseswago.dialog.EnterPasswordDialog
|
|
import com.swago.baseswago.dialog.ReportDialog
|
|
import com.swago.baseswago.dialog.ReportDialog
|
|
@@ -17,6 +19,7 @@ import com.swago.baseswago.model.live.pk.StopPKModel
|
|
import com.swago.baseswago.util.AppContext
|
|
import com.swago.baseswago.util.AppContext
|
|
import com.swago.baseswago.util.NoDoubleClickListener
|
|
import com.swago.baseswago.util.NoDoubleClickListener
|
|
import com.swago.baseswago.util.SpUtil
|
|
import com.swago.baseswago.util.SpUtil
|
|
|
|
+import com.swago.baseswago.util.TimeUtil
|
|
import com.swago.baseswago.util.UserInfo
|
|
import com.swago.baseswago.util.UserInfo
|
|
import com.swago.room.R
|
|
import com.swago.room.R
|
|
import com.swago.room.audio.UserByAnchorInviteDialog
|
|
import com.swago.room.audio.UserByAnchorInviteDialog
|
|
@@ -24,6 +27,7 @@ import com.swago.room.base.BaseComFragment
|
|
import com.swago.room.bean.UserRoomModel
|
|
import com.swago.room.bean.UserRoomModel
|
|
import com.swago.room.databinding.FragmentBaseComBinding
|
|
import com.swago.room.databinding.FragmentBaseComBinding
|
|
import com.swago.room.dialog.AudioNoticeUserDialog
|
|
import com.swago.room.dialog.AudioNoticeUserDialog
|
|
|
|
+import com.swago.room.dialog.FooterMoreDialog
|
|
import com.swago.room.dialog.ShareDialog
|
|
import com.swago.room.dialog.ShareDialog
|
|
import com.swago.room.game.GameListDialog
|
|
import com.swago.room.game.GameListDialog
|
|
import com.swago.room.gift.GiftDialog
|
|
import com.swago.room.gift.GiftDialog
|
|
@@ -33,6 +37,7 @@ import com.swago.room.hongbao.RedEnvelopeDialog
|
|
import com.swago.room.inter.IFooter
|
|
import com.swago.room.inter.IFooter
|
|
import com.swago.room.inter.IHeader
|
|
import com.swago.room.inter.IHeader
|
|
import com.swago.room.lianmai.UserLianMaiDialog
|
|
import com.swago.room.lianmai.UserLianMaiDialog
|
|
|
|
+import com.swago.room.pk.PKStateManager
|
|
import com.swago.room.widget.ComHeaderView
|
|
import com.swago.room.widget.ComHeaderView
|
|
import com.swago.room.widget.UserFooterView
|
|
import com.swago.room.widget.UserFooterView
|
|
import com.swago.room.wishgift.WishGiftOnUserDialog
|
|
import com.swago.room.wishgift.WishGiftOnUserDialog
|
|
@@ -45,22 +50,12 @@ import kotlinx.coroutines.launch
|
|
*description:
|
|
*description:
|
|
*/
|
|
*/
|
|
class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
-
|
|
|
|
|
|
+ private var isSameDate:Boolean = false
|
|
override fun initOther() {
|
|
override fun initOther() {
|
|
super.initOther()
|
|
super.initOther()
|
|
binding.ivBenefit.setOnClickListener(object : NoDoubleClickListener() {
|
|
binding.ivBenefit.setOnClickListener(object : NoDoubleClickListener() {
|
|
override fun onClick() {
|
|
override fun onClick() {
|
|
- val dialog = BenefitBagDialog.newInstance()
|
|
|
|
- dialog.benefitIconDismissFun = {
|
|
|
|
- UserInfo.getUserInfo()?.let {
|
|
|
|
- if (it.is_benefit == 0) {
|
|
|
|
- binding.ivBenefit.visibility = View.VISIBLE
|
|
|
|
- } else {
|
|
|
|
- binding.ivBenefit.visibility = View.GONE
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- dialog.show(childFragmentManager, "BenefitBagDialog")
|
|
|
|
|
|
+ openBenefitBagDialog()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
@@ -127,8 +122,12 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
openShareDialog()
|
|
openShareDialog()
|
|
}
|
|
}
|
|
|
|
|
|
- footerView.openLianMaiFun = {
|
|
|
|
- openLianMaiListDialog()
|
|
|
|
|
|
+ footerView.openMoreDialog = {
|
|
|
|
+ openMoreDialog()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ footerView.openMandateFun = {
|
|
|
|
+ ARouter.getInstance().build(ARouteConstant.User.taskCenter).navigation()
|
|
}
|
|
}
|
|
|
|
|
|
unreadMessageVm.unreadMessageData.observe(this){
|
|
unreadMessageVm.unreadMessageData.observe(this){
|
|
@@ -230,11 +229,12 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
|
|
|
|
}.show(parentFragmentManager , "EnterPasswordDialog")
|
|
}.show(parentFragmentManager , "EnterPasswordDialog")
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
-
|
|
|
|
- private fun openLianMaiListDialog() {
|
|
|
|
- UserLianMaiDialog.newInstance().show(childFragmentManager,"UserLianMaiDialog")
|
|
|
|
|
|
+ payVm.benefitLiveData.observe(this){
|
|
|
|
+ if (it.is_benefit==0&&it.is_pop_discount_package==0){
|
|
|
|
+ BenefitBagDialog.newInstance().show(childFragmentManager, "BenefitBagDialog")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
fun dismissDialog() {
|
|
fun dismissDialog() {
|
|
@@ -250,6 +250,26 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
this.broadcastStatus = broadcastStatus
|
|
this.broadcastStatus = broadcastStatus
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun openMoreDialog(){
|
|
|
|
+ FooterMoreDialog.newInstance(unReadNum, 2).apply {
|
|
|
|
+ openMessageFun = {
|
|
|
|
+ openMessageListDialog()
|
|
|
|
+ }
|
|
|
|
+ openShareFun = {
|
|
|
|
+ if (PKStateManager.roomState==1){
|
|
|
|
+ openLianMaiListDialog()
|
|
|
|
+ }else{
|
|
|
|
+ Toast.makeText(AppContext.getContext(), "当前主播正在PK,请稍后", Toast.LENGTH_SHORT).show()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }.show(childFragmentManager , "FooterMoreDialog")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private fun openLianMaiListDialog() {
|
|
|
|
+ UserLianMaiDialog.newInstance().show(childFragmentManager,"UserLianMaiDialog")
|
|
|
|
+ }
|
|
|
|
+
|
|
override fun changeRoom(iRoomInfo: IRoomInfo) {
|
|
override fun changeRoom(iRoomInfo: IRoomInfo) {
|
|
super.changeRoom(iRoomInfo)
|
|
super.changeRoom(iRoomInfo)
|
|
}
|
|
}
|
|
@@ -265,6 +285,10 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
AudioNoticeUserDialog.newInstance().show(childFragmentManager,"AudioNoticeUserDialog")
|
|
AudioNoticeUserDialog.newInstance().show(childFragmentManager,"AudioNoticeUserDialog")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (!isSameDate){
|
|
|
|
+ isSameDate = true
|
|
|
|
+ payVm.getBenefit()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
override fun endRoom(iRoomInfo: IRoomInfo?) {
|
|
override fun endRoom(iRoomInfo: IRoomInfo?) {
|
|
@@ -274,6 +298,21 @@ class UserRoomFragment : BaseComFragment<FragmentBaseComBinding>() {
|
|
super.closeRoomed()
|
|
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**************************/
|
|
/*********************PK**************************/
|
|
override fun startPK(startPKModel: StartPKModel, isGetDataFromIM: Boolean) {
|
|
override fun startPK(startPKModel: StartPKModel, isGetDataFromIM: Boolean) {
|
|
}
|
|
}
|