fix bugs.2
This commit is contained in:
@@ -407,7 +407,6 @@ public class MessageListenerSingleton {
|
||||
LogUtils.e("解析 JSON 数据时出错:" + e.getMessage());
|
||||
return; // 退出方法,避免后续代码执行
|
||||
}
|
||||
|
||||
if (groupID.contains(mRoomId)) {
|
||||
notifyMessageReceived(event);
|
||||
}
|
||||
|
||||
@@ -1486,7 +1486,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeQXRoomMessageRedRemove) {
|
||||
qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSongerNum || //房间点歌数量变化
|
||||
msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged) //点歌房下一首歌曲发生变化
|
||||
msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomNextSongDidChanged
|
||||
) //点歌房下一首歌曲发生变化
|
||||
{
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged) { //点歌房当前歌曲发生变化)
|
||||
@@ -1499,8 +1500,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomFragment?.upRoomInfo(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
}
|
||||
else if (msgType == EMMessageInfo.QXRoomMessageTypeCPText) {
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeCPText) {
|
||||
LogUtils.e("CPText", messageEvent.text.rights_icon)
|
||||
if (messageEvent.text.rights_icon.isNotEmpty()) {
|
||||
QXGiftPlayerManager.getInstance(this).displayCPView(
|
||||
@@ -1908,12 +1908,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
RoomType.JUKEBOX -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||
// getPitBean(messageEvent, 1)
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
else -> {
|
||||
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||
}
|
||||
@@ -2009,10 +2011,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
private var currentMqttView: View? = null // 正在播放
|
||||
var decorView: ViewGroup? = null //礼物的
|
||||
|
||||
// 添加视图池,用于复用飘屏视图
|
||||
private val floatingViewPool = mutableListOf<View>()
|
||||
|
||||
// 使用Handler替代post,提供更精确的控制
|
||||
private val floatingHandler = Handler(Looper.getMainLooper())
|
||||
|
||||
// 添加预加载标志
|
||||
private var isPreloaded = false
|
||||
|
||||
@@ -2091,12 +2096,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
// 将视图放回池中
|
||||
currentMqttView?.visibility = View.GONE
|
||||
try {
|
||||
// try {
|
||||
floatingViewPool.add(currentMqttView!!)
|
||||
currentMqttView = null
|
||||
}catch (e:Exception){
|
||||
LogUtils.e("飘屏显示异常", e)
|
||||
}
|
||||
// }catch (e:Exception){
|
||||
// LogUtils.e("飘屏显示异常", e)
|
||||
// }
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -2113,7 +2118,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
view.alpha = 0f // 初始设为透明,避免闪烁
|
||||
|
||||
// 使用属性动画替代补间动画,提高性能
|
||||
val enterAnim = ValueAnimator.ofFloat(screenWidth.toFloat(), ((screenWidth - SystemUtils.getWidth(316)) / 2).toFloat())
|
||||
val enterAnim = ValueAnimator.ofFloat(
|
||||
screenWidth.toFloat(),
|
||||
((screenWidth - SystemUtils.getWidth(316)) / 2).toFloat()
|
||||
)
|
||||
enterAnim.duration = 1000 // 减少进入动画时长到800ms
|
||||
enterAnim.interpolator = DecelerateInterpolator()
|
||||
|
||||
@@ -3346,7 +3354,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
false,
|
||||
2,
|
||||
isNumberWhether(),
|
||||
supportFragmentManager)
|
||||
supportFragmentManager
|
||||
)
|
||||
}
|
||||
|
||||
mBinding!!.ivQuanQiang.setOnClickListener { v: View? ->
|
||||
@@ -3673,6 +3682,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var roomId2: String? = null //这是点击小时榜后记录的房间id
|
||||
|
||||
private fun getHour() {
|
||||
@@ -3928,27 +3938,47 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
fun upHeight() {
|
||||
if (mRoomInfoResp?.room_info?.type_id == "1" || mRoomInfoResp?.room_info?.type_id == "3" || mRoomInfoResp?.room_info?.type_id == "4"
|
||||
|| mRoomInfoResp?.room_info?.type_id == "8"
|
||||
) {
|
||||
maxHeightDp = if (mRoomInfoResp?.room_info?.label_id == "1") {
|
||||
333
|
||||
} else {
|
||||
287
|
||||
}
|
||||
} else if (mRoomInfoResp?.room_info?.type_id == "2") {
|
||||
maxHeightDp = 297
|
||||
}
|
||||
if (mRoomInfoResp?.room_info?.type_id == "6") {
|
||||
maxHeightDp = 453
|
||||
} else if (mRoomInfoResp?.room_info?.type_id == "7") {
|
||||
maxHeightDp = 373
|
||||
} else if (mRoomInfoResp!!.room_info.type_id == "9") {
|
||||
maxHeightDp = 373
|
||||
} else if (mRoomInfoResp!!.room_info.type_id == "10"){
|
||||
maxHeightDp = 333
|
||||
}
|
||||
adjustLayoutHeights()
|
||||
val vpRoomPager: View = mBinding!!.vpRoomPager
|
||||
val params = ConstraintLayout.LayoutParams(
|
||||
ConstraintLayout.LayoutParams.MATCH_PARENT,
|
||||
ConstraintLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
// params.dimensionRatio = "W,1:0.85"
|
||||
// when (mRoomInfoResp?.room_info?.type_id) {
|
||||
// "1", "3", "4", "8" ->
|
||||
// if (mRoomInfoResp?.room_info?.label_id == "1")
|
||||
// params.dimensionRatio = "W,1:0.88"
|
||||
// else
|
||||
// params.dimensionRatio = "W,1:0.82"
|
||||
//
|
||||
// "2" -> params.dimensionRatio = "W,1:0.85"
|
||||
// "6" -> params.dimensionRatio = "W,1:1"
|
||||
// "7" -> params.dimensionRatio = "W,1:0.88"
|
||||
// "9" -> params.dimensionRatio = "W,1:0.85"
|
||||
// "10" -> params.dimensionRatio = "W,1:0.88"
|
||||
// }
|
||||
vpRoomPager.layoutParams = params
|
||||
// if (mRoomInfoResp?.room_info?.type_id == "1" || mRoomInfoResp?.room_info?.type_id == "3" || mRoomInfoResp?.room_info?.type_id == "4"
|
||||
// || mRoomInfoResp?.room_info?.type_id == "8"
|
||||
// ) {
|
||||
// maxHeightDp = if (mRoomInfoResp?.room_info?.label_id == "1") {
|
||||
// 333
|
||||
// } else {
|
||||
// 287
|
||||
// }
|
||||
// } else if (mRoomInfoResp?.room_info?.type_id == "2") {
|
||||
// maxHeightDp = 297
|
||||
// }
|
||||
// if (mRoomInfoResp?.room_info?.type_id == "6") {
|
||||
// maxHeightDp = 453
|
||||
// } else if (mRoomInfoResp?.room_info?.type_id == "7") {
|
||||
// maxHeightDp = 373
|
||||
// } else if (mRoomInfoResp!!.room_info.type_id == "9") {
|
||||
// maxHeightDp = 373
|
||||
// } else if (mRoomInfoResp!!.room_info.type_id == "10") {
|
||||
// maxHeightDp = 333
|
||||
// }
|
||||
// adjustLayoutHeights()
|
||||
}
|
||||
|
||||
@SuppressLint("CommitTransaction")
|
||||
|
||||
@@ -15,6 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMMessage;
|
||||
import com.tencent.imsdk.v2.V2TIMSendCallback;
|
||||
@@ -69,6 +70,7 @@ public class ChatRoomFragment extends BaseMvpFragment<ChatRoomPresenter, RoomFra
|
||||
// 在需要的地方调用 Activity 的方法
|
||||
public void someMethod() {
|
||||
easeChatAdapter.clearData();
|
||||
ToastUtils.showShort("清除成功");
|
||||
}
|
||||
|
||||
public ChatRoomFragment() {
|
||||
|
||||
@@ -741,7 +741,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
||||
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
|
||||
|
||||
pitBean.setIs_online(messageEvent.getText().getFromUserInfo().getIs_online());
|
||||
if (pitBean.getPit_number().equals("9")) {
|
||||
RoomKtvWheatView roomDefaultWheatView = mBinding.muZc;
|
||||
roomDefaultWheatView.setData(pitBean);
|
||||
@@ -771,6 +771,7 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
pitBean.setSex(messageEvent.getText().getFromUserInfo().getSex() + "");
|
||||
pitBean.setCharm(messageEvent.getText().getFromUserInfo().getCharm());
|
||||
pitBean.setDress(messageEvent.getText().getFromUserInfo().getDress());
|
||||
pitBean.setIs_online(messageEvent.getText().getFromUserInfo().getIs_online());
|
||||
roomInfoResp.getSong_pit_list().add(pitBean);
|
||||
}
|
||||
adapter.setNewData(roomInfoResp.getSong_pit_list());
|
||||
|
||||
@@ -22,6 +22,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
@@ -472,7 +473,7 @@ public class EaseChatAdapter extends BaseMultiItemQuickAdapter<EMMessageInfo, Ba
|
||||
userMsgList.clear();
|
||||
systemMsgList.clear();
|
||||
allMsgList.clear();
|
||||
|
||||
getData().clear();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -149,8 +149,6 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ll_bottom"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -158,44 +156,31 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/vp_room_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
app:layout_constraintDimensionRatio="1:0.88"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<!-- <include-->
|
||||
<!-- android:id="@+id/room_cp_view"-->
|
||||
<!-- layout="@layout/room_cp_vip_view"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:elevation="10dp"-->
|
||||
<!-- app:layout_constraintDimensionRatio="16:9"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/vp_room_pager"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="@+id/vp_room_pager"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@+id/vp_room_pager"-->
|
||||
<!-- android:visibility="gone" />-->
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/ease_container"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ease_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/vp_room_pager">
|
||||
app:layout_constraintTop_toBottomOf="@+id/vp_room_pager"/>
|
||||
|
||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||
android:id="@+id/svga_ride"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:minHeight="@dimen/dp_80" />
|
||||
</FrameLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.xscm.moduleutil.widget.RoomMessageInputMenu
|
||||
|
||||
@@ -242,9 +242,9 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_jukebox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_200"
|
||||
android:layout_marginHorizontal="@dimen/dp_12"
|
||||
android:layout_marginVertical="@dimen/dp_10"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_song"
|
||||
tools:listitem="@layout/item_jukebox" />
|
||||
|
||||
|
||||
@@ -18,12 +18,15 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ccc"
|
||||
android:layout_width="@dimen/dp_343"
|
||||
android:layout_height="@dimen/dp_282"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_5"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:background="@drawable/bg_rounded_corner"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_23"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.xscm.modulemain.view.RoomJukeboxWheatView
|
||||
android:id="@+id/wheatView"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_85"
|
||||
android:layout_width="@dimen/dp_65"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="1:1.4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:room_wheat_number="10"
|
||||
|
||||
Reference in New Issue
Block a user