fix: bug fix

This commit is contained in:
eggmanQQQ
2024-12-04 14:40:44 +08:00
parent b9dfb3e5ea
commit 257e40cb32
12 changed files with 238 additions and 164 deletions

View File

@@ -662,7 +662,7 @@ public class RoomOperationDialog extends BottomSheetDialog {
if (!isOnMic) return;
boolean isGameRoom = AvRoomDataManager.get().isOpenGame();
if (!isGameRoom) return;
if (isGameRoom) return;
optAdapter.addData(new OptAction(R.drawable.icon_room_operation_music,
ResUtil.getString(R.string.layout_dialog_voice_seek_02),

View File

@@ -274,6 +274,7 @@ public class GiftV2View extends FrameLayout implements GiftEffectView.GiftEffect
giftInfo = giftReceiveInfo.getGift();
}
if (giftInfo == null) {
OtherExtKt.doLog("礼物IM消息 找不到 礼物 取消送礼特效 渲染");
return;
}
// 算出发送者和接受者的位置

View File

@@ -48,6 +48,7 @@ import com.chwl.core.super_admin.util.SuperAdminUtil
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.UserInfo
import com.chwl.core.utils.extension.subAndReplaceDot
import com.chwl.library.common.util.isRtl
import com.chwl.library.utils.ListUtils
import com.chwl.library.utils.ResUtil
import com.coorchice.library.SuperTextView
@@ -824,8 +825,7 @@ class RoomEffectBoxView @JvmOverloads constructor(
binding.roomMenberInSvga.stepToFrame(0, true)
// val start = if (context.isRtl()) 317.dp.toFloat() else -317.dp.toFloat()
val start = -317.dp.toFloat()
val start = if (context.isRtl()) -317.dp.toFloat() else 317.dp.toFloat()
val objectAnimator1 = ObjectAnimator.ofFloat(binding.roomMenberInSvga, "translationX", start, 0f).setDuration(150)
objectAnimator1.interpolator = AccelerateDecelerateInterpolator()
objectAnimator1.startDelay = 150

View File

@@ -69,6 +69,7 @@ import com.chwl.core.super_admin.util.SuperAdminUtil
import com.chwl.core.user.UserModel
import com.chwl.core.user.bean.UserInfo
import com.chwl.core.utils.extension.subAndReplaceDot
import com.chwl.library.common.util.isRtl
import com.chwl.library.utils.ListUtils
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.StringUtils
@@ -1545,8 +1546,7 @@ class RoomEffectView @JvmOverloads constructor(
binding.roomMenberInSvga.setImageDrawable(drawable)
binding.roomMenberInSvga.stepToFrame(0, true)
// val start = if (context.isRtl()) 317.dp.toFloat() else -317.dp.toFloat()
val start = -317.dp.toFloat()
val start = if (context.isRtl()) -317.dp.toFloat() else 317.dp.toFloat()
val objectAnimator1 = ObjectAnimator.ofFloat(binding.roomMenberInSvga, "translationX", start, 0f).setDuration(150)
objectAnimator1.interpolator = AccelerateDecelerateInterpolator()
objectAnimator1.startDelay = 150

View File

@@ -165,6 +165,11 @@ class HomeRoomAdapter : BaseMultiItemQuickAdapter<HomeRoomInfo, BaseViewHolder>
title.setDrawableEmpty(null,null,R.drawable.ic_home_room_icon_service.getDrawable(),null)
}
val maxView = helper.getView<View>(R.id.tv_room_title_max)
maxView?.post {
title.maxWidth = maxView.width
}
} else {

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape android:shape="rectangle">
<solid android:color="@color/appColor" />
<corners android:bottomLeftRadius="50dp" android:topLeftRadius="50dp" />
</shape>
</item>
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="@color/color_CCCCCC" />
<corners android:bottomLeftRadius="50dp" android:topLeftRadius="50dp" />
</shape>
</item>
</selector>

View File

@@ -3,25 +3,28 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_105"
android:layout_marginHorizontal="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_2"
android:layout_height="110dp"
android:background="@color/transparent"
tools:background="@color/black">
tools:background="#66ccff">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_92"
android:layout_marginHorizontal="@dimen/dp_8"
android:id="@+id/itemLayout"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginHorizontal="10dp"
android:layout_marginTop="13dp"
android:background="@drawable/shape_white_12dp_round"
app:layout_constraintBottom_toBottomOf="parent">
app:layout_constraintBottom_toBottomOf="@+id/iv_top"
app:layout_constraintEnd_toEndOf="@+id/iv_top"
app:layout_constraintStart_toStartOf="@+id/iv_top"
app:layout_constraintTop_toTopOf="@+id/iv_top">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/iv_room_image"
android:layout_width="@dimen/dp_72"
android:layout_height="@dimen/dp_72"
android:layout_marginStart="@dimen/dp_10"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_marginStart="10dp"
android:scaleType="centerCrop"
android:src="@drawable/default_cover"
app:layout_constraintBottom_toBottomOf="parent"
@@ -31,18 +34,18 @@
<View
android:id="@+id/div"
android:layout_width="@dimen/dp_8"
app:layout_constraintTop_toTopOf="@id/flag"
tools:background="#66ccff"
android:layout_width="8dp"
android:layout_height="50dp"
app:layout_constraintStart_toEndOf="@id/iv_room_image"
android:layout_height="50dp"/>
app:layout_constraintTop_toTopOf="@id/flag"
tools:background="#66ccff" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/svga_pk"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_marginEnd="@dimen/dp_4"
android:layout_marginBottom="@dimen/dp_2"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="2dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@id/iv_room_image"
app:layout_constraintEnd_toEndOf="@id/iv_room_image" />
@@ -50,10 +53,10 @@
<ImageView
android:id="@+id/flag"
android:layout_width="@dimen/dp_21"
android:paddingEnd="@dimen/dp_3"
android:layout_width="21dp"
android:layout_height="14dp"
android:paddingStart="0dp"
android:layout_height="@dimen/dp_14"
android:paddingEnd="3dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_room_title"
app:layout_constraintStart_toEndOf="@+id/div"
@@ -63,32 +66,46 @@
<com.chwl.library.widget.text.DrawableTextView
android:id="@+id/tv_room_title"
android:layout_width="0dp"
android:drawablePadding="@dimen/dp_2"
app:dt_drawableRightWidth="@dimen/dp_14"
app:dt_drawableRightHeight="@dimen/dp_14"
app:dt_drawableRightSrc="@drawable/transparent_draw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/dp_30"
android:paddingEnd="30dp"
android:textColor="@color/color_1E1E1F"
android:textSize="@dimen/sp_15"
android:textStyle="bold"
app:dt_drawableRightHeight="14dp"
app:dt_drawableRightSrc="@drawable/transparent_draw"
app:dt_drawableRightWidth="14dp"
app:layout_constraintBottom_toTopOf="@id/tv_desc"
app:layout_constraintStart_toEndOf="@id/flag"
app:layout_constraintTop_toTopOf="@+id/iv_room_image"
app:layout_constraintVertical_chainStyle="packed"
tools:text="111" />
<View
android:id="@+id/tv_room_title_max"
android:layout_width="0dp"
android:layout_height="10dp"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="30dp"
android:textColor="@color/color_1E1E1F"
android:textSize="@dimen/sp_15"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tv_desc"
app:layout_constraintEnd_toStartOf="@id/boomIcon"
app:layout_constraintStart_toEndOf="@id/flag"
app:layout_constraintTop_toTopOf="@+id/iv_room_image"
app:layout_constraintVertical_chainStyle="packed"
tools:text="tv_room_titletv_room_titletv_room_titletv_room_titletv_room_titletv_room_title" />
app:layout_constraintTop_toTopOf="@+id/iv_room_image" />
<ImageView
android:id="@+id/iv_tag"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_22"
android:layout_height="22dp"
android:adjustViewBounds="true"
android:minWidth="@dimen/dp_53"
android:minWidth="53dp"
app:layout_constraintBottom_toBottomOf="@+id/tv_desc"
app:layout_constraintStart_toStartOf="@id/flag"
app:layout_constraintTop_toTopOf="@+id/tv_desc"
@@ -99,16 +116,16 @@
android:id="@+id/tv_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginEnd="@dimen/dp_4"
android:layout_marginStart="3dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="4dp"
android:ellipsize="end"
android:hint="@string/home_room_card_topic_empty_def"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="#1E1E1F"
android:textColorHint="#1E1E1F"
android:textSize="@dimen/dp_12"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@id/recycler_view_users"
app:layout_constraintEnd_toStartOf="@+id/boomIcon"
app:layout_constraintStart_toEndOf="@id/iv_tag"
@@ -118,8 +135,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_users"
android:layout_width="0dp"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_6"
android:layout_height="20dp"
android:layout_marginTop="6dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
android:overScrollMode="never"
@@ -134,13 +151,13 @@
android:id="@+id/tv_online_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginBottom="15dp"
android:drawableStart="@drawable/home_ic_hot"
android:drawablePadding="@dimen/dp_3"
android:drawablePadding="3dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#84868A"
android:textSize="@dimen/dp_12"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/boomIcon"
app:layout_constraintStart_toStartOf="@id/boomIcon"
@@ -149,10 +166,10 @@
<com.tencent.qgame.animplayer.AnimView
android:id="@+id/boomAnim"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_37"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_11"
android:layout_width="26dp"
android:layout_height="37dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="11dp"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -161,10 +178,10 @@
<ImageView
android:id="@+id/boomIcon"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_37"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginEnd="@dimen/dp_11"
android:layout_width="26dp"
android:layout_height="37dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="13dp"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -178,11 +195,12 @@
<ImageView
android:id="@+id/iv_top"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="105dp"
android:layout_marginBottom="2dp"
android:scaleType="fitXY"
android:src="@drawable/ic_home_room_bg_top_2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:background="@drawable/ic_home_room_bg_top_1"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -322,7 +322,7 @@ public class GiftModel extends BaseModel implements IGiftModel {
IMNetEaseManager.get().getChatRoomEventObservable().onNext(new RoomEvent()
.setEvent(RoomEvent.RECEIVE_NORMALE_GIFT_ALL_SERVICE)
.setGiftReceiveInfo(giftAllServiceAttachment.getGiftReceiveInfo()));
// 全服送礼推送 没有附带礼物值
// 全服送礼推送 没有附带礼物值
}
} else if (attachment.getFirst() == CustomAttachment.CUSTOM_MSG_HEADER_TYPE_MULTI_GIFT) {//多人12
@@ -633,6 +633,9 @@ public class GiftModel extends BaseModel implements IGiftModel {
if (giftInfo == null) {
giftInfo = findGiftInfoById(allGiftListInfo.getCustomGift(), giftId);
}
if (giftInfo == null) {
giftInfo = findGiftInfoById(allGiftListInfo.getCustomGift(), giftId);
}
}
return giftInfo;
}

View File

@@ -35,6 +35,7 @@ import com.chwl.core.room.queuing_mic.attachment.QueuingMicAttachment;
import com.chwl.core.super_admin.attachment.SuperAdminOpAttachment;
import com.chwl.core.super_admin.util.SaMsgUtil;
import com.chwl.core.utils.LogUtils;
import com.chwl.library.common.util.OtherExtKt;
import com.chwl.library.utils.ResUtil;
import com.chwl.library.utils.log.MLog;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
@@ -68,11 +69,13 @@ public class CustomAttachParser implements MsgAttachmentParser {
JSONObject object = JSON.parseObject(json);
int first = object.getInteger("first");
int second = object.getInteger("second");
OtherExtKt.doLog("IM消息 收到 first = "+first+" second = "+second );
switch (first) {
case CustomAttachment.CUSTOM_MSG_HEADER_TYPE_AUCTION:
attachment = new AuctionAttachment(first, second);
break;
case CustomAttachment.CUSTOM_MSG_HEADER_TYPE_GIFT:
OtherExtKt.doLog("礼物IM消息 收到 first = 3 second = "+second );
if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_GIFT) {
attachment = new GiftAttachment(first, second);
} else if (second == CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_LUCKY_GIFT) {

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.chwl.core.gift.GiftModel;
import com.chwl.core.gift.bean.GiftInfo;
import com.chwl.core.gift.bean.GiftReceiveInfo;
import com.google.gson.Gson;
/**
* @author chenran
@@ -45,13 +46,32 @@ public class GiftAllServiceAttachment extends CustomAttachment {
giftReceiveInfo.setTargetNick(data.getString("recvUserNick"));
giftReceiveInfo.setTargetAvatar(data.getString("recvUserAvatar"));
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftReceiveInfo.getGiftId());
if (giftInfo != null) {
giftInfo.setNotifyFull(data.getInteger("notifyFull"));
giftInfo.setShowAvatarType(data.getInteger("showAvatarType"));
GiftInfo giftInfo;
if (data.containsKey("giftVo")) {
JSONObject giftJson = data.getJSONObject("giftVo");
if (giftJson != null) {
giftInfo = new Gson().fromJson(giftJson.toJSONString(), GiftInfo.class);
giftReceiveInfo.setGift(giftInfo);
}
} else {
//先找礼物列表
giftInfo = GiftModel.get().findGiftInfoById(giftReceiveInfo.getGiftId());
if (giftInfo != null) {
giftInfo.setNotifyFull(data.getInteger("notifyFull"));
giftInfo.setShowAvatarType(data.getInteger("showAvatarType"));
} else {
//再找背包列表
giftInfo = GiftModel.get().findGiftInfoByIdInKnapList(giftReceiveInfo.getGiftId());
if (giftInfo != null) {
giftInfo.setNotifyFull(data.getInteger("notifyFull"));
giftInfo.setShowAvatarType(data.getInteger("showAvatarType"));
}
}
giftReceiveInfo.setGift(giftInfo);
}
giftReceiveInfo.setGift(giftInfo);
}
@Override

View File

@@ -13,6 +13,7 @@ import androidx.core.text.TextUtilsCompat
import androidx.core.text.clearSpans
import androidx.core.view.ViewCompat
import androidx.core.view.isVisible
import com.chwl.library.BuildConfig
import com.chwl.library.utils.ResUtil
import com.chwl.library.utils.SizeUtils
import com.example.lib_utils.UiUtils.isRtl
@@ -117,11 +118,13 @@ fun String?.doToast() {
}
}
fun String?.doLog() {
if (this.isVerify()) {
val stackTrace = Thread.currentThread().stackTrace
val line = stackTrace?.getOrNull(3)?.lineNumber?:""
val fileName = stackTrace?.getOrNull(3)?.fileName?:""
Log.println(Log.DEBUG, "doLog", "$this at ($fileName:$line)")
if (BuildConfig.DEBUG) {
if (this.isVerify()) {
val stackTrace = Thread.currentThread().stackTrace
val line = stackTrace?.getOrNull(3)?.lineNumber?:""
val fileName = stackTrace?.getOrNull(3)?.fileName?:""
Log.println(Log.DEBUG, "doLog", "$this at ($fileName:$line)")
}
}
}

187
mode.json
View File

@@ -1,96 +1,95 @@
{
"success": true,
"code": 200,
"message": "success",
"data": [
{
"cardId": 8,
"name": "公爵",
"pic": "https://image.molistar.xyz/v6_info_card.mp4",
"used": true,
"expireDays": 10,
"comeFrom": 1,
"hasExpired": false,
"expireTime": 1734062400000,
"effectType": 0
"data": {
"fullScreen": false,
"giftId": 1979,
"giftUrl": "http://beta.img.pekolive.com/Fl4idNRgnahpCmrz0MhV4oNXrPp1?imageslim",
"giftVo": {
"consumeType": 1,
"giftExplainUrl": "",
"giftId": 1979,
"giftName": "端午",
"giftType": 2,
"giftUrl": "http://beta.img.pekolive.com/Fl4idNRgnahpCmrz0MhV4oNXrPp1?imageslim",
"goldPrice": 60,
"hasEffect": false,
"hasLatest": false,
"hasSvga": false,
"hasTimeLimit": false,
"hasVggPic": false,
"i18nGiftNameMap": {
"ar": "端午小粽",
"en": "端午小粽",
"zh": "端午",
"tr": "端午小粽"
},
"isNobleGift": false,
"isSendMsg": false,
"isSkipRoom": false,
"isWholeServer": true,
"luckyGiftSvgaUrl": "",
"nobleId": 0,
"notifyFull": 1,
"otherViewType": 0,
"roomExclude": false,
"seqNo": -99999,
"showAvatarType": 0,
"vggUrl": "",
"viewUrl": ""
},
{
"cardId": 1,
"name": "騎士",
"pic": "https://image.molistar.xyz/v1_info_card.mp4",
"used": false,
"expireDays": 2,
"comeFrom": 1,
"hasExpired": false,
"expireTime": 1733371200000,
"effectType": 0
},
{
"cardId": 5,
"name": "侯爵",
"pic": "https://image.molistar.xyz/v5_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1732334400000,
"effectType": 0
},
{
"cardId": 10,
"name": "帝王",
"pic": "https://image.molistar.xyz/v8_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1727582400000,
"effectType": 0
},
{
"cardId": 9,
"name": "親王",
"pic": "https://image.molistar.xyz/v7_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1727582400000,
"effectType": 0
},
{
"cardId": 4,
"name": "伯爵",
"pic": "https://image.molistar.xyz/v4_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1727582400000,
"effectType": 0
},
{
"cardId": 3,
"name": "子爵",
"pic": "https://image.molistar.xyz/v3_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1727582400000,
"effectType": 0
},
{
"cardId": 2,
"name": "男爵",
"pic": "https://image.molistar.xyz/v2_info_card.mp4",
"used": false,
"expireDays": 0,
"comeFrom": 1,
"hasExpired": true,
"expireTime": 1727582400000,
"effectType": 0
}
],
"timestamp": 1733221943100
}
"homeShow": false,
"notifyFull": 1,
"recvUserAvatar": "https://image.pekolive.com/bfed3b08-1ebe-42dc-b9a4-619cb2da0e43.gif",
"recvUserErbanNo": 6228657,
"recvUserNick": "Molistar",
"recvUserUid": 3224,
"sendMsg": false,
"sendUserAvatar": "https://image.pekolive.com/bfed3b08-1ebe-42dc-b9a4-619cb2da0e43.gif",
"sendUserErbanNo": 6228657,
"sendUserNick": "Molistar",
"sendUserUid": 3224,
"showAvatarType": 0,
"skipRoom": false,
"targetUid": 3224,
"targetUids": [
3224
],
"targetUsers": [
{
"appVersion": "1.0.17",
"avatar": "https://image.pekolive.com/bfed3b08-1ebe-42dc-b9a4-619cb2da0e43.gif",
"birth": 1137772800000,
"certifyModifyTimes": 0,
"channel": "official",
"channelType": 1,
"createTime": 1724986857000,
"currentApp": "molistar",
"defUser": 1,
"deviceId": "c0e4cd00-242e-4c46-abc4-0e4885de6668",
"erbanNo": 6228657,
"fansNum": 3,
"followNum": 3,
"gender": 1,
"hasPrettyErbanNo": false,
"lastLoginIp": "123.88.32.247",
"lastLoginRegion": "中國|廣東省|鐵通",
"lastLoginTime": 1733283423000,
"newDevice": true,
"nick": "Molistar",
"os": "android",
"osversion": "5.1.1",
"partitionId": 2,
"phone": "-6228657",
"phoneAreaCode": "86",
"platformRole": 0,
"region": "馬來西亞",
"regionId": 14,
"roomUid": 3481,
"uid": 3224,
"updateTime": 1733283422000,
"useStatus": 0
}
]
},
"first": 3,
"second": 35
} null