跨房PK:1.PK胜利横幅 2.房间标题长度限制
This commit is contained in:
@@ -25,6 +25,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowGiftDialogEvent
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.ShowUserInfoDialogEvent
|
||||
import com.yizhuan.xchat_android_core.utils.CurrentTimeUtils
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
import com.yizhuan.xchat_android_library.utils.CommonUtils
|
||||
import io.reactivex.Observable
|
||||
@@ -103,7 +104,7 @@ class RoomPKBoardView @JvmOverloads constructor(
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun updateView(roomPkBean: RoomPkBean?) {
|
||||
this.roomPkBean = roomPkBean
|
||||
binding.tvRoomNameLeft.text = roomPkBean?.cTitle
|
||||
binding.tvRoomNameLeft.text = roomPkBean?.cTitle.subAndReplaceDot(7)
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean?.cAvatar,
|
||||
@@ -113,7 +114,7 @@ class RoomPKBoardView @JvmOverloads constructor(
|
||||
binding.viewRankListCharmLeft.updateData(roomPkBean?.crRank)
|
||||
binding.viewRankListContributeLeft.updateData(roomPkBean?.csRank)
|
||||
|
||||
binding.tvRoomNameRight.text = roomPkBean?.aTitle
|
||||
binding.tvRoomNameRight.text = roomPkBean?.aTitle.subAndReplaceDot(7)
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
roomPkBean?.aAvatar,
|
||||
|
@@ -18,6 +18,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
@@ -37,10 +38,9 @@ class RoomPKCreateActivity : BaseViewBindingActivity<ActivityRoomPkCreateBinding
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||
window.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||
WindowManager.LayoutParams.WRAP_CONTENT,
|
||||
)
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
binding.ivHelp.setOnClickListener {
|
||||
@@ -131,7 +131,7 @@ class RoomPKCreateActivity : BaseViewBindingActivity<ActivityRoomPkCreateBinding
|
||||
binding.ivAddPkRoom.isVisible = false
|
||||
binding.llPkRoom.isVisible = true
|
||||
ImageLoadUtils.loadImage(this, it.avatar, binding.ivAvatar)
|
||||
binding.tvRoomTitle.text = it.title
|
||||
binding.tvRoomTitle.text = it.title.subAndReplaceDot(7)
|
||||
binding.tvRoomId.text = "音游号:${it.erbanNo}"
|
||||
checkCommitEnable()
|
||||
}
|
||||
|
@@ -45,10 +45,9 @@ class RoomPKSearchActivity : BaseViewBindingActivity<ActivityRoomPkSearchBinding
|
||||
private var currRoomInfo: SimpleRoomInfo? = null
|
||||
override fun init() {
|
||||
|
||||
//这里的height用MATCH_PARENT状态栏会被顶上去,不知道什么鬼
|
||||
window.setLayout(
|
||||
WindowManager.LayoutParams.MATCH_PARENT,
|
||||
ScreenUtil.screenHeight - ScreenUtil.getStatusBarHeight(context)
|
||||
WindowManager.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
|
||||
@@ -90,7 +89,7 @@ class RoomPKSearchActivity : BaseViewBindingActivity<ActivityRoomPkSearchBinding
|
||||
}
|
||||
|
||||
binding.ivSearch.setOnClickListener {
|
||||
searchKey = binding.editSearch.text?.toString()
|
||||
searchKey = binding.editSearch.text?.toString()
|
||||
loadData(true)
|
||||
}
|
||||
loadData(true)
|
||||
|
@@ -5,13 +5,14 @@ import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.SimpleRoomInfo
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
|
||||
class RoomPKSearchAdapter :
|
||||
BaseQuickAdapter<SimpleRoomInfo, BaseViewHolder>(R.layout.item_room_pk_search) {
|
||||
|
||||
override fun convert(helper: BaseViewHolder, item: SimpleRoomInfo) {
|
||||
helper.setText(R.id.tv_room_title,item.title)
|
||||
.setText(R.id.tv_room_id,"音游号${item.erbanNo}")
|
||||
helper.setText(R.id.tv_room_title,item.title.subAndReplaceDot(7))
|
||||
.setText(R.id.tv_room_id,"音游号:${item.erbanNo}")
|
||||
.setChecked(R.id.check_box,item.checked)
|
||||
ImageLoadUtils.loadImage(mContext,item.avatar,helper.getView(R.id.iv_avatar))
|
||||
helper.addOnClickListener(R.id.iv_avatar,R.id.check_box)
|
||||
|
@@ -9,6 +9,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
|
||||
class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
|
||||
@@ -30,7 +31,7 @@ class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding.tvValueRed.text = "${roomPkBean.cAmount}"
|
||||
binding.ivRedWin.isVisible = roomPkBean.cUid == roomPkBean.winUid && roomPkBean.winUid != 0L
|
||||
ImageLoadUtils.loadImage(
|
||||
@@ -40,7 +41,7 @@ class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding.tvValueBlue.text = "${roomPkBean.aAmount}"
|
||||
binding.ivBlueWin.isVisible =
|
||||
roomPkBean.cUid != roomPkBean.winUid && roomPkBean.winUid != 0L
|
||||
@@ -52,7 +53,7 @@ class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
)
|
||||
|
||||
roomPkBean.csRank.getOrNull(0)?.let {
|
||||
binding.tvNickContribute.text = it.nick
|
||||
binding.tvNickContribute.text = it.nick.subAndReplaceDot(7)
|
||||
binding.tvValueContribute.text = "神豪值:${it.amount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
@@ -63,7 +64,7 @@ class RoomPkFinishDialog : BaseDialog<DialogRoomPkFinishBinding>() {
|
||||
}
|
||||
|
||||
roomPkBean.crRank.getOrNull(0)?.let {
|
||||
binding.tvNickCharm.text = it.nick
|
||||
binding.tvNickCharm.text = it.nick.subAndReplaceDot(7)
|
||||
binding.tvValueCharm.text = "魅力值:${it.amount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
|
@@ -8,6 +8,7 @@ import com.yizhuan.erban.base.BaseDialog
|
||||
import com.yizhuan.erban.databinding.DialogRoomPkForceFinishBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
|
||||
class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
|
||||
@@ -29,7 +30,7 @@ class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
@SuppressLint("CheckResult", "SetTextI18n")
|
||||
override fun init() {
|
||||
binding.ivClose.setOnClickListener { dismissAllowingStateLoss() }
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle
|
||||
binding.tvTitleRed.text = roomPkBean.cTitle.subAndReplaceDot(7)
|
||||
binding.tvValueRed.text = "${roomPkBean.cAmount}"
|
||||
ImageLoadUtils.loadImage(
|
||||
context,
|
||||
@@ -38,7 +39,7 @@ class RoomPkForceFinishDialog : BaseDialog<DialogRoomPkForceFinishBinding>() {
|
||||
R.drawable.default_avatar
|
||||
)
|
||||
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle
|
||||
binding.tvTitleBlue.text = roomPkBean.aTitle.subAndReplaceDot(7)
|
||||
binding.tvValueBlue.text = "${roomPkBean.aAmount}"
|
||||
|
||||
ImageLoadUtils.loadImage(
|
||||
|
@@ -9,6 +9,7 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.room.anotherroompk.RoomPKModel
|
||||
import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@@ -35,7 +36,7 @@ class RoomPkReceivedDialog : BaseDialog<DialogRoomPkReceivedBinding>() {
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun init() {
|
||||
binding.tvNick.text = pkBean.inviteRoomTitle
|
||||
binding.tvNick.text = pkBean.inviteRoomTitle.subAndReplaceDot(7)
|
||||
binding.tvTime.text = "${pkBean.pkDuration}分钟"
|
||||
pkBean.pkDesc.ifNotNullOrEmpty {
|
||||
binding.tvDescTitle.isVisible = true
|
||||
|
@@ -45,6 +45,8 @@ import com.yizhuan.xchat_android_core.im.custom.bean.DatingAllNotifyAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.DatingAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.LevelUpNoticeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomBoxPrizeAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPKAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomReceivedLuckyGiftAttachment;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
@@ -90,26 +92,28 @@ public class RoomEffectView extends FrameLayout {
|
||||
private Animation animation;
|
||||
private List<ChatRoomMessage> messages;
|
||||
private Disposable boxDisposable;
|
||||
private boolean isCreate;
|
||||
|
||||
private List<ChatRoomMessage> messagesBoxSVGA;
|
||||
private Disposable boxSVGADisposable;
|
||||
private boolean isBoxSVGACreate;
|
||||
|
||||
private Animation animationLuckyGift;
|
||||
private List<ChatRoomMessage> messagesLuckyGift;
|
||||
private boolean isCreateLuckyGift;
|
||||
private Disposable disposableLuckyGift;
|
||||
|
||||
private List<ChatRoomMessage> messagesMemberIn;
|
||||
private boolean isCreateMemberIn;
|
||||
private Disposable disposableMemberIn;
|
||||
|
||||
private List<ChatRoomMessage> messagesLevelUp;
|
||||
private boolean isCreateLevelUp;
|
||||
private Disposable disposableLevelUp;
|
||||
|
||||
private Animation animationDatingAll;
|
||||
private List<ChatRoomMessage> messagesDatingAll;
|
||||
private boolean isCreateDatingAll;
|
||||
private Disposable disposableDatingAll;
|
||||
private Disposable datingDisposable;
|
||||
|
||||
private List<ChatRoomMessage> messagesRoomPK;
|
||||
private Disposable disposableRoomPK;
|
||||
|
||||
public RoomEffectView(@NonNull Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
@@ -162,6 +166,9 @@ public class RoomEffectView extends FrameLayout {
|
||||
playCarSvga(null, roomEvent.mRoomCarMsgAttachment.effect, false);
|
||||
}
|
||||
break;
|
||||
case RoomEvent.ROOM_PK_NOTIFY:
|
||||
addRoomPKNotify(roomEvent.getChatRoomMessage());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -197,17 +204,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
binding.clNotify.setVisibility(View.VISIBLE);
|
||||
}
|
||||
messagesDatingAll.add(chatRoomMessage);
|
||||
if (disposableDatingAll == null || messagesDatingAll.size() == 1) {
|
||||
isCreateDatingAll = true;
|
||||
if (disposableDatingAll == null || disposableDatingAll.isDisposed()) {
|
||||
disposableDatingAll = Observable.interval(0, 3, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messagesDatingAll.size() > 0 && !isCreateDatingAll)
|
||||
messagesDatingAll.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isCreateDatingAll = false;
|
||||
})
|
||||
.takeWhile(aLong -> messagesDatingAll.size() > 0 && messagesDatingAll.get(0) != null)
|
||||
.subscribe(aLong -> showDatingAllNotify(messagesDatingAll.get(0)));
|
||||
.subscribe(aLong -> showDatingAllNotify(messagesDatingAll.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,17 +264,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
binding.clNotify.setVisibility(View.VISIBLE);
|
||||
}
|
||||
messagesLuckyGift.add(chatRoomMessage);
|
||||
if (disposableLuckyGift == null || messagesLuckyGift.size() == 1) {
|
||||
isCreateLuckyGift = true;
|
||||
if (disposableLuckyGift == null || disposableLuckyGift.isDisposed()) {
|
||||
disposableLuckyGift = Observable.interval(0, PERIOD, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messagesLuckyGift.size() > 0 && !isCreateLuckyGift)
|
||||
messagesLuckyGift.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isCreateLuckyGift = false;
|
||||
})
|
||||
.takeWhile(aLong -> messagesLuckyGift.size() > 0 && messagesLuckyGift.get(0) != null)
|
||||
.subscribe(aLong -> showLuckyBagNotify(messagesLuckyGift.get(0)));
|
||||
.subscribe(aLong -> showLuckyBagNotify(messagesLuckyGift.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,17 +303,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
binding.clNotify.setVisibility(View.VISIBLE);
|
||||
}
|
||||
messages.add(chatRoomMessage);
|
||||
if (boxDisposable == null || messages.size() == 1) {
|
||||
isCreate = true;
|
||||
if (boxDisposable == null || boxDisposable.isDisposed()) {
|
||||
boxDisposable = Observable.interval(0, PERIOD, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messages.size() > 0 && !isCreate)
|
||||
messages.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isCreate = false;
|
||||
})
|
||||
.takeWhile(aLong -> messages.size() > 0 && messages.get(0) != null)
|
||||
.subscribe(aLong -> showBoxNotify(messages.get(0)));
|
||||
.subscribe(aLong -> showBoxNotify(messages.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,17 +340,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
binding.clNotify.setVisibility(View.VISIBLE);
|
||||
}
|
||||
messagesBoxSVGA.add(chatRoomMessage);
|
||||
if (boxSVGADisposable == null || messagesBoxSVGA.size() == 1) {
|
||||
isBoxSVGACreate = true;
|
||||
if (boxSVGADisposable == null || boxSVGADisposable.isDisposed()) {
|
||||
boxSVGADisposable = Observable.interval(0, PERIOD, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messagesBoxSVGA.size() > 0 && !isBoxSVGACreate)
|
||||
messagesBoxSVGA.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isBoxSVGACreate = false;
|
||||
})
|
||||
.takeWhile(aLong -> messagesBoxSVGA.size() > 0 && messagesBoxSVGA.get(0) != null)
|
||||
.subscribe(aLong -> showBoxNotifyBySVGA(messagesBoxSVGA.get(0)));
|
||||
.subscribe(aLong -> showBoxNotifyBySVGA(messagesBoxSVGA.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,17 +409,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
private void addMemberInNotify(ChatRoomMessage chatRoomMessage) {
|
||||
if (messagesMemberIn == null) messagesMemberIn = new ArrayList<>();
|
||||
messagesMemberIn.add(chatRoomMessage);
|
||||
if (disposableMemberIn == null || messagesMemberIn.size() == 1) {
|
||||
isCreateMemberIn = true;
|
||||
if (disposableMemberIn == null || disposableMemberIn.isDisposed()) {
|
||||
disposableMemberIn = Observable.interval(0, 6, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messagesMemberIn.size() > 0 && !isCreateMemberIn)
|
||||
messagesMemberIn.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isCreateMemberIn = false;
|
||||
})
|
||||
.takeWhile(aLong -> messagesMemberIn.size() > 0 && messagesMemberIn.get(0) != null)
|
||||
.subscribe(aLong -> showMemberInNotify(messagesMemberIn.get(0)));
|
||||
.subscribe(aLong -> showMemberInNotify(messagesMemberIn.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,17 +510,11 @@ public class RoomEffectView extends FrameLayout {
|
||||
private void addLevelUpNotify(ChatRoomMessage chatRoomMessage) {
|
||||
if (messagesLevelUp == null) messagesLevelUp = new ArrayList<>();
|
||||
messagesLevelUp.add(chatRoomMessage);
|
||||
if (disposableLevelUp == null || messagesLevelUp.size() == 1) {
|
||||
isCreateLevelUp = true;
|
||||
if (disposableLevelUp == null || disposableLevelUp.isDisposed()) {
|
||||
disposableLevelUp = Observable.interval(0, 6, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.doOnNext(aLong -> {
|
||||
if (messagesLevelUp.size() > 0 && !isCreateLevelUp)
|
||||
messagesLevelUp.remove(0);//如果不是新创建的Observable发送的数据,需要移除第一个
|
||||
isCreateLevelUp = false;
|
||||
})
|
||||
.takeWhile(aLong -> messagesLevelUp.size() > 0 && messagesLevelUp.get(0) != null)
|
||||
.subscribe(aLong -> showLevelUpNotify(messagesLevelUp.get(0)));
|
||||
.subscribe(aLong -> showLevelUpNotify(messagesLevelUp.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,6 +745,37 @@ public class RoomEffectView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 升级飘屏
|
||||
*
|
||||
* @param chatRoomMessage
|
||||
*/
|
||||
private void addRoomPKNotify(ChatRoomMessage chatRoomMessage) {
|
||||
if (messagesRoomPK == null) messagesRoomPK = new ArrayList<>();
|
||||
messagesRoomPK.add(chatRoomMessage);
|
||||
if (disposableRoomPK == null || disposableRoomPK.isDisposed()) {
|
||||
disposableRoomPK = Observable.interval(0, 6, TimeUnit.SECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.takeWhile(aLong -> messagesRoomPK.size() > 0 && messagesRoomPK.get(0) != null)
|
||||
.subscribe(aLong -> showRoomPKNotify(messagesRoomPK.remove(0)));
|
||||
}
|
||||
}
|
||||
|
||||
private void showRoomPKNotify(ChatRoomMessage chatRoomMessage) {
|
||||
RoomPkBean roomPkBean = ((RoomPKAttachment) chatRoomMessage.getAttachment()).getRoomPkBean();
|
||||
View rootView = LayoutInflater.from(mContext).inflate(R.layout.layout_room_pk_notify, null);
|
||||
((TextView) rootView.findViewById(R.id.tv_title_left)).setText(StringExtensionKt.subAndReplaceDot(roomPkBean.getWinTitle(),7));
|
||||
((TextView) rootView.findViewById(R.id.tv_title_right)).setText(StringExtensionKt.subAndReplaceDot(roomPkBean.getFailTitle(),7));
|
||||
((TextView) rootView.findViewById(R.id.tv_win_text)).setText(roomPkBean.getMsg());
|
||||
ImageLoadUtils.loadImage(getContext(), roomPkBean.getWinAvatar(), rootView.findViewById(R.id.iv_avatar_left));
|
||||
ImageLoadUtils.loadImage(getContext(), roomPkBean.getFailAvatar(), rootView.findViewById(R.id.iv_avatar_right));
|
||||
rootView.findViewById(R.id.tv_go_room).setOnClickListener(v -> AVRoomActivity.start(getContext(), roomPkBean.getWinUid()));
|
||||
binding.flRoomPKNotify.addView(rootView);
|
||||
animationLuckyGift = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify);
|
||||
rootView.startAnimation(animationLuckyGift);
|
||||
binding.flRoomPKNotify.postDelayed(() -> binding.flRoomPKNotify.removeView(rootView), SHOW_TIME);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
@@ -785,5 +787,6 @@ public class RoomEffectView extends FrameLayout {
|
||||
if (datingDisposable != null) datingDisposable.dispose();
|
||||
if (imDisposable != null) imDisposable.dispose();
|
||||
if (disposableDatingAll != null) disposableDatingAll.dispose();
|
||||
if (disposableRoomPK != null) disposableRoomPK.dispose();
|
||||
}
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_room_pk_go_room.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_room_pk_go_room.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/bg_room_pk_notice.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_room_pk_notice.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_room_pk_ko.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_room_pk_ko.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@@ -225,6 +225,7 @@
|
||||
android:hint="选填,10个字以内"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="50dp"
|
||||
android:maxLength="10"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textColorHint="@color/white_transparent_50"
|
||||
android:textSize="15sp"
|
||||
|
@@ -68,6 +68,14 @@
|
||||
app:layout_constraintDimensionRatio="75:14"
|
||||
app:layout_constraintTop_toBottomOf="@id/fl_box_notify" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_room_PK_notify"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="375:87"
|
||||
app:layout_constraintTop_toBottomOf="@id/fl_dating_all_notify" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
96
app/src/main/res/layout/layout_room_pk_notify.xml
Normal file
96
app/src/main/res/layout/layout_room_pk_notify.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
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_room_pk_notice"
|
||||
tools:layout_height="87dp">
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_left"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="22dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_title_left"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_avatar_left"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_avatar_left"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_avatar_left"
|
||||
tools:text="厅的名字七个字" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ko"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="9dp"
|
||||
android:src="@drawable/ic_room_pk_ko"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar_left"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar_left"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar_left" />
|
||||
|
||||
<com.yizhuan.erban.common.widget.CircleImageView
|
||||
android:id="@+id/iv_avatar_right"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="9dp"
|
||||
android:src="@drawable/default_avatar"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_title_right"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_ko"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_avatar_right"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_avatar_right"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_avatar_right"
|
||||
tools:text="厅的名字七个字" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_win_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_avatar_right"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar_right"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar_right"
|
||||
tools:text="恭喜房间五个字...获得胜利" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_go_room"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:layout_marginBottom="14dp"
|
||||
android:background="@drawable/bg_room_pk_go_room"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="去围观"
|
||||
android:textColor="@color/text_title_white"
|
||||
android:textSize="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -176,10 +176,12 @@
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!--设置窗口内容不覆盖-->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!--设置动画,在这里使用让它继承系统的Animation.Dialog-->
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<!--背景是否模糊显示-->
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
|
||||
<item name="android:windowEnterAnimation">@anim/anim_bottom_in</item>
|
||||
|
||||
<item name="android:windowExitAnimation">@anim/anim_bottom_out</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
@@ -273,6 +273,7 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_ACCEPT;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_FINISH;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_INVITE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_NOTIFY;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_ROOM_PK_UPDATE;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_MONSTER_HUNTING;
|
||||
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_SUB_TYPE_SEND_ADD_BLACK;
|
||||
@@ -1355,6 +1356,9 @@ public final class IMNetEaseManager {
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_FINISH);
|
||||
AvRoomDataManager.get().roomPkLiveData.postValue(null);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_ROOM_PK_NOTIFY:
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_NOTIFY);
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@@ -79,6 +79,16 @@ public class RoomPkBean implements Serializable {
|
||||
//另一方魅力榜前三
|
||||
private List<RankBean> arRank;
|
||||
|
||||
/**
|
||||
* 通知相关字段
|
||||
*/
|
||||
private String msg;
|
||||
private String failAvatar;
|
||||
private String winAvatar;
|
||||
private String failUid;
|
||||
private String failTitle;
|
||||
private String winTitle;
|
||||
|
||||
@Data
|
||||
public static class RankBean implements Serializable{
|
||||
//uid
|
||||
|
@@ -213,6 +213,7 @@ public class RoomEvent {
|
||||
public static final int ROOM_PK_INVITE = 72;
|
||||
public static final int ROOM_PK_ACCEPT = 73;
|
||||
public static final int ROOM_PK_FINISH = 74;
|
||||
public static final int ROOM_PK_NOTIFY = 75;
|
||||
|
||||
private int event = NONE;
|
||||
private int micPosition = Integer.MIN_VALUE;
|
||||
|
Reference in New Issue
Block a user