房间内按钮礼物显示异常优化
This commit is contained in:
@@ -232,6 +232,7 @@ public class GiftAnimView extends FrameLayout implements GiftSvgaView.OnAnimatio
|
|||||||
playerMp4View.setVisibility(View.GONE);
|
playerMp4View.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
setVisibility(isShow ? View.VISIBLE : View.GONE);
|
setVisibility(isShow ? View.VISIBLE : View.GONE);
|
||||||
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopPlay() {
|
public void stopPlay() {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import android.annotation.SuppressLint
|
|||||||
import android.app.ActivityManager
|
import android.app.ActivityManager
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.ActivityInfo
|
import android.content.pm.ActivityInfo
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
@@ -45,8 +44,6 @@ import android.widget.TextView
|
|||||||
import androidx.activity.OnBackPressedCallback
|
import androidx.activity.OnBackPressedCallback
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.DialogFragment
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||||
@@ -178,6 +175,8 @@ import com.xscm.moduleutil.widget.ViewUtils
|
|||||||
import com.xscm.moduleutil.widget.ViewUtils.OnViewCreatedListener
|
import com.xscm.moduleutil.widget.ViewUtils.OnViewCreatedListener
|
||||||
import com.xscm.moduleutil.widget.floatingView.Floa
|
import com.xscm.moduleutil.widget.floatingView.Floa
|
||||||
import io.agora.musiccontentcenter.Music
|
import io.agora.musiccontentcenter.Music
|
||||||
|
import io.reactivex.Observable
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.disposables.Disposable
|
import io.reactivex.disposables.Disposable
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import org.greenrobot.eventbus.Subscribe
|
import org.greenrobot.eventbus.Subscribe
|
||||||
@@ -189,6 +188,7 @@ import java.lang.ref.WeakReference
|
|||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
import java.util.Arrays
|
import java.util.Arrays
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
|
|
||||||
@Route(path = ARouteConstants.ROOM_DETAILS)
|
@Route(path = ARouteConstants.ROOM_DETAILS)
|
||||||
@@ -281,8 +281,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
taskId = intent.getStringExtra("taskId")
|
taskId = intent.getStringExtra("taskId")
|
||||||
mRoomInfoResp = roomInfoResp
|
mRoomInfoResp = roomInfoResp
|
||||||
}
|
}
|
||||||
setView(mRoomInfoResp,true)
|
setView(mRoomInfoResp, true)
|
||||||
toActivity(TransparentActivity::class.java)
|
|
||||||
LogUtils.e("RoomActivity", "onNewIntent")
|
LogUtils.e("RoomActivity", "onNewIntent")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,6 +705,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
// 获取并显示stubButtons2布局
|
// 获取并显示stubButtons2布局
|
||||||
val stub = mBinding!!.roomTop.stubButtons2
|
val stub = mBinding!!.roomTop.stubButtons2
|
||||||
stub.visibility = View.VISIBLE
|
stub.visibility = View.VISIBLE
|
||||||
|
requestLayout(stub)
|
||||||
// 获取结束按钮和延时按钮的ImageView控件
|
// 获取结束按钮和延时按钮的ImageView控件
|
||||||
val imActionJs = mBinding!!.roomTop.imActionJs.findViewById<ImageView>(R.id.im_action_js)
|
val imActionJs = mBinding!!.roomTop.imActionJs.findViewById<ImageView>(R.id.im_action_js)
|
||||||
val imActionYs = mBinding!!.roomTop.imActionYs.findViewById<ImageView>(R.id.im_action_ys)
|
val imActionYs = mBinding!!.roomTop.imActionYs.findViewById<ImageView>(R.id.im_action_ys)
|
||||||
@@ -745,6 +745,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
|
|
||||||
fun isInAuctionTopBtVisible(isShow: Boolean) {
|
fun isInAuctionTopBtVisible(isShow: Boolean) {
|
||||||
mBinding!!.roomTop.stubButtons2.visibility = if (isShow) View.VISIBLE else View.GONE
|
mBinding!!.roomTop.stubButtons2.visibility = if (isShow) View.VISIBLE else View.GONE
|
||||||
|
requestLayout(mBinding!!.roomTop.stubButtons2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -753,11 +754,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (visible) View.VISIBLE else View.INVISIBLE
|
if (visible) View.VISIBLE else View.INVISIBLE
|
||||||
mBinding!!.roomTop.imActionYs.visibility =
|
mBinding!!.roomTop.imActionYs.visibility =
|
||||||
if (visible) View.VISIBLE else View.INVISIBLE
|
if (visible) View.VISIBLE else View.INVISIBLE
|
||||||
|
|
||||||
|
requestLayout(mBinding!!.roomTop.imActionJs)
|
||||||
|
requestLayout(mBinding!!.roomTop.imActionYs)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun upJs(visible: Boolean) {
|
fun upJs(visible: Boolean) {
|
||||||
mBinding!!.roomTop.imActionJs.visibility =
|
mBinding!!.roomTop.imActionJs.visibility =
|
||||||
if (visible) View.VISIBLE else View.INVISIBLE
|
if (visible) View.VISIBLE else View.INVISIBLE
|
||||||
|
requestLayout(mBinding!!.roomTop.imActionJs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据传入的visible参数设置JS按钮的可见性
|
// 根据传入的visible参数设置JS按钮的可见性
|
||||||
@@ -765,6 +770,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
fun upYs(visible: Boolean) {
|
fun upYs(visible: Boolean) {
|
||||||
mBinding!!.roomTop.imActionYs.visibility =
|
mBinding!!.roomTop.imActionYs.visibility =
|
||||||
if (visible) View.VISIBLE else View.INVISIBLE
|
if (visible) View.VISIBLE else View.INVISIBLE
|
||||||
|
requestLayout(mBinding!!.roomTop.imActionYs)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 最小化 */
|
/** 最小化 */
|
||||||
@@ -891,33 +897,33 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
|
override fun onSelfInfoUpdated(info: V2TIMUserFullInfo?) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up the room view with the provided room information response.
|
* Sets up the room view with the provided room information response.
|
||||||
*
|
*
|
||||||
* @param resp The room information response object containing room details
|
* @param resp The room information response object containing room details
|
||||||
* @param isSwitchRoomType Flag indicating if room type is being switched (default: false)
|
* @param isSwitchRoomType Flag indicating if room type is being switched (default: false)
|
||||||
*/
|
*/
|
||||||
@SuppressLint("CheckResult")
|
@SuppressLint("CheckResult")
|
||||||
private fun setView(resp: RoomInfoResp?, isSwitchRoomType: Boolean = false) {
|
private fun setView(resp: RoomInfoResp?, isSwitchRoomType: Boolean = false) {
|
||||||
// Return early if response is null
|
// Return early if response is null
|
||||||
if (resp == null)
|
if (resp == null)
|
||||||
return
|
return
|
||||||
// Update room info in app state manager and local instance
|
// Update room info in app state manager and local instance
|
||||||
AppStateManager.getInstance().roomInfo = resp
|
AppStateManager.getInstance().roomInfo = resp
|
||||||
this.mRoomInfoResp = resp
|
this.mRoomInfoResp = resp
|
||||||
val roomBean = resp.room_info
|
val roomBean = resp.room_info
|
||||||
// Log room info for debugging
|
// Log room info for debugging
|
||||||
LogUtils.e("setView_mRoomBean", resp.toString())
|
LogUtils.e("setView_mRoomBean", resp.toString())
|
||||||
// Set user and owner information
|
// Set user and owner information
|
||||||
this.mRoomUserBean = resp.user_info
|
this.mRoomUserBean = resp.user_info
|
||||||
this.mRoomOwnerBean = resp.room_owner
|
this.mRoomOwnerBean = resp.room_owner
|
||||||
this.roomId = roomBean.room_id
|
this.roomId = roomBean.room_id
|
||||||
|
|
||||||
// Load room cover image and set room details
|
// Load room cover image and set room details
|
||||||
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
|
ImageUtils.loadHeadCC(resp.room_info.room_cover, mBinding!!.roomTop.avatar)
|
||||||
mBinding!!.roomTop.name.text = roomBean.room_name
|
mBinding!!.roomTop.name.text = roomBean.room_name
|
||||||
mBinding!!.roomTop.idVal.text = "ID:" + roomBean.room_number
|
mBinding!!.roomTop.idVal.text = "ID:" + roomBean.room_number
|
||||||
// Handle follow button visibility based on user role
|
// Handle follow button visibility based on user role
|
||||||
if (mRoomUserBean?.getIs_room_owner() == 1) {
|
if (mRoomUserBean?.getIs_room_owner() == 1) {
|
||||||
mBinding!!.roomTop.btnFollow.visibility = View.GONE
|
mBinding!!.roomTop.btnFollow.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
@@ -928,19 +934,19 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding!!.roomTop.btnFollow.text = ""
|
mBinding!!.roomTop.btnFollow.text = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set online number display
|
// Set online number display
|
||||||
number = roomBean.online_number
|
number = roomBean.online_number
|
||||||
mBinding!!.roomTop.tvNum.text = number.toString() + ""
|
mBinding!!.roomTop.tvNum.text = number.toString() + ""
|
||||||
|
|
||||||
// Set initial view if not switching room type
|
// Set initial view if not switching room type
|
||||||
if (!isSwitchRoomType) {
|
if (!isSwitchRoomType) {
|
||||||
setviewyc(true)
|
setviewyc(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Log room join action
|
// Log room join action
|
||||||
LogUtils.e("加入", roomId)
|
LogUtils.e("加入", roomId)
|
||||||
// Build comma-separated user IDs from pit list
|
// Build comma-separated user IDs from pit list
|
||||||
val userIds = StringBuilder()
|
val userIds = StringBuilder()
|
||||||
if (mRoomInfoResp?.room_info?.pit_list != null) {
|
if (mRoomInfoResp?.room_info?.pit_list != null) {
|
||||||
for (i in mRoomInfoResp?.room_info?.pit_list!!.indices) {
|
for (i in mRoomInfoResp?.room_info?.pit_list!!.indices) {
|
||||||
@@ -953,7 +959,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Update app context with room information
|
// Update app context with room information
|
||||||
CommonAppContext.getInstance().isPlaying = true
|
CommonAppContext.getInstance().isPlaying = true
|
||||||
CommonAppContext.getInstance().playId = roomId
|
CommonAppContext.getInstance().playId = roomId
|
||||||
CommonAppContext.getInstance().playName = mRoomInfoResp?.room_info?.room_name
|
CommonAppContext.getInstance().playName = mRoomInfoResp?.room_info?.room_name
|
||||||
@@ -961,7 +967,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
CommonAppContext.getInstance().playCover = resp.room_info.room_cover
|
CommonAppContext.getInstance().playCover = resp.room_info.room_cover
|
||||||
CommonAppContext.getInstance().showSelf = resp.is_show_self == 1
|
CommonAppContext.getInstance().showSelf = resp.is_show_self == 1
|
||||||
|
|
||||||
// Update follow button appearance based on collection status
|
// Update follow button appearance based on collection status
|
||||||
if (mRoomUserBean?.getIs_collect() == 1) {
|
if (mRoomUserBean?.getIs_collect() == 1) {
|
||||||
mBinding!!.roomTop.btnFollow.background =
|
mBinding!!.roomTop.btnFollow.background =
|
||||||
resources.getDrawable(com.xscm.moduleutil.R.mipmap.yishouc)
|
resources.getDrawable(com.xscm.moduleutil.R.mipmap.yishouc)
|
||||||
@@ -975,23 +981,23 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding!!.roomTop.btnFollow.setTextColor(ColorManager.getInstance().buttonColorInt)
|
mBinding!!.roomTop.btnFollow.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||||
mBinding!!.roomTop.btnFollow.text = "收藏"
|
mBinding!!.roomTop.btnFollow.text = "收藏"
|
||||||
}
|
}
|
||||||
// Set music type based on room type
|
// Set music type based on room type
|
||||||
if ((roomBean.type_id == "3" || roomBean.type_id == "1" || roomBean.type_id == "4") && roomBean.label_id == "2") {
|
if ((roomBean.type_id == "3" || roomBean.type_id == "1" || roomBean.type_id == "4") && roomBean.label_id == "2") {
|
||||||
AgoraManager.getInstance().isBjMusic = false
|
AgoraManager.getInstance().isBjMusic = false
|
||||||
} else {
|
} else {
|
||||||
AgoraManager.getInstance().isBjMusic = true
|
AgoraManager.getInstance().isBjMusic = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update user permissions
|
// Update user permissions
|
||||||
userPermissionChange()
|
userPermissionChange()
|
||||||
|
|
||||||
// Hide PK and misc views for specific room types
|
// Hide PK and misc views for specific room types
|
||||||
if (resp.room_info.type_id == "7" || resp.room_info.type_id == "2") {
|
if (resp.room_info.type_id == "7" || resp.room_info.type_id == "2") {
|
||||||
mBinding!!.rlPk.visibility = View.GONE
|
mBinding!!.rlPk.visibility = View.GONE
|
||||||
mBinding!!.rlMisc.visibility = View.GONE
|
mBinding!!.rlMisc.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle lucky draw countdown visibility
|
// Handle lucky draw countdown visibility
|
||||||
if (mRoomInfoResp?.gift_cycle?.xlh_info?.xlh_status == "1") {
|
if (mRoomInfoResp?.gift_cycle?.xlh_info?.xlh_status == "1") {
|
||||||
mBinding?.xlhRk?.visibility = View.VISIBLE
|
mBinding?.xlhRk?.visibility = View.VISIBLE
|
||||||
xlhDjs(mRoomInfoResp?.gift_cycle?.xlh_info?.end_time)
|
xlhDjs(mRoomInfoResp?.gift_cycle?.xlh_info?.end_time)
|
||||||
@@ -1000,7 +1006,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
releaseCountDownTimer1()
|
releaseCountDownTimer1()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show/hide hourly ranking based on settings
|
// Show/hide hourly ranking based on settings
|
||||||
if (mRoomInfoResp?.hour_ranking_open == 1) {
|
if (mRoomInfoResp?.hour_ranking_open == 1) {
|
||||||
mBinding!!.clXsb.visibility = View.VISIBLE
|
mBinding!!.clXsb.visibility = View.VISIBLE
|
||||||
} else {
|
} else {
|
||||||
@@ -1023,6 +1029,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
MvpPre?.roomRedPackets(roomId)
|
MvpPre?.roomRedPackets(roomId)
|
||||||
|
|
||||||
roomBtnShowIsHide()
|
roomBtnShowIsHide()
|
||||||
|
|
||||||
|
softRebuildUI()
|
||||||
|
Observable.timer(1000, TimeUnit.MILLISECONDS).observeOn(
|
||||||
|
AndroidSchedulers.mainThread()
|
||||||
|
).subscribe { aLong: Long? ->
|
||||||
|
if (ActivityUtils.getTopActivity() is RoomActivity) {
|
||||||
|
toActivity(TransparentActivity::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1182,11 +1197,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
circularProgress!!.progress = 1000 // 显示进度条,2025年7月19日11:23:37将这个从下面的方法提起到这里,
|
circularProgress!!.progress = 1000 // 显示进度条,2025年7月19日11:23:37将这个从下面的方法提起到这里,
|
||||||
startGiftProgressTime()
|
startGiftProgressTime()
|
||||||
mBinding!!.giftShowLayout.visibility = View.VISIBLE
|
mBinding!!.giftShowLayout.visibility = View.VISIBLE
|
||||||
|
requestLayout(mBinding!!.giftShowLayout)
|
||||||
|
softRebuildUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideGiftGiveProgress() {
|
private fun hideGiftGiveProgress() {
|
||||||
LogUtils.e("hideGiftGiveProgress")
|
LogUtils.e("hideGiftGiveProgress")
|
||||||
mBinding!!.giftShowLayout.visibility = View.GONE
|
mBinding!!.giftShowLayout.visibility = View.GONE
|
||||||
|
requestLayout(mBinding!!.giftShowLayout)
|
||||||
if (giftCountTimer != null) {
|
if (giftCountTimer != null) {
|
||||||
giftCountTimer!!.cancel()
|
giftCountTimer!!.cancel()
|
||||||
giftCountTimer = null
|
giftCountTimer = null
|
||||||
@@ -1317,6 +1335,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val text = messageEvent.text
|
val text = messageEvent.text
|
||||||
|
|
||||||
if (msgType == EMMessageInfo.QXRoomMessageTypeGift) {
|
if (msgType == EMMessageInfo.QXRoomMessageTypeGift) {
|
||||||
|
bgEffectView?.invalidate()
|
||||||
|
bgEffectView?.requestLayout()
|
||||||
|
|
||||||
GiftDisplayManager.getInstance().setupDisplayView(mBinding?.giftContainer)
|
GiftDisplayManager.getInstance().setupDisplayView(mBinding?.giftContainer)
|
||||||
|
|
||||||
@@ -1514,6 +1534,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignStartText) {
|
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignStartText) {
|
||||||
roomFragment?.handleRoomMessage(messageEvent)
|
roomFragment?.handleRoomMessage(messageEvent)
|
||||||
|
softRebuildUI()
|
||||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignMaxUserText) {
|
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignMaxUserText) {
|
||||||
roomFragment?.handleRoomMessage(messageEvent)
|
roomFragment?.handleRoomMessage(messageEvent)
|
||||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignEndText) {
|
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignEndText) {
|
||||||
@@ -1643,7 +1664,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
roomFragment?.upRoomInfoData(mRoomInfoResp)
|
roomFragment?.upRoomInfoData(mRoomInfoResp)
|
||||||
roomFragment!!.handleRoomMessage(messageEvent)
|
roomFragment!!.handleRoomMessage(messageEvent)
|
||||||
// 执行换麦逻辑
|
// 执行换麦逻辑
|
||||||
roomBtnShowIsHide( mRoomInfoResp?.room_info?.pit_list!![toPitNumber.toInt() - 1].user_id.toInt())
|
roomBtnShowIsHide(mRoomInfoResp?.room_info?.pit_list!![toPitNumber.toInt() - 1].user_id.toInt())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1673,6 +1694,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
EventBus.getDefault().post(roomSettingEvent)
|
EventBus.getDefault().post(roomSettingEvent)
|
||||||
|
|
||||||
|
softRebuildUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMsgType1013(messageEvent: RoomMessageEvent, text: T?) {
|
private fun handleMsgType1013(messageEvent: RoomMessageEvent, text: T?) {
|
||||||
@@ -1717,8 +1740,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommonAppContext.getInstance().isMai = false
|
||||||
|
|
||||||
CommonAppContext.getInstance().onlineMap.clear()
|
CommonAppContext.getInstance().onlineMap.clear()
|
||||||
MvpPre!!.postRoomInfo(roomId)
|
MvpPre!!.postRoomInfo(roomId)
|
||||||
|
softRebuildUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMsgType124(messageEvent: RoomMessageEvent, text: T?) {
|
private fun handleMsgType124(messageEvent: RoomMessageEvent, text: T?) {
|
||||||
@@ -1847,7 +1874,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
2 -> {
|
2 -> {
|
||||||
if (mRoomInfoResp?.room_info?.pit_list!![0].user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
if (mRoomInfoResp?.room_info?.pit_list!![0].user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
||||||
mRoomInfoResp?.user_info?.pit_number = 9
|
mRoomInfoResp?.user_info?.pit_number = 9
|
||||||
}else{
|
} else {
|
||||||
mRoomInfoResp?.user_info?.pit_number = 0
|
mRoomInfoResp?.user_info?.pit_number = 0
|
||||||
}
|
}
|
||||||
mRoomInfoResp?.room_auction = RoomAuction()
|
mRoomInfoResp?.room_auction = RoomAuction()
|
||||||
@@ -1883,8 +1910,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (auction.user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
if (auction.user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
||||||
if (mRoomInfoResp?.room_info?.pit_list!![0].user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
if (mRoomInfoResp?.room_info?.pit_list!![0].user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
||||||
userId = -1
|
userId = -1
|
||||||
}else{
|
} else {
|
||||||
userId = auction.user_id.toInt()
|
userId = auction.user_id.toInt()
|
||||||
}
|
}
|
||||||
mRoomInfoResp?.user_info?.pit_number = 1
|
mRoomInfoResp?.user_info?.pit_number = 1
|
||||||
|
|
||||||
@@ -1955,6 +1982,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val gift = GiftBean()
|
val gift = GiftBean()
|
||||||
gift.gift_id = ""
|
gift.gift_id = ""
|
||||||
gift.play_image = roomMessageEvent.text.jia_jia
|
gift.play_image = roomMessageEvent.text.jia_jia
|
||||||
|
setupEffectView()
|
||||||
QXGiftPlayerManager.getInstance(this)
|
QXGiftPlayerManager.getInstance(this)
|
||||||
.displayFullEffectView(roomMessageEvent.text.jia_jia)
|
.displayFullEffectView(roomMessageEvent.text.jia_jia)
|
||||||
}
|
}
|
||||||
@@ -2267,7 +2295,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val pitArr: MutableList<RoomPitBean> = ArrayList()
|
val pitArr: MutableList<RoomPitBean> = ArrayList()
|
||||||
for (j in text.list.indices) {
|
for (j in text.list.indices) {
|
||||||
val roomPitBean = getRoomPitBean(messageEvent, j)
|
val roomPitBean = getRoomPitBean(messageEvent, j)
|
||||||
if(roomPitBean.user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())){
|
if (roomPitBean.user_id.equals(mRoomInfoResp?.user_info?.user_id.toString())) {
|
||||||
mRoomInfoResp?.user_info?.pit_number = roomPitBean.pit_number.toInt()
|
mRoomInfoResp?.user_info?.pit_number = roomPitBean.pit_number.toInt()
|
||||||
roomBtnShowIsHide(mRoomInfoResp?.user_info?.user_id!!)
|
roomBtnShowIsHide(mRoomInfoResp?.user_info?.user_id!!)
|
||||||
}
|
}
|
||||||
@@ -2496,6 +2524,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
fun setvisibTop(`is`: Boolean) {
|
fun setvisibTop(`is`: Boolean) {
|
||||||
mBinding!!.roomTop.root.visibility =
|
mBinding!!.roomTop.root.visibility =
|
||||||
if (`is`) View.VISIBLE else View.GONE
|
if (`is`) View.VISIBLE else View.GONE
|
||||||
|
requestLayout(mBinding!!.roomTop.root)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setUserInfo() {
|
fun setUserInfo() {
|
||||||
@@ -2716,7 +2745,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun minimizeToBackground() {
|
private fun minimizeToBackground() {
|
||||||
LogUtils.e("RoomActivity", "minimizeToBackground:"+roomId +",play:"+CommonAppContext.getInstance().playId)
|
LogUtils.e(
|
||||||
|
"RoomActivity",
|
||||||
|
"minimizeToBackground:" + roomId + ",play:" + CommonAppContext.getInstance().playId
|
||||||
|
)
|
||||||
isMinimized = true
|
isMinimized = true
|
||||||
// 保存最小化状态和房间ID
|
// 保存最小化状态和房间ID
|
||||||
saveMinimizeState()
|
saveMinimizeState()
|
||||||
@@ -2824,6 +2856,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
fun clFirstCharge(voive: Boolean) {
|
fun clFirstCharge(voive: Boolean) {
|
||||||
mBinding!!.clFirstCharge.visibility =
|
mBinding!!.clFirstCharge.visibility =
|
||||||
if (voive) View.VISIBLE else View.GONE
|
if (voive) View.VISIBLE else View.GONE
|
||||||
|
requestLayout(mBinding!!.clFirstCharge)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setVoiveState(voive: Boolean) {
|
private fun setVoiveState(voive: Boolean) {
|
||||||
@@ -2878,9 +2911,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
|
|
||||||
if (userId == 0 && !CommonAppContext.getInstance().isMai) {
|
if (userId == 0 && !CommonAppContext.getInstance().isMai) {
|
||||||
switchMic(2)
|
switchMic(2)
|
||||||
}else if (mRoomInfoResp?.user_info?.user_id == userId && !CommonAppContext.getInstance().isMai) {
|
} else if (mRoomInfoResp?.user_info?.user_id == userId && !CommonAppContext.getInstance().isMai) {
|
||||||
switchMic(2)
|
switchMic(2)
|
||||||
}else if (voive){
|
} else if (CommonAppContext.getInstance().isMai) {
|
||||||
switchMic(1)
|
switchMic(1)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -2910,7 +2943,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding?.ivSoundEffects?.visibility = View.GONE
|
mBinding?.ivSoundEffects?.visibility = View.GONE
|
||||||
mBinding?.rlPk?.visibility = View.GONE
|
mBinding?.rlPk?.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
requestLayout(mBinding!!.rlPk)
|
||||||
|
requestLayout(mBinding!!.rlMai)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -3271,6 +3305,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
val gift = GiftBean()
|
val gift = GiftBean()
|
||||||
gift.gift_id = ""
|
gift.gift_id = ""
|
||||||
gift.play_image = event.ride_url
|
gift.play_image = event.ride_url
|
||||||
|
softRebuildUI()
|
||||||
QXGiftPlayerManager.getInstance(this).displayFullEffectView(event.ride_url)
|
QXGiftPlayerManager.getInstance(this).displayFullEffectView(event.ride_url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4284,6 +4319,21 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//局部刷新
|
||||||
|
private fun requestLayout(view: View) {
|
||||||
|
view.invalidate()
|
||||||
|
view.requestLayout()
|
||||||
|
mBinding?.llBottom?.invalidate()
|
||||||
|
mBinding?.llBottom?.requestLayout()
|
||||||
|
}
|
||||||
|
|
||||||
|
//整体刷新
|
||||||
|
private fun softRebuildUI() {
|
||||||
|
window.decorView.post {
|
||||||
|
window.decorView.requestLayout()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private val CLICK_INTERVAL: Long = 500 // 500ms内不允许重复点击
|
private val CLICK_INTERVAL: Long = 500 // 500ms内不允许重复点击
|
||||||
private var lastClickTime: Long = 0
|
private var lastClickTime: Long = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user