Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7836c57479
@ -1,5 +1,7 @@
|
|||||||
package com.yunbao.live.dialog;
|
package com.yunbao.live.dialog;
|
||||||
|
|
||||||
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@ -8,7 +10,6 @@ import android.view.Window;
|
|||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@ -18,14 +19,15 @@ import com.yunbao.common.custom.CommonRefreshView;
|
|||||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||||
|
import com.yunbao.common.utils.Bus;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
import com.yunbao.live.adapter.LiveNewWishListAdapter;
|
import com.yunbao.live.adapter.LiveNewWishListAdapter;
|
||||||
import com.yunbao.live.adapter.LiveWishListAdapter;
|
|
||||||
import com.yunbao.live.bean.LiveWishlistBean;
|
import com.yunbao.live.bean.LiveWishlistBean;
|
||||||
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.live.http.LiveHttpConsts;
|
import com.yunbao.live.http.LiveHttpConsts;
|
||||||
import com.yunbao.live.http.LiveHttpUtil;
|
import com.yunbao.live.http.LiveHttpUtil;
|
||||||
|
|
||||||
@ -243,6 +245,7 @@ public class LiveNewWishListDialogFragment extends AbsDialogFragment implements
|
|||||||
mContext = null;
|
mContext = null;
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST);
|
LiveHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST);
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.SET_WISH_LIST);
|
LiveHttpUtil.cancel(LiveHttpConsts.SET_WISH_LIST);
|
||||||
|
Bus.get().post(new LiveAudienceEvent().setType(WISH_LIST_UPDATE));
|
||||||
EventBus.getDefault().unregister(this);
|
EventBus.getDefault().unregister(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,8 @@ public class LiveAudienceEvent extends BaseModel {
|
|||||||
FLOAT_SETTING(29, "悬浮窗设置"),
|
FLOAT_SETTING(29, "悬浮窗设置"),
|
||||||
VOICE_PRESS(30, "长按展示图片"),
|
VOICE_PRESS(30, "长按展示图片"),
|
||||||
LUCKY_ANGEL(31, "幸运天使"),
|
LUCKY_ANGEL(31, "幸运天使"),
|
||||||
WE_CHEAT(32, "整蛊")
|
WE_CHEAT(32, "整蛊"),
|
||||||
|
WISH_LIST_UPDATE(33, "心愿单更新推送")
|
||||||
;
|
;
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
|
@ -66,8 +66,6 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
private int mLiveType;//房间类型
|
private int mLiveType;//房间类型
|
||||||
private int mLiveTypeVal;//房间密码,门票收费金额
|
private int mLiveTypeVal;//房间密码,门票收费金额
|
||||||
private int mLiveTimeCoin;//计时收费金额
|
private int mLiveTimeCoin;//计时收费金额
|
||||||
private ActivityResultCallback mActivityResultCallback;
|
|
||||||
private CommonCallback<LiveRoomTypeBean> mLiveTypeCallback;
|
|
||||||
private boolean mOpenLocation = true;
|
private boolean mOpenLocation = true;
|
||||||
private int mLiveSdk;
|
private int mLiveSdk;
|
||||||
private LiveClassBean classBean;
|
private LiveClassBean classBean;
|
||||||
@ -165,32 +163,6 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
findViewById(R.id.btn_start_live).setOnClickListener(this);
|
findViewById(R.id.btn_start_live).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_wishlist).setOnClickListener(this);
|
findViewById(R.id.btn_wishlist).setOnClickListener(this);
|
||||||
findViewById(R.id.btn_horizontally).setOnClickListener(this);
|
findViewById(R.id.btn_horizontally).setOnClickListener(this);
|
||||||
mActivityResultCallback = new ActivityResultCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Intent intent) {
|
|
||||||
mLiveClassID = intent.getIntExtra(Constants.CLASS_ID, 0);
|
|
||||||
mLiveClass.setText(intent.getStringExtra(Constants.CLASS_NAME));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
mLiveTypeCallback = new CommonCallback<LiveRoomTypeBean>() {
|
|
||||||
@Override
|
|
||||||
public void callback(LiveRoomTypeBean bean) {
|
|
||||||
switch (bean.getId()) {
|
|
||||||
case Constants.LIVE_TYPE_NORMAL:
|
|
||||||
onLiveTypeNormal(bean);
|
|
||||||
break;
|
|
||||||
case Constants.LIVE_TYPE_PWD:
|
|
||||||
onLiveTypePwd(bean);
|
|
||||||
break;
|
|
||||||
case Constants.LIVE_TYPE_PAY:
|
|
||||||
onLiveTypePay(bean);
|
|
||||||
break;
|
|
||||||
case Constants.LIVE_TYPE_TIME:
|
|
||||||
onLiveTypeTime(bean);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
manager = new FaceManager();
|
manager = new FaceManager();
|
||||||
manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() {
|
manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() {
|
||||||
final Handler handler = new Handler(Looper.getMainLooper());
|
final Handler handler = new Handler(Looper.getMainLooper());
|
||||||
@ -382,7 +354,25 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
bundle.putInt(Constants.CHECKED_ID, mLiveType);
|
bundle.putInt(Constants.CHECKED_ID, mLiveType);
|
||||||
LiveNewRoomTypeDialogFragment fragment = new LiveNewRoomTypeDialogFragment();
|
LiveNewRoomTypeDialogFragment fragment = new LiveNewRoomTypeDialogFragment();
|
||||||
fragment.setArguments(bundle);
|
fragment.setArguments(bundle);
|
||||||
fragment.setCallback(mLiveTypeCallback);
|
fragment.setCallback(new CommonCallback<LiveRoomTypeBean>() {
|
||||||
|
@Override
|
||||||
|
public void callback(LiveRoomTypeBean bean) {
|
||||||
|
switch (bean.getId()) {
|
||||||
|
case Constants.LIVE_TYPE_NORMAL:
|
||||||
|
onLiveTypeNormal(bean);
|
||||||
|
break;
|
||||||
|
case Constants.LIVE_TYPE_PWD:
|
||||||
|
onLiveTypePwd(bean);
|
||||||
|
break;
|
||||||
|
case Constants.LIVE_TYPE_PAY:
|
||||||
|
onLiveTypePay(bean);
|
||||||
|
break;
|
||||||
|
case Constants.LIVE_TYPE_TIME:
|
||||||
|
onLiveTypeTime(bean);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveRoomTypeDialogFragment");
|
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveRoomTypeDialogFragment");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,12 +519,13 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl
|
|||||||
|
|
||||||
public void release() {
|
public void release() {
|
||||||
mImageUtil = null;
|
mImageUtil = null;
|
||||||
mActivityResultCallback = null;
|
|
||||||
mLiveTypeCallback = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM);
|
LiveHttpUtil.cancel(LiveHttpConsts.CREATE_ROOM);
|
||||||
|
if(manager!=null) {
|
||||||
|
manager.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,18 +126,18 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
public IRCRTCRoomEventsListener roomEventsListener = new IRCRTCRoomEventsListener() {
|
public IRCRTCRoomEventsListener roomEventsListener = new IRCRTCRoomEventsListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onRemoteUserPublishResource(RCRTCRemoteUser rcrtcRemoteUser, List<RCRTCInputStream> list) {
|
public void onRemoteUserPublishResource(RCRTCRemoteUser rcrtcRemoteUser, List<RCRTCInputStream> list) {
|
||||||
Log.e("ry","远端来了"+list.size());
|
Log.e("ry", "远端来了" + list.size());
|
||||||
//TODO 按需在此订阅远端用户发布的资源
|
//TODO 按需在此订阅远端用户发布的资源
|
||||||
rtcRoom.getLocalUser().subscribeStreams(list, new IRCRTCResultCallback() {
|
rtcRoom.getLocalUser().subscribeStreams(list, new IRCRTCResultCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
Log.e("ry","远端成功"+list.size());
|
Log.e("ry", "远端成功" + list.size());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(RTCErrorCode rtcErrorCode) {
|
public void onFailed(RTCErrorCode rtcErrorCode) {
|
||||||
Log.e("ry","远端失败"+list.size());
|
Log.e("ry", "远端失败" + list.size());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.e("ry", inviterRoomId+extra + "Request" );
|
Log.e("ry", inviterRoomId + extra + "Request");
|
||||||
|
|
||||||
UserBean userBean = new UserBean();
|
UserBean userBean = new UserBean();
|
||||||
userBean.setId(inviterRoomId);
|
userBean.setId(inviterRoomId);
|
||||||
@ -204,11 +204,11 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
mLiveRyLinkMicPkPresenter.onLinkDRMicPkApply(userBean);
|
mLiveRyLinkMicPkPresenter.onLinkDRMicPkApply(userBean);
|
||||||
}
|
}
|
||||||
} else if (extra.equals("LiveDRPK1")) {
|
} else if (extra.equals("LiveDRPK1")) {
|
||||||
Log.e("ry","LiveDRPK1");
|
Log.e("ry", "LiveDRPK1");
|
||||||
rtcRoom.getLocalUser().responseJoinOtherRoom(userBean.getId(), userBean.getId(), true, true, "LiveDRPK1", new IRCRTCResultCallback() {
|
rtcRoom.getLocalUser().responseJoinOtherRoom(userBean.getId(), userBean.getId(), true, true, "LiveDRPK1", new IRCRTCResultCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
mLiveRyLinkMicPkPresenter.dRjoinOtherRoom(userBean.getId(),2);
|
mLiveRyLinkMicPkPresenter.dRjoinOtherRoom(userBean.getId(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -217,7 +217,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if(extra.contains("autoLivePK")) {
|
if (extra.contains("autoLivePK")) {
|
||||||
UserBean userBean1 = new UserBean();
|
UserBean userBean1 = new UserBean();
|
||||||
if (!extra.equals("")) {
|
if (!extra.equals("")) {
|
||||||
JSONObject map = JSONObject.parseObject(extra);
|
JSONObject map = JSONObject.parseObject(extra);
|
||||||
@ -230,7 +230,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
userBean1.setAvatar("null");
|
userBean1.setAvatar("null");
|
||||||
}
|
}
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkApply(userBean1, "", 1);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkApply(userBean1, "", 1);
|
||||||
}else {
|
} else {
|
||||||
Log.e("ry", extra);
|
Log.e("ry", extra);
|
||||||
UserBean userBean1 = new UserBean();
|
UserBean userBean1 = new UserBean();
|
||||||
if (!extra.equals("")) {
|
if (!extra.equals("")) {
|
||||||
@ -244,7 +244,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
userBean1.setAvatar("null");
|
userBean1.setAvatar("null");
|
||||||
}
|
}
|
||||||
//收到单人PK申请
|
//收到单人PK申请
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkApply(userBean1, "",0);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkApply(userBean1, "", 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -284,13 +284,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.e("ry", inviterRoomId+extra + "Response" + agree);
|
Log.e("ry", inviterRoomId + extra + "Response" + agree);
|
||||||
if (agree == false) {
|
if (agree == false) {
|
||||||
// ToastUtil.show(inviteeUserId+(agree?" 同意":" 拒绝")+"了你的邀请!");
|
// ToastUtil.show(inviteeUserId+(agree?" 同意":" 拒绝")+"了你的邀请!");
|
||||||
} else if (agree == true && extra.equals(SOCKET_LIVE_DRPK)) {
|
} else if (agree == true && extra.equals(SOCKET_LIVE_DRPK)) {
|
||||||
mLiveRyLinkMicPkPresenter.onDRLinkMicToPk(inviteeRoomId);
|
mLiveRyLinkMicPkPresenter.onDRLinkMicToPk(inviteeRoomId);
|
||||||
} else if (extra.equals("LiveDRPK1")) {
|
} else if (extra.equals("LiveDRPK1")) {
|
||||||
mLiveRyLinkMicPkPresenter.dRjoinOtherRoom(inviteeRoomId,3);
|
mLiveRyLinkMicPkPresenter.dRjoinOtherRoom(inviteeRoomId, 3);
|
||||||
} else {
|
} else {
|
||||||
Log.e("ry", extra);
|
Log.e("ry", extra);
|
||||||
UserBean userBean1 = new UserBean();
|
UserBean userBean1 = new UserBean();
|
||||||
@ -305,7 +305,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
userBean1.setAvatar("null");
|
userBean1.setAvatar("null");
|
||||||
}
|
}
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId,3);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -528,10 +528,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
|
|
||||||
//加入房间成功后可以通过 RCRTCLocalUser 对象发布本地默认音视频流,包括:麦克风采集的音频和摄像头采集的视频。
|
//加入房间成功后可以通过 RCRTCLocalUser 对象发布本地默认音视频流,包括:麦克风采集的音频和摄像头采集的视频。
|
||||||
RCRTCEngine.getInstance().getDefaultVideoStream().setEncoderMirror(true);
|
RCRTCEngine.getInstance().getDefaultVideoStream().setEncoderMirror(true);
|
||||||
if(rtcRoom==null||rtcRoom.getLocalUser()==null){
|
if (rtcRoom == null || rtcRoom.getLocalUser() == null) {
|
||||||
ToastUtil.show("开播失败 room为空");
|
if (room == null || room.getLocalUser() == null) {
|
||||||
((LiveRyAnchorActivity) mContext).endLives();
|
ToastUtil.show("开播失败 请稍后再试,错误代码:room is null");
|
||||||
return;
|
((LiveRyAnchorActivity) mContext).endLives();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
rtcRoom = room;
|
||||||
}
|
}
|
||||||
rtcRoom.getLocalUser().publishDefaultLiveStreams(new IRCRTCResultDataCallback<RCRTCLiveInfo>() {
|
rtcRoom.getLocalUser().publishDefaultLiveStreams(new IRCRTCResultDataCallback<RCRTCLiveInfo>() {
|
||||||
@Override
|
@Override
|
||||||
@ -543,7 +546,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
//美颜
|
//美颜
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
//旧美颜不需要了
|
//旧美颜不需要了
|
||||||
/*RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(new IRCRTCVideoOutputFrameListener() {
|
/*RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(new IRCRTCVideoOutputFrameListener() {
|
||||||
@Override
|
@Override
|
||||||
public RCRTCVideoFrame processVideoFrame(RCRTCVideoFrame rtcVideoFrame) {
|
public RCRTCVideoFrame processVideoFrame(RCRTCVideoFrame rtcVideoFrame) {
|
||||||
|
@ -4,6 +4,8 @@ import static com.yunbao.live.activity.LiveActivity.mLiveUid;
|
|||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
||||||
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST;
|
||||||
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -19,6 +21,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.blankj.utilcode.util.GsonUtils;
|
import com.blankj.utilcode.util.GsonUtils;
|
||||||
import com.ms.banner.Banner;
|
import com.ms.banner.Banner;
|
||||||
import com.ms.banner.BannerConfig;
|
import com.ms.banner.BannerConfig;
|
||||||
@ -315,6 +318,8 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
.setCurrentAssistNum(msgModel.getCurrentAssistNum());
|
.setCurrentAssistNum(msgModel.getCurrentAssistNum());
|
||||||
Log.i("测试", "更新星级任务=" + model);
|
Log.i("测试", "更新星级任务=" + model);
|
||||||
showStart(model);
|
showStart(model);
|
||||||
|
} else if (event.getType() == WISH_LIST_UPDATE) {
|
||||||
|
initWishList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,10 +396,41 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addWishList(BannerBean bannerModel) {
|
public void addWishList(BannerBean bannerModel) {
|
||||||
|
for (int i = 0; i < mBannerList.size(); i++) {
|
||||||
|
if ("2".equals(mBannerList.get(i).getShow_type())) {
|
||||||
|
mBannerList.set(i, bannerModel);
|
||||||
|
updateBanner(mBannerList);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
mBannerList.add(bannerModel);
|
mBannerList.add(bannerModel);
|
||||||
updateBanner(mBannerList);
|
updateBanner(mBannerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLiveUid(String liveUid) {
|
||||||
|
LiveHttpUtil.geteEvent(liveUid, new HttpCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
|
if (code == 0) {
|
||||||
|
for (String s : info) {
|
||||||
|
JSONObject obj = JSONObject.parseObject(s);
|
||||||
|
if (obj.getString("is_hidden").equals("0")) {
|
||||||
|
BannerBean bannerBean = new BannerBean();
|
||||||
|
bannerBean.setImageUrl(obj.getString("img"));
|
||||||
|
bannerBean.setLink(obj.getString("link"));
|
||||||
|
bannerBean.setShow_type(obj.getString("show_type"));
|
||||||
|
mBannerList.add(bannerBean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mBannerList.size() > 0) {
|
||||||
|
if (mBanner.isStart()) {
|
||||||
|
mBanner.update(mBannerList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void showBanner() {
|
public void showBanner() {
|
||||||
if (mBannerList != null && mBanner != null) {
|
if (mBannerList != null && mBanner != null) {
|
||||||
@ -530,5 +566,6 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
showBanner();
|
showBanner();
|
||||||
initStarData();
|
initStarData();
|
||||||
initWishList();
|
initWishList();
|
||||||
|
setLiveUid(mLiveBean.getUid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user