1:添加酒吧房抱麦推送,在推送过来后,需要选择礼物
2:添加酒吧房设置了自定义礼物推送 3:修改自定义礼物设置的接口,传递了roomId,用于推送消息
This commit is contained in:
@@ -30,7 +30,7 @@ public class RoomMessageEvent extends BaseEvent {
|
|||||||
public static class T {
|
public static class T {
|
||||||
private String text;
|
private String text;
|
||||||
private String GiftNum;
|
private String GiftNum;
|
||||||
private String pit_number;//麦位
|
private String pit_number;//麦位 酒吧房的情况下,这个是抱麦的number
|
||||||
private String jia_jia;//坐骑
|
private String jia_jia;//坐骑
|
||||||
private UserInfo FromUserInfo;//从me
|
private UserInfo FromUserInfo;//从me
|
||||||
private UserInfo ToUserInfo;// 到you
|
private UserInfo ToUserInfo;// 到you
|
||||||
@@ -47,7 +47,7 @@ public class RoomMessageEvent extends BaseEvent {
|
|||||||
private List<RoomAuction.AuctionListBean> auction_list; //拍卖列表
|
private List<RoomAuction.AuctionListBean> auction_list; //拍卖列表
|
||||||
private long duration;//时间
|
private long duration;//时间
|
||||||
private RoomAuction.AuctionListBean recipient;//是否成功,有值的是成功的,没有值的时候,是失败的
|
private RoomAuction.AuctionListBean recipient;//是否成功,有值的是成功的,没有值的时候,是失败的
|
||||||
private int type;//拍卖者,1:上麦、2:下麦 暴币的时候,1是大奖 2:是小奖
|
private int type;//拍卖者,1:上麦、2:下麦 暴币的时候,1是大奖 2:是小奖 在酒吧房的时候, 0:没有选择自定义礼物 1:选择了自定义礼物
|
||||||
private String hot_value;
|
private String hot_value;
|
||||||
private String SendRoomId;//发起者所在的房间ID
|
private String SendRoomId;//发起者所在的房间ID
|
||||||
private String AcceptRoomId;//接收者所在的房间id
|
private String AcceptRoomId;//接收者所在的房间id
|
||||||
|
|||||||
@@ -165,6 +165,11 @@ public class EMMessageInfo implements MultiItemEntity {
|
|||||||
public static final int QXRoomMessageTypeFlirtatious = 1200;
|
public static final int QXRoomMessageTypeFlirtatious = 1200;
|
||||||
/// 进入酒吧房的小黑屋
|
/// 进入酒吧房的小黑屋
|
||||||
public static final int QXRoomMessageTypeFlirtatiousRoom = 1201;
|
public static final int QXRoomMessageTypeFlirtatiousRoom = 1201;
|
||||||
|
/// 酒吧房抱麦推送
|
||||||
|
public static final int QXRoomMessageTypeFlirtatiousRoomPush = 1202;
|
||||||
|
/// 酒吧房设置了自定义礼物推送
|
||||||
|
public static final int QXRoomMessageTypeFlirtatiousRoomCustom = 1203;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private RoomMessageEvent emMessage;
|
private RoomMessageEvent emMessage;
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ public interface ApiServer {
|
|||||||
Call<BaseModel<List<RoonGiftModel>>> getNewGiftList(@Query("label") int label, @Query("type") String type );
|
Call<BaseModel<List<RoonGiftModel>>> getNewGiftList(@Query("label") int label, @Query("type") String type );
|
||||||
|
|
||||||
@GET(Constants.SET_CUSTOM_GIFT)
|
@GET(Constants.SET_CUSTOM_GIFT)
|
||||||
Call<BaseModel<String>> setCustomGift(@Query("gift_id") String gift_id, @Query("gift_remark_name") String new_gift_name );
|
Call<BaseModel<String>> setCustomGift(@Query("gift_id") String gift_id, @Query("gift_remark_name") String new_gift_name ,@Query("room_id") String room_id );
|
||||||
|
|
||||||
@GET(Constants.TOPIC_LIST)
|
@GET(Constants.TOPIC_LIST)
|
||||||
//获取话题
|
//获取话题
|
||||||
|
|||||||
@@ -2365,8 +2365,8 @@ public class RetrofitClient {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCustomGift(String gift_id, String new_gift_name, BaseObserver<String> observer) {
|
public void setCustomGift(String gift_id, String new_gift_name,String roomId, BaseObserver<String> observer) {
|
||||||
sApiServer.setCustomGift(gift_id, new_gift_name).enqueue(new Callback<BaseModel<String>>() {
|
sApiServer.setCustomGift(gift_id, new_gift_name,roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||||
|
|||||||
@@ -1592,6 +1592,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
publicScreenFragment?.setupExMessageListener()
|
publicScreenFragment?.setupExMessageListener()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if (msgType == EMMessageInfo.QXRoomMessageTypeFlirtatiousRoomPush) {//酒吧房抱麦推送
|
||||||
|
if (mRoomInfoResp?.user_info?.user_id.toString() == messageEvent.text.user_id) {
|
||||||
|
WishGiftDialog(
|
||||||
|
ActivityUtils.getTopActivity(),
|
||||||
|
roomId.toString(),
|
||||||
|
messageEvent.text.pit_number
|
||||||
|
).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if (msgType == EMMessageInfo.QXRoomMessageTypeFlirtatiousRoomCustom) {//酒吧房设置了自定义礼物后推送
|
||||||
|
roomFragment?.handleRoomMessage(messageEvent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -581,6 +581,8 @@ public class ChatRoomFragment extends BaseMvpFragment<ChatRoomPresenter, RoomFra
|
|||||||
case 125:
|
case 125:
|
||||||
case 1080:
|
case 1080:
|
||||||
case 1201:
|
case 1201:
|
||||||
|
case 1202:
|
||||||
|
case 1203:
|
||||||
if (getActivity() instanceof RoomActivity) {
|
if (getActivity() instanceof RoomActivity) {
|
||||||
((RoomActivity) getActivity()).roomInfoEvent(message);
|
((RoomActivity) getActivity()).roomInfoEvent(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -913,6 +913,9 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
|||||||
case 1200:
|
case 1200:
|
||||||
roomPubFragment.event1200(messageEvent);
|
roomPubFragment.event1200(messageEvent);
|
||||||
break;
|
break;
|
||||||
|
case 1203:
|
||||||
|
roomPubFragment.event1203(messageEvent);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void handleMentorshipEvent(RoomMessageEvent messageEvent) {
|
private void handleMentorshipEvent(RoomMessageEvent messageEvent) {
|
||||||
|
|||||||
@@ -465,4 +465,15 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
timer.stop()
|
timer.stop()
|
||||||
scope.cancel()
|
scope.cancel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun event1203(messageEvent: RoomMessageEvent) {
|
||||||
|
viewList.drop(2) // 跳过前两个元素
|
||||||
|
.forEach { view ->
|
||||||
|
if (view.pitBean.user_id != mUserInfo?.user_id.toString() && view.pitBean.user_id == messageEvent.text.user_id) { // 判断不是自己
|
||||||
|
view.setIvCustomGift(messageEvent.text.type == 1)
|
||||||
|
}
|
||||||
|
// 如果是自己,则不进行任何操作
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
|||||||
|
|
||||||
var adapter: SetupCustomGiftAdapter? = null
|
var adapter: SetupCustomGiftAdapter? = null
|
||||||
var time: MutableList<String> = mutableListOf()
|
var time: MutableList<String> = mutableListOf()
|
||||||
|
var mRoomId : String =roomId
|
||||||
var performInputDialog: PerformInputDialog? = null
|
var performInputDialog: PerformInputDialog? = null
|
||||||
|
|
||||||
override fun getLayoutId(): Int {
|
override fun getLayoutId(): Int {
|
||||||
@@ -61,7 +61,7 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
|||||||
performInputDialog?.setOnConfirmListener { content ->
|
performInputDialog?.setOnConfirmListener { content ->
|
||||||
// TODO: 这里表演内容的回调
|
// TODO: 这里表演内容的回调
|
||||||
t[position].gift_remark_name=content
|
t[position].gift_remark_name=content
|
||||||
RetrofitClient.getInstance().setCustomGift(t[position].gift_id,content,object : BaseObserver<String>() {
|
RetrofitClient.getInstance().setCustomGift(t[position].gift_id,content,mRoomId,object : BaseObserver<String>() {
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ class RoomPubWheatView : BaseWheatView {
|
|||||||
iv_gift?.setSource(giftPlayString, 2)
|
iv_gift?.setSource(giftPlayString, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setIvCustomGift(boolean: Boolean){
|
||||||
|
iv_custom_gift?.visibility = if (boolean) View.VISIBLE else View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
private fun handleOnState(bean: RoomPitBean) {
|
private fun handleOnState(bean: RoomPitBean) {
|
||||||
mIvRipple.visibility = VISIBLE
|
mIvRipple.visibility = VISIBLE
|
||||||
mTvName.text = bean.nickname
|
mTvName.text = bean.nickname
|
||||||
|
|||||||
Reference in New Issue
Block a user