福袋飘屏改为svga

This commit is contained in:
huangjian
2022-06-09 15:26:17 +08:00
parent df673fabd6
commit 3532e0d95a
7 changed files with 848 additions and 723 deletions

Binary file not shown.

View File

@@ -1107,6 +1107,7 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
attachment.setLuckyBagNoticeInfo(JSON.parseObject(String.valueOf(baseProtocol.getData()), LuckyBagNoticeInfo.class));
ChatRoomMessage message = ChatRoomMessageBuilder.createChatRoomCustomMessage(String.valueOf(AvRoomDataManager.get().getRoomId()), attachment);
IMNetEaseManager.get().noticeServiceLuckyBagNotice(message);
IMNetEaseManager.get().addMessages(message);
}
break;
case CUSTOM_MSG_ROOM_PK:

View File

@@ -82,6 +82,7 @@ import com.yizhuan.xchat_android_core.gift.bean.GiftList;
import com.yizhuan.xchat_android_core.gift.bean.GiftReceiveInfo;
import com.yizhuan.xchat_android_core.gift.bean.GiftReceiver;
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagGifts;
import com.yizhuan.xchat_android_core.gift.bean.LuckyBagNoticeInfo;
import com.yizhuan.xchat_android_core.helper.ImHelperUtils;
import com.yizhuan.xchat_android_core.home.event.FollowRoomEvent;
import com.yizhuan.xchat_android_core.home.model.CollectionRoomModel;
@@ -110,6 +111,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomNoticeAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.RoomTipAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.TarotAttachment;
import com.yizhuan.xchat_android_core.im.custom.bean.TarotMsgBean;
@@ -968,6 +970,8 @@ public class MessageView extends FrameLayout {
setVipMsg(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_FANS_TEAM) {
setFansTeamMsg(chatRoomMessage, tvContent);
} else if (first == CustomAttachment.CUSTOM_MSG_LUCKY_GIFT) {
setLuckyGiftServerNotifyMsg(chatRoomMessage, tvContent);
} else {
tvContent.setTextColor(Color.WHITE);
tvContent.setText(tvContent.getResources().getText(R.string.not_support_message_tip));
@@ -1057,6 +1061,24 @@ public class MessageView extends FrameLayout {
}
}
private void setLuckyGiftServerNotifyMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
RoomReceivedLuckyGiftAttachment attachment = (RoomReceivedLuckyGiftAttachment) chatRoomMessage.getAttachment();
if (attachment.getSecond() == CustomAttachment.CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY) {
LuckyBagNoticeInfo noticeInfo = attachment.getLuckyBagNoticeInfo();
String nickName = RegexUtil.getPrintableString(noticeInfo.getNick());
SpannableBuilder text = new SpannableBuilder(tvContent)
.append("恭喜 ", new ForegroundColorSpan(textColor))
.append(nickName, new ForegroundColorSpan(roomTipNickColor))
.append("", new ForegroundColorSpan(textColor))
.append(noticeInfo.getRoomTitle() + "", new ForegroundColorSpan(roomTipNickColor))
.append("房间通过", new ForegroundColorSpan(textColor))
.append(noticeInfo.getLuckyBagName(), new ForegroundColorSpan(roomTipNickColor))
.append(",开出", new ForegroundColorSpan(textColor))
.append(noticeInfo.getGiftName() + "", new ForegroundColorSpan(roomTipNickColor));
tvContent.setText(text.build());
}
}
private void setDatingMsg(ChatRoomMessage chatRoomMessage, TextView tvContent, int second) {
if (chatRoomMessage.getAttachment() instanceof DatingAttachment) {
DatingAttachment datingAttachment = (DatingAttachment) chatRoomMessage.getAttachment();

View File

@@ -98,7 +98,7 @@
android:id="@+id/fl_svga_vip_notify"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="75:11"
app:layout_constraintDimensionRatio="75:12"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1175,6 +1175,7 @@ public final class IMNetEaseManager {
break;
case CUSTOM_MSG_LUCKY_GIFT_SERVER_NOTIFY:
noticeServiceLuckyBagNotice(msg);
addMessages(msg);
break;
}
break;

View File

@@ -11,4 +11,6 @@ public class LuckyBagNoticeInfo implements Serializable {
private String nick;
private String luckyBagName;
private String giftName;
private String roomTitle;
private String goldPrice;
}