diff --git a/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java b/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java index 2ab378200..013a58bd3 100644 --- a/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/CustomDrawerPopupAdapter.java @@ -40,12 +40,15 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter { private final int RIGHTS_INTERESTS = 4; private final int RECOMMEND = 5; private String liveId; + private boolean mIs_shengwang; + private List list = new ArrayList<>(); private List infoModels = new ArrayList<>(); - public CustomDrawerPopupAdapter(Context mContext) { + public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) { this.mContext = mContext; + this.mIs_shengwang = mIs_shengwang; } @@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter { map.put("num", "9"); map.put("live_recommend", "sidebar"); map.put("refresh", "1"); + map.put(" is_shengwang", mIs_shengwang?"1":"0"); //推荐位 MainNetManager.get((Activity) mContext) .anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback() { diff --git a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java index 38731b326..00dd5a6bc 100644 --- a/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/main/MainNetManager.java @@ -96,27 +96,27 @@ public class MainNetManager { }).isDisposed(); } - /** - * 猜你喜欢 - * - * @param num 请求数量 - * @return - */ - public void anchorRecommend(String num, HttpCallback httpCallback) { - API.get().pdLiveApi(mContext).anchorRecommend(num) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(anchorRecommendModelResponseModel -> { - if (httpCallback != null) { - AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo(); - httpCallback.onSuccess(model); - } - }, throwable -> { - if (httpCallback != null) { - httpCallback.onError(throwable.getMessage()); - } - }).isDisposed(); - } +// /** +// * 猜你喜欢 +// * +// * @param num 请求数量 +// * @return +// */ +// public void anchorRecommend(String num, String is_shengwang,HttpCallback httpCallback) { +// API.get().pdLiveApi(mContext).anchorRecommend(num,is_shengwang) +// .subscribeOn(Schedulers.io()) +// .observeOn(AndroidSchedulers.mainThread()) +// .subscribe(anchorRecommendModelResponseModel -> { +// if (httpCallback != null) { +// AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo(); +// httpCallback.onSuccess(model); +// } +// }, throwable -> { +// if (httpCallback != null) { +// httpCallback.onError(throwable.getMessage()); +// } +// }).isDisposed(); +// } public void anchorRecommend(Map map, HttpCallback httpCallback) { API.get().pdLiveApi(mContext).anchorRecommend(map) @@ -140,11 +140,12 @@ public class MainNetManager { * @param num 请求数量 * @return */ - public void anchorRecommendType(String num, HttpCallback httpCallback) { + public void anchorRecommendType(String num, String is_shengwang,HttpCallback httpCallback) { Map map = new HashMap<>(); map.put("num", num); map.put("live_recommend", "slide"); map.put("type", "1"); + map.put(" is_shengwang", is_shengwang); API.get().pdLiveApi(mContext).anchorRecommend(map) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index 9ad0e8686..94c0bbb84 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -29,6 +29,7 @@ import java.util.List; public class CustomDrawerPopupView extends DrawerPopupView { private Context mContext; + private boolean mIs_shengwang; private RecyclerView drawerList; private CustomDrawerPopupAdapter adapter; @@ -45,9 +46,10 @@ public class CustomDrawerPopupView extends DrawerPopupView { return this; } - public CustomDrawerPopupView(@NonNull Context context) { + public CustomDrawerPopupView(@NonNull Context context, boolean is_shengwang) { super(context); mContext = context; + mIs_shengwang = is_shengwang; } @Override @@ -72,7 +74,7 @@ public class CustomDrawerPopupView extends DrawerPopupView { private void initView() { drawerList = findViewById(R.id.drawerList); - adapter = new CustomDrawerPopupAdapter(mContext); + adapter = new CustomDrawerPopupAdapter(mContext,mIs_shengwang); adapter.setList(list).setLiveId(liveId); drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); drawerList.setAdapter(adapter); diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java index 0e67649f4..432b2ec9a 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAudienceActivity.java @@ -316,7 +316,7 @@ public class LiveAudienceActivity extends LiveActivity { } }); } else { - MainNetManager.get(mContext).anchorRecommendType("30", new com.yunbao.common.http.base.HttpCallback() { + MainNetManager.get(mContext).anchorRecommendType("30",isSw?"1":"0", new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(AnchorRecommendModel data) { if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) { @@ -898,7 +898,7 @@ public class LiveAudienceActivity extends LiveActivity { if (userIndex != -1) { list.remove(userIndex); } - CustomDrawerPopupView customDrawerPopupView = new CustomDrawerPopupView(mContext).setList(list).setLiveId(mLiveBean.getUid()); + CustomDrawerPopupView customDrawerPopupView = new CustomDrawerPopupView(mContext,isSw).setList(list).setLiveId(mLiveBean.getUid()); customDrawerPopupView.setCallBack(new CustomDrawerPopupView.CustomDrawerPopupCallBack() { @Override @@ -1577,6 +1577,8 @@ public class LiveAudienceActivity extends LiveActivity { Map map = new HashMap<>(); map.put("num", "9"); map.put("live_recommend", "sidebar"); + map.put(" is_shengwang", isSw?"1":"0"); + //推荐位 MainNetManager.get(mContext).anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback() { @Override