老用户回归,星级Im消息修改

This commit is contained in:
18401019693 2022-10-11 15:36:17 +08:00
parent 9b1e182fbd
commit 0a25585c8e
8 changed files with 168 additions and 16 deletions

View File

@ -165,6 +165,7 @@ public class Constants {
public static final String SOCKET_PRIZE_POOL_UP = "jackpotUp";//奖池升级 public static final String SOCKET_PRIZE_POOL_UP = "jackpotUp";//奖池升级
public static final String SOCKET_HOUR = "SendHourChart";//小时榜更新 public static final String SOCKET_HOUR = "SendHourChart";//小时榜更新
public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息 public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
//游戏socket //游戏socket
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花 public static final String SOCKET_GAME_ZJH = "startGame";//炸金花

View File

@ -2,6 +2,7 @@ package com.yunbao.common.bean;
import android.text.TextUtils; import android.text.TextUtils;
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.yunbao.common.views.weight.FullServiceNotificationView; import com.yunbao.common.views.weight.FullServiceNotificationView;
@ -49,6 +50,110 @@ public class MsgModel extends BaseModel {
private String anchorName = ""; private String anchorName = "";
@SerializedName("systemBubble") @SerializedName("systemBubble")
private String systemBubble = ""; private String systemBubble = "";
@SerializedName("taskNum")
private String taskNum;
@SerializedName("currentStarVal")
private String currentStarVal;
@SerializedName("targetStarVal")
private String targetStarVal;
@SerializedName("currentAssistNum")
private String currentAssistNum;
@SerializedName("targetAssistNum")
private String targetAssistNum;
@SerializedName("starSrc")
private String starSrc;
@SerializedName("assistSrc")
private String assistSrc;
@SerializedName("taskName1")
private String taskName1;
@SerializedName("taskName2")
private String taskName2;
public String getTaskNum() {
return taskNum;
}
public MsgModel setTaskNum(String taskNum) {
this.taskNum = taskNum;
return this;
}
public String getCurrentStarVal() {
return currentStarVal;
}
public MsgModel setCurrentStarVal(String currentStarVal) {
this.currentStarVal = currentStarVal;
return this;
}
public String getTargetStarVal() {
return targetStarVal;
}
public MsgModel setTargetStarVal(String targetStarVal) {
this.targetStarVal = targetStarVal;
return this;
}
public String getCurrentAssistNum() {
return currentAssistNum;
}
public MsgModel setCurrentAssistNum(String currentAssistNum) {
this.currentAssistNum = currentAssistNum;
return this;
}
public String getTargetAssistNum() {
return targetAssistNum;
}
public MsgModel setTargetAssistNum(String targetAssistNum) {
this.targetAssistNum = targetAssistNum;
return this;
}
public String getStarSrc() {
return starSrc;
}
public MsgModel setStarSrc(String starSrc) {
this.starSrc = starSrc;
return this;
}
public String getAssistSrc() {
return assistSrc;
}
public MsgModel setAssistSrc(String assistSrc) {
this.assistSrc = assistSrc;
return this;
}
public String getTaskName1() {
return taskName1;
}
public MsgModel setTaskName1(String taskName1) {
this.taskName1 = taskName1;
return this;
}
public String getTaskName2() {
return taskName2;
}
public MsgModel setTaskName2(String taskName2) {
this.taskName2 = taskName2;
return this;
}
public static MsgModel objectFromData(String str) {
return new Gson().fromJson(str, MsgModel.class);
}
public String getAction() { public String getAction() {
return action; return action;

View File

@ -80,7 +80,7 @@ public class StarChallengeStatusModel extends BaseModel {
return taskNum; return taskNum;
} }
public BaseModel setTaskNum(String taskNum) { public StarChallengeStatusModel setTaskNum(String taskNum) {
this.taskNum = taskNum; this.taskNum = taskNum;
return this; return this;
} }
@ -89,7 +89,7 @@ public class StarChallengeStatusModel extends BaseModel {
return currentStarVal; return currentStarVal;
} }
public BaseModel setCurrentStarVal(String currentStarVal) { public StarChallengeStatusModel setCurrentStarVal(String currentStarVal) {
this.currentStarVal = currentStarVal; this.currentStarVal = currentStarVal;
return this; return this;
} }
@ -98,7 +98,7 @@ public class StarChallengeStatusModel extends BaseModel {
return targetStarVal; return targetStarVal;
} }
public BaseModel setTargetStarVal(String targetStarVal) { public StarChallengeStatusModel setTargetStarVal(String targetStarVal) {
this.targetStarVal = targetStarVal; this.targetStarVal = targetStarVal;
return this; return this;
} }
@ -107,7 +107,7 @@ public class StarChallengeStatusModel extends BaseModel {
return currentAssistNum; return currentAssistNum;
} }
public BaseModel setCurrentAssistNum(String currentAssistNum) { public StarChallengeStatusModel setCurrentAssistNum(String currentAssistNum) {
this.currentAssistNum = currentAssistNum; this.currentAssistNum = currentAssistNum;
return this; return this;
} }
@ -116,7 +116,7 @@ public class StarChallengeStatusModel extends BaseModel {
return targetAssistNum; return targetAssistNum;
} }
public BaseModel setTargetAssistNum(String targetAssistNum) { public StarChallengeStatusModel setTargetAssistNum(String targetAssistNum) {
this.targetAssistNum = targetAssistNum; this.targetAssistNum = targetAssistNum;
return this; return this;
} }
@ -125,7 +125,7 @@ public class StarChallengeStatusModel extends BaseModel {
return starSrc; return starSrc;
} }
public BaseModel setStarSrc(String starSrc) { public StarChallengeStatusModel setStarSrc(String starSrc) {
this.starSrc = starSrc; this.starSrc = starSrc;
return this; return this;
} }
@ -134,7 +134,7 @@ public class StarChallengeStatusModel extends BaseModel {
return assistSrc; return assistSrc;
} }
public BaseModel setAssistSrc(String assistSrc) { public StarChallengeStatusModel setAssistSrc(String assistSrc) {
this.assistSrc = assistSrc; this.assistSrc = assistSrc;
return this; return this;
} }

View File

@ -338,8 +338,9 @@ public class LiveAudienceActivity extends LiveActivity {
} }
} }
}; };
private void over(){
if("NEWUSER".equals(getIntent().getStringExtra("OPEN"))){ private void over() {
if ("NEWUSER".equals(getIntent().getStringExtra("OPEN"))) {
manager.mLiveAudienceViewHolder.openNewPeopleDialog(); manager.mLiveAudienceViewHolder.openNewPeopleDialog();
} }
} }
@ -842,6 +843,9 @@ public class LiveAudienceActivity extends LiveActivity {
case AT_MESSAGE: case AT_MESSAGE:
manager.showAtMessage(); manager.showAtMessage();
break; break;
case START_MESSAGE:
manager.starMessage(event.getMsgModel());
break;
} }

View File

@ -133,8 +133,8 @@ public class LiveAudienceEvent extends BaseModel {
RECOMMEND_CARD_NOTIFY(21, "贵族推荐通知"), RECOMMEND_CARD_NOTIFY(21, "贵族推荐通知"),
SLIDE_SETTINGS(22, "滑動設置"), SLIDE_SETTINGS(22, "滑動設置"),
NEW_MESSAGE_REMINDER(23, "新消息提醒"), NEW_MESSAGE_REMINDER(23, "新消息提醒"),
AT_MESSAGE(24, "@消息") AT_MESSAGE(24, "@消息"),
; START_MESSAGE(25, "星级消息");
private int type; private int type;
private String name; private String name;

View File

@ -470,6 +470,16 @@ public class SocketRyClient {
.setMsgModel(recommendCardNotifyMsg.get(0))); .setMsgModel(recommendCardNotifyMsg.get(0)));
} }
break; break;
case Constants.STAR_CHALLENGE_UPDATE://星级助力
SocketModel starChallengeModel = GsonUtils.fromJson(socketMsg, SocketModel.class);
List<MsgModel> starChallengeMsg = starChallengeModel.getMsg();
if (starChallengeMsg.size() > 0) {
Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.START_MESSAGE)
.setMsgModel(starChallengeMsg.get(0)));
}
break;
} }
} }

View File

@ -1027,14 +1027,25 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
public void showStart(StarChallengeStatusModel data) { public void showStart(StarChallengeStatusModel data) {
boolean star = false;
if (mBannerList2 == null) { if (mBannerList2 == null) {
mBannerList2 = new ArrayList<>(); mBannerList2 = new ArrayList<>();
} else {
for (BannerBean bean : mBannerList2) {
if (bean.isStart()){
star = true;
bean.setModel(data);
}
}
if (!star){
BannerBean bannerBean = new BannerBean();
bannerBean.setStart(true);
bannerBean.setModel(data);
mBannerList2.add(bannerBean);
}
} }
BannerBean bannerBean = new BannerBean();
bannerBean.setStart(true); mBanner2.update(mBannerList2);
bannerBean.setModel(data);
mBannerList2.add(bannerBean);
showBanner2();
} }
public void hideFloatMsg() { public void hideFloatMsg() {

View File

@ -172,6 +172,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private Handler liveHandler = new Handler(); private Handler liveHandler = new Handler();
//公共參數 //公共參數
private OpenParametersModel openParametersModel = null; private OpenParametersModel openParametersModel = null;
//星级活动地址
private String activityUrl = "";
public PortraitLiveManager(Activity context, Intent intent) { public PortraitLiveManager(Activity context, Intent intent) {
this.mContext = context; this.mContext = context;
@ -294,6 +296,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onSuccess(StarChallengeStatusModel data) { public void onSuccess(StarChallengeStatusModel data) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
activityUrl = data.getActivityUrl();
mLiveRoomViewHolder.showStart(data); mLiveRoomViewHolder.showStart(data);
} }
} }
@ -1558,4 +1561,22 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.showAtMessage(); mLiveRoomViewHolder.showAtMessage();
} }
} }
public void starMessage(MsgModel msgModel) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder
.showStart(
new StarChallengeStatusModel(activityUrl)
.setTaskNum(msgModel.getTaskNum())
.setTaskName1(msgModel.getTaskName1())
.setTaskName2(msgModel.getTaskName2())
.setStarSrc(msgModel.getStarSrc())
.setCurrentStarVal(msgModel.getCurrentStarVal())
.setTargetStarVal(msgModel.getTargetStarVal())
.setAssistSrc(msgModel.getAssistSrc())
.setTargetAssistNum(msgModel.getTargetAssistNum())
.setCurrentAssistNum(msgModel.getCurrentAssistNum()));
}
}
} }