飘屏UI修改
BIN
app/src/main/assets/svga/kitchen_notify.svga
Normal file
@@ -1,6 +1,7 @@
|
||||
package com.nnbc123.app.avroom.widget;
|
||||
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_GIFT_COMPOUND;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KITCHEN;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_RED_PACKAGE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_BOX_ME;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_FANS_TEAM_JOIN;
|
||||
@@ -43,7 +44,9 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.nnbc123.app.ui.utils.ImageLoadKt;
|
||||
import com.nnbc123.app.utils.MsgBuilder;
|
||||
import com.nnbc123.app.utils.UserUtils;
|
||||
import com.nnbc123.core.im.custom.bean.RoomKitchenAttachment;
|
||||
import com.nnbc123.core.im.custom.bean.WishListAttachment;
|
||||
import com.nnbc123.core.room.wishlist.WishListModel;
|
||||
import com.netease.nim.uikit.business.uinfo.UserInfoHelper;
|
||||
@@ -886,6 +889,9 @@ public class MessageView extends FrameLayout {
|
||||
setBoxMeMsg(chatRoomMessage, tvContent);
|
||||
} else if (first == CustomAttachment.CUSTOM_MSG_RADISH) {
|
||||
setRadishMeMsg(chatRoomMessage, tvContent);
|
||||
}
|
||||
else if (first == CUSTOM_MSG_KITCHEN) {
|
||||
setKitchenMsg(chatRoomMessage, tvContent);
|
||||
} else if (first == CustomAttachment.CUSTOM_MSG_KTV) {
|
||||
setKtvMsg(chatRoomMessage, tvContent);
|
||||
} else if (first == CustomAttachment.CUSTOM_MSG_QUEUING_MIC) {
|
||||
@@ -1729,9 +1735,9 @@ public class MessageView extends FrameLayout {
|
||||
RoomBoxPrizeAttachment attachment = (RoomBoxPrizeAttachment) chatRoomMessage.getAttachment();
|
||||
// 内容
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append("厉害了 ", new ForegroundColorSpan(greyColor))
|
||||
.append("厉害了!", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
|
||||
.append("摘" + attachment.getBoxTypeStr() + "获得 ", new ForegroundColorSpan(greyColor))
|
||||
.append("在魔法帽中获得 ", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getPrizeName(), new ForegroundColorSpan(Color.WHITE));
|
||||
if (attachment.getPrizeNum() > 1) {
|
||||
text.append(" x" + attachment.getPrizeNum() + " ", new ForegroundColorSpan(roomTipColor));
|
||||
@@ -1748,7 +1754,7 @@ public class MessageView extends FrameLayout {
|
||||
SpannableBuilder text = new SpannableBuilder(tvContent)
|
||||
.append("厉害了 ", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getNick() + " ", new ForegroundColorSpan(roomTipColor))
|
||||
.append(attachment.getBoxTypeStr() + " 获得", new ForegroundColorSpan(greyColor))
|
||||
.append("在星际探险中获得", new ForegroundColorSpan(greyColor))
|
||||
.append(attachment.getPrizeName(), new ForegroundColorSpan(Color.WHITE));
|
||||
if (attachment.getPrizeNum() > 1) {
|
||||
text.append(" x" + attachment.getPrizeNum() + " ", new ForegroundColorSpan(roomTipColor));
|
||||
@@ -2650,6 +2656,17 @@ public class MessageView extends FrameLayout {
|
||||
tvContent.setText(text.build());
|
||||
}
|
||||
|
||||
private void setKitchenMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
|
||||
if (chatRoomMessage.getAttachment() instanceof RoomKitchenAttachment) {
|
||||
RoomKitchenAttachment attachment = (RoomKitchenAttachment) chatRoomMessage.getAttachment();
|
||||
tvContent.setText(MsgBuilder.buildKitchenMsg(attachment, roomTipNickColor).build());
|
||||
|
||||
if (MsgBuilder.setUpKitchenClick(tvContent, attachment.getSkipUrl(), attachment.getNeedLevel())) {
|
||||
tvContent.setOnClickListener(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setKtvMsg(ChatRoomMessage chatRoomMessage, TextView tvContent) {
|
||||
|
||||
MusicInfoAttachment attachment = (MusicInfoAttachment) chatRoomMessage.getAttachment();
|
||||
|
@@ -37,6 +37,7 @@ import com.nnbc123.app.ui.utils.load
|
||||
import com.nnbc123.app.ui.utils.loadAnim
|
||||
import com.nnbc123.app.ui.widget.SimpleAnimListener
|
||||
import com.nnbc123.app.ui.widget.drawgift.DrawGiftPlayHelper
|
||||
import com.nnbc123.app.utils.MsgBuilder
|
||||
import com.nnbc123.app.utils.SpannableBuilder
|
||||
import com.nnbc123.xchat_android_constants.XChatConstants
|
||||
import com.nnbc123.core.auth.AuthModel
|
||||
@@ -49,6 +50,7 @@ import com.nnbc123.core.room.bean.DatingNotifyInfo
|
||||
import com.nnbc123.core.super_admin.util.SuperAdminUtil
|
||||
import com.nnbc123.core.user.UserModel
|
||||
import com.nnbc123.core.user.bean.UserInfo
|
||||
import com.nnbc123.core.utils.sub
|
||||
import com.nnbc123.core.utils.subAndReplaceDot
|
||||
import com.nnbc123.library.utils.ListUtils
|
||||
import com.opensource.svgaplayer.*
|
||||
@@ -121,6 +123,14 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
private val messagesRadishSVGA: MutableList<ChatRoomMessage> by lazy { java.util.ArrayList() }
|
||||
private var radishSVGADisposable: Disposable? = null
|
||||
|
||||
|
||||
private var kitchenAnimation: Animation? = null
|
||||
private var kitchenDisposable: Disposable? = null
|
||||
private val kitchenMessages: MutableList<ChatRoomMessage> by lazy { ArrayList() }
|
||||
|
||||
private var kitchenSVGADisposable: Disposable? = null
|
||||
private val kitchenMessagesSVGA: MutableList<ChatRoomMessage> by lazy { ArrayList() }
|
||||
|
||||
private var isSvgaPlaying = false
|
||||
|
||||
private var isHideCarEffect = false
|
||||
@@ -215,6 +225,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
binding.svgaWishList.startAnimation()
|
||||
}
|
||||
}
|
||||
RoomEvent.KITCHEN_ROOM -> addKitchenNotify(roomEvent.chatRoomMessage)
|
||||
RoomEvent.KITCHEN_ALL_ROOM -> addKitchenNotifyBySVGA(roomEvent.chatRoomMessage)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@@ -427,10 +439,10 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
val text = SpannableBuilder()
|
||||
.append("厉害了! ", ForegroundColorSpan(Color.WHITE))
|
||||
.append(
|
||||
attachment.nick + " ",
|
||||
attachment.nick.sub(6) + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append("摘" + attachment.boxTypeStr + "获得 ", ForegroundColorSpan(Color.WHITE))
|
||||
.append("在魔法帽中获得", ForegroundColorSpan(Color.WHITE))
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_gift))
|
||||
@@ -478,7 +490,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
attachment.nick + " ",
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_nick))
|
||||
)
|
||||
.append("摘" + attachment.boxTypeStr + "获得 ", ForegroundColorSpan(Color.WHITE))
|
||||
.append("在魔法帽中获得", ForegroundColorSpan(Color.WHITE))
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(resources.getColor(R.color.notice_gift))
|
||||
@@ -502,7 +514,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字体颜色
|
||||
textPaint.textSize = 24f //字体大小
|
||||
textPaint.textSize = 26f //字体大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
@@ -514,7 +526,7 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "tgs_copywriting"
|
||||
), "msm_copywriting"
|
||||
)
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
@@ -555,12 +567,12 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
.append("厉害了! ", ForegroundColorSpan(Color.WHITE))
|
||||
.append(
|
||||
attachment.nick.subAndReplaceDot(6) + " ",
|
||||
ForegroundColorSpan(Color.parseColor("#FEF73D"))
|
||||
ForegroundColorSpan(Color.parseColor("#FDFF2C"))
|
||||
)
|
||||
.append(attachment.boxTypeStr + " 获得", ForegroundColorSpan(Color.WHITE))
|
||||
.append("在星际探索中获得", ForegroundColorSpan(Color.WHITE))
|
||||
.append(
|
||||
attachment.prizeName,
|
||||
ForegroundColorSpan(Color.parseColor("#FFD800"))
|
||||
ForegroundColorSpan(Color.parseColor("#FDFF2C"))
|
||||
)
|
||||
if (attachment.prizeNum > 1) {
|
||||
text.append("x" + attachment.prizeNum, ForegroundColorSpan(Color.WHITE))
|
||||
@@ -1321,6 +1333,118 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
}, SHOW_TIME.toLong())
|
||||
}
|
||||
|
||||
/**
|
||||
* 幸运池飘屏
|
||||
*
|
||||
* @param chatRoomMessage
|
||||
*/
|
||||
private fun addKitchenNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
binding.clNotify.visibility = VISIBLE
|
||||
}
|
||||
kitchenMessages.add(chatRoomMessage)
|
||||
if (kitchenDisposable == null || kitchenMessages.size == 1) {
|
||||
kitchenDisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.takeWhile { kitchenMessages.size > 0 }
|
||||
.subscribe {
|
||||
showKitchenNotify(
|
||||
kitchenMessages.removeAt(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showKitchenNotify(chatRoomMessage: ChatRoomMessage) {
|
||||
val attachment = chatRoomMessage.attachment as RoomKitchenAttachment
|
||||
val textView =
|
||||
LayoutInflater.from(mContext)
|
||||
.inflate(R.layout.layout_room_kitchen_notify, null) as TextView
|
||||
val text = MsgBuilder.buildKitchenMsg(attachment)
|
||||
textView.text = text.build()
|
||||
MsgBuilder.setUpKitchenClick(textView, attachment.skipUrl, attachment.needLevel)
|
||||
kitchenAnimation = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify)
|
||||
binding.flKitchenNotify.addView(textView)
|
||||
textView.startAnimation(kitchenAnimation)
|
||||
binding.flKitchenNotify.postDelayed(
|
||||
{ binding.flKitchenNotify.removeView(textView) },
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 幸运池飘屏 五级 SVGA背景的
|
||||
*
|
||||
* @param chatRoomMessage
|
||||
*/
|
||||
private fun addKitchenNotifyBySVGA(chatRoomMessage: ChatRoomMessage) {
|
||||
if (binding.clNotify.visibility == GONE) {
|
||||
binding.clNotify.visibility = VISIBLE
|
||||
}
|
||||
kitchenMessagesSVGA.add(chatRoomMessage)
|
||||
if (kitchenSVGADisposable == null || kitchenMessagesSVGA.size == 1) {
|
||||
kitchenSVGADisposable = Observable.interval(0, PERIOD.toLong(), TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.takeWhile { kitchenMessagesSVGA.size > 0 }
|
||||
.subscribe {
|
||||
showKitchenNotifyBySVGA(
|
||||
kitchenMessagesSVGA.removeAt(0)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showKitchenNotifyBySVGA(chatRoomMessage: ChatRoomMessage) {
|
||||
val attachment = chatRoomMessage.attachment as RoomKitchenAttachment
|
||||
val text = MsgBuilder.buildKitchenMsg(attachment)
|
||||
val svgaImageView = SVGAImageView(mContext)
|
||||
svgaImageView.loops = 1
|
||||
svgaImageView.clearsAfterStop = true
|
||||
val params = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
svgaImageView.layoutParams = params
|
||||
svgaImageView.callback = object : SimpleSvgaCallback() {
|
||||
override fun onFinished() {
|
||||
binding.flKitchenSvgaNotify.post {
|
||||
binding.flKitchenSvgaNotify.removeView(
|
||||
svgaImageView
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
MsgBuilder.setUpKitchenClick(svgaImageView, attachment.skipUrl, attachment.needLevel)
|
||||
binding.flKitchenSvgaNotify.addView(svgaImageView)
|
||||
shareParser().decodeFromAssets(
|
||||
"svga/kitchen_notify.svga",
|
||||
object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
val dynamicEntity = SVGADynamicEntity()
|
||||
val textPaint = TextPaint()
|
||||
textPaint.color = Color.WHITE //字体颜色
|
||||
textPaint.textSize = 24f //字体大小
|
||||
dynamicEntity.setDynamicText(
|
||||
StaticLayout(
|
||||
text.build(),
|
||||
0,
|
||||
text.build().length,
|
||||
textPaint,
|
||||
0,
|
||||
Layout.Alignment.ALIGN_CENTER,
|
||||
1.0f,
|
||||
0.0f,
|
||||
false
|
||||
), "noble_text_tx"
|
||||
)
|
||||
val drawable = SVGADrawable(videoItem, dynamicEntity)
|
||||
svgaImageView.setImageDrawable(drawable)
|
||||
svgaImageView.stepToFrame(0, true)
|
||||
}
|
||||
|
||||
override fun onError() {}
|
||||
},
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
boxDisposable?.dispose()
|
||||
|
45
app/src/main/java/com/nnbc123/app/utils/MsgBuilder.kt
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.nnbc123.app.utils
|
||||
|
||||
import android.graphics.Color
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.View
|
||||
import com.nnbc123.app.ui.webview.CommonWebViewActivity
|
||||
import com.nnbc123.core.im.custom.bean.RoomKitchenAttachment
|
||||
|
||||
|
||||
class MsgBuilder {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
fun buildKitchenMsg(
|
||||
attachment: RoomKitchenAttachment,
|
||||
nickColor: Int = Color.parseColor("#FFF476")
|
||||
): SpannableBuilder {
|
||||
return SpannableBuilder()
|
||||
.append("恭喜 ", ForegroundColorSpan(Color.WHITE))
|
||||
.append(attachment.nick, ForegroundColorSpan(nickColor))
|
||||
.append("在深海奇缘抽中", ForegroundColorSpan(Color.WHITE))
|
||||
.append(attachment.itemMultiple, ForegroundColorSpan(Color.parseColor("#FFF476")))
|
||||
.append("倍奖励,获得", ForegroundColorSpan(Color.WHITE))
|
||||
.append(attachment.diamonds, ForegroundColorSpan(Color.parseColor("#FFF476")))
|
||||
.append("钻石!", ForegroundColorSpan(Color.WHITE))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setUpKitchenClick(view: View, skipUrl: String, needLevel: Int): Boolean {
|
||||
val expLevel = UserUtils.getExpLevel()
|
||||
if (expLevel != 0 && needLevel != 0 && expLevel >= needLevel) {
|
||||
view.setOnClickListener {
|
||||
CommonWebViewActivity.start(
|
||||
view.context,
|
||||
skipUrl
|
||||
)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 67 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_kitchen_notice.png
Normal file
After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 16 KiB |
@@ -13,6 +13,7 @@
|
||||
android:lineSpacingMultiplier="0.9"
|
||||
android:paddingStart="80dp"
|
||||
android:paddingEnd="80dp"
|
||||
android:textSize="12sp"
|
||||
android:textSize="13sp"
|
||||
android:paddingTop="7dp"
|
||||
tools:layout_height="wrap_content"
|
||||
tools:text="哈哈哈哈哈哈啊哈哈啊哈哈哈哈哈哈哈哈哈哈哈" />
|
@@ -70,11 +70,25 @@
|
||||
app:layout_constraintDimensionRatio="75:11"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_kitchen_notify"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="750:154"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_kitchen_svga_notify"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintDimensionRatio="750:176"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_box_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" />
|
||||
|
||||
<FrameLayout
|
||||
@@ -95,7 +109,7 @@
|
||||
android:id="@+id/fl_svga_box_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" />
|
||||
|
||||
<FrameLayout
|
||||
|
18
app/src/main/res/layout/layout_room_kitchen_notify.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.coorchice.library.SuperTextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@drawable/bg_kitchen_notice"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="0dp"
|
||||
android:lineSpacingMultiplier="0.9"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="80dp"
|
||||
android:paddingEnd="80dp"
|
||||
android:textSize="12sp"
|
||||
tools:layout_height="wrap_content"
|
||||
tools:text="哈哈哈哈哈哈啊哈哈啊哈哈哈哈哈哈哈哈哈哈哈" />
|
@@ -10,8 +10,7 @@
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center_vertical"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:paddingStart="100dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingStart="80dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp"
|
||||
|
@@ -540,8 +540,8 @@
|
||||
<color name="color_4d000000">#4d000000</color>
|
||||
<color name="transparent_ban">#80000000</color>
|
||||
|
||||
<color name="notice_nick">#FFFE95</color>
|
||||
<color name="notice_gift">#FFFE95</color>
|
||||
<color name="notice_nick">#FFF691</color>
|
||||
<color name="notice_gift">#FFF691</color>
|
||||
<color name="color_FACB4D">#FACB4D</color>
|
||||
<color name="color_FFA572">#FFA572</color>
|
||||
<color name="color_3ECAFC">#3ECAFC</color>
|
||||
|
@@ -105,8 +105,8 @@ public class SquareFragment extends BaseFragment implements MainMagicIndicatorAd
|
||||
@Override
|
||||
public void initiate() {
|
||||
List<Integer> fragmentPos = new ArrayList<>();
|
||||
fragmentPos.add(TAB_TYPE_ATTENT);
|
||||
fragmentPos.add(TAB_TYPE_RECOMMEND);
|
||||
fragmentPos.add(TAB_TYPE_ATTENT);
|
||||
fragmentPos.add(TAB_TYPE_NEW);
|
||||
List<String> tagList = new ArrayList<>();
|
||||
List<Fragment> fragmentList = new ArrayList<>();
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 51 KiB |
@@ -1416,6 +1416,15 @@ public final class IMNetEaseManager {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CUSTOM_MSG_KITCHEN:
|
||||
if (customAttachment.getSecond() == CUSTOM_MSG_SUB_KITCHEN_ROOM) {
|
||||
noticeRoomEvent(msg, RoomEvent.KITCHEN_ROOM);
|
||||
addMessages(msg);
|
||||
} else if (customAttachment.getSecond() == CUSTOM_MSG_SUB_KITCHEN_ALL_ROOM) {
|
||||
noticeRoomEvent(msg, RoomEvent.KITCHEN_ALL_ROOM);
|
||||
addMessages(msg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -28,6 +28,7 @@ import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_SHARE_IN_APP;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEAD_SHIFT_OUT;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_IM_TIP;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KITCHEN;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_KTV;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LEAVE_MODE;
|
||||
import static com.nnbc123.core.im.custom.bean.CustomAttachment.CUSTOM_MSG_LEAVE_MODE_NOTICE;
|
||||
@@ -601,6 +602,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
|
||||
case CUSTOM_MSG_WISH_LIST:
|
||||
attachment = new WishListAttachment(first, second);
|
||||
break;
|
||||
case CUSTOM_MSG_KITCHEN:
|
||||
attachment = new RoomKitchenAttachment(first, second);
|
||||
break;
|
||||
default:
|
||||
LogUtils.e("未定义的first,请现在CustomAttachParser中解析first=" + first + " second=" + second);
|
||||
break;
|
||||
|
@@ -428,6 +428,11 @@ public class CustomAttachment implements MsgAttachment {
|
||||
// 关闭心愿礼物
|
||||
public static final int CUSTOM_MSG_WISH_LIST_CLOSE = 955;
|
||||
|
||||
public static final int CUSTOM_MSG_KITCHEN = 96; // 深海奇缘消息
|
||||
public static final int CUSTOM_MSG_SUB_KITCHEN_ROOM = 960; // 深海奇缘礼物房间飘屏通知(静态)
|
||||
public static final int CUSTOM_MSG_SUB_KITCHEN_ALL_ROOM = 961; // 深海奇缘礼物房间飘屏通知(动态)
|
||||
public static final int CUSTOM_MSG_SUB_kitchen_ALL_APP = 962; // 深海奇缘礼物全服飘屏通知
|
||||
|
||||
|
||||
/**
|
||||
* 自定义消息附件的类型,根据该字段区分不同的自定义消息
|
||||
|
@@ -0,0 +1,129 @@
|
||||
package com.nnbc123.core.im.custom.bean;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* Created by chenran on 2017/10/4.
|
||||
*/
|
||||
|
||||
public class RoomKitchenAttachment extends CustomAttachment {
|
||||
private long uid;
|
||||
private String nick;
|
||||
private long roomUid;
|
||||
private long itemId;
|
||||
private String itemMultiple;
|
||||
private String diamonds;
|
||||
private int bannerId;
|
||||
private String skipUrl;
|
||||
private int needLevel;
|
||||
|
||||
public RoomKitchenAttachment(int first, int second) {
|
||||
super(first, second);
|
||||
}
|
||||
|
||||
public long getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(long uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getNick() {
|
||||
return nick;
|
||||
}
|
||||
|
||||
public void setNick(String nick) {
|
||||
this.nick = nick;
|
||||
}
|
||||
|
||||
public long getRoomUid() {
|
||||
return roomUid;
|
||||
}
|
||||
|
||||
public void setRoomUid(long roomUid) {
|
||||
this.roomUid = roomUid;
|
||||
}
|
||||
|
||||
public long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public void setItemId(long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
public String getItemMultiple() {
|
||||
return itemMultiple;
|
||||
}
|
||||
|
||||
public void setItemMultiple(String itemMultiple) {
|
||||
this.itemMultiple = itemMultiple;
|
||||
}
|
||||
|
||||
public String getDiamonds() {
|
||||
return diamonds;
|
||||
}
|
||||
|
||||
public void setDiamonds(String diamonds) {
|
||||
this.diamonds = diamonds;
|
||||
}
|
||||
|
||||
public int getBannerId() {
|
||||
return bannerId;
|
||||
}
|
||||
|
||||
public void setBannerId(int bannerId) {
|
||||
this.bannerId = bannerId;
|
||||
}
|
||||
|
||||
public String getSkipUrl() {
|
||||
return skipUrl;
|
||||
}
|
||||
|
||||
public void setSkipUrl(String skipUrl) {
|
||||
this.skipUrl = skipUrl;
|
||||
}
|
||||
|
||||
public int getNeedLevel() {
|
||||
return needLevel;
|
||||
}
|
||||
|
||||
public void setNeedLevel(int needLevel) {
|
||||
this.needLevel = needLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void parseData(JSONObject jsonObject) {
|
||||
uid = jsonObject.getLongValue("uid");
|
||||
nick = jsonObject.getString("nick");
|
||||
roomUid = jsonObject.getLongValue("roomUid");
|
||||
itemId = jsonObject.getLongValue("itemId");
|
||||
diamonds = jsonObject.getString("diamonds");
|
||||
itemMultiple = jsonObject.getString("itemMultiple");
|
||||
bannerId = jsonObject.getIntValue("bannerId");
|
||||
skipUrl = jsonObject.getString("skipUrl");
|
||||
needLevel = jsonObject.getIntValue("needLevel");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JSONObject packData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RoomKitchenAttachment{" +
|
||||
"uid=" + uid +
|
||||
", nick='" + nick + '\'' +
|
||||
", roomUid=" + roomUid +
|
||||
", itemId=" + itemId +
|
||||
", itemMultiple='" + itemMultiple + '\'' +
|
||||
", diamonds='" + diamonds + '\'' +
|
||||
", bannerId=" + bannerId +
|
||||
", skipUrl='" + skipUrl + '\'' +
|
||||
", needLevel=" + needLevel +
|
||||
'}';
|
||||
}
|
||||
}
|
@@ -251,6 +251,10 @@ public class RoomEvent {
|
||||
|
||||
public static final int WISH_LIST_EFFECT = 99;
|
||||
|
||||
public static final int KITCHEN_ROOM = 100;
|
||||
|
||||
public static final int KITCHEN_ALL_ROOM = 101;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
private int posState = -1;
|
||||
|