修改上下滑动黑

This commit is contained in:
18142669586 2024-05-31 19:01:41 +08:00
parent 9621d8a6d8
commit d3de01666c
4 changed files with 36 additions and 27 deletions

View File

@ -40,12 +40,15 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
private final int RIGHTS_INTERESTS = 4; private final int RIGHTS_INTERESTS = 4;
private final int RECOMMEND = 5; private final int RECOMMEND = 5;
private String liveId; private String liveId;
private boolean mIs_shengwang;
private List<AnchorRecommendItemModel> list = new ArrayList<>(); private List<AnchorRecommendItemModel> list = new ArrayList<>();
private List<CustomSidebarInfoModel> infoModels = new ArrayList<>(); private List<CustomSidebarInfoModel> infoModels = new ArrayList<>();
public CustomDrawerPopupAdapter(Context mContext) { public CustomDrawerPopupAdapter(Context mContext,boolean mIs_shengwang) {
this.mContext = mContext; this.mContext = mContext;
this.mIs_shengwang = mIs_shengwang;
} }
@ -114,6 +117,7 @@ public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
map.put("num", "9"); map.put("num", "9");
map.put("live_recommend", "sidebar"); map.put("live_recommend", "sidebar");
map.put("refresh", "1"); map.put("refresh", "1");
map.put(" is_shengwang", mIs_shengwang?"1":"0");
//推荐位 //推荐位
MainNetManager.get((Activity) mContext) MainNetManager.get((Activity) mContext)
.anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() { .anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {

View File

@ -96,27 +96,27 @@ public class MainNetManager {
}).isDisposed(); }).isDisposed();
} }
/** // /**
* 猜你喜欢 // * 猜你喜欢
* // *
* @param num 请求数量 // * @param num 请求数量
* @return // * @return
*/ // */
public void anchorRecommend(String num, HttpCallback<AnchorRecommendModel> httpCallback) { // public void anchorRecommend(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
API.get().pdLiveApi(mContext).anchorRecommend(num) // API.get().pdLiveApi(mContext).anchorRecommend(num,is_shengwang)
.subscribeOn(Schedulers.io()) // .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) // .observeOn(AndroidSchedulers.mainThread())
.subscribe(anchorRecommendModelResponseModel -> { // .subscribe(anchorRecommendModelResponseModel -> {
if (httpCallback != null) { // if (httpCallback != null) {
AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo(); // AnchorRecommendModel model = anchorRecommendModelResponseModel.getData().getInfo();
httpCallback.onSuccess(model); // httpCallback.onSuccess(model);
} // }
}, throwable -> { // }, throwable -> {
if (httpCallback != null) { // if (httpCallback != null) {
httpCallback.onError(throwable.getMessage()); // httpCallback.onError(throwable.getMessage());
} // }
}).isDisposed(); // }).isDisposed();
} // }
public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) { public void anchorRecommend(Map<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
API.get().pdLiveApi(mContext).anchorRecommend(map) API.get().pdLiveApi(mContext).anchorRecommend(map)
@ -140,11 +140,12 @@ public class MainNetManager {
* @param num 请求数量 * @param num 请求数量
* @return * @return
*/ */
public void anchorRecommendType(String num, HttpCallback<AnchorRecommendModel> httpCallback) { public void anchorRecommendType(String num, String is_shengwang,HttpCallback<AnchorRecommendModel> httpCallback) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("num", num); map.put("num", num);
map.put("live_recommend", "slide"); map.put("live_recommend", "slide");
map.put("type", "1"); map.put("type", "1");
map.put(" is_shengwang", is_shengwang);
API.get().pdLiveApi(mContext).anchorRecommend(map) API.get().pdLiveApi(mContext).anchorRecommend(map)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())

View File

@ -29,6 +29,7 @@ import java.util.List;
public class CustomDrawerPopupView extends DrawerPopupView { public class CustomDrawerPopupView extends DrawerPopupView {
private Context mContext; private Context mContext;
private boolean mIs_shengwang;
private RecyclerView drawerList; private RecyclerView drawerList;
private CustomDrawerPopupAdapter adapter; private CustomDrawerPopupAdapter adapter;
@ -45,9 +46,10 @@ public class CustomDrawerPopupView extends DrawerPopupView {
return this; return this;
} }
public CustomDrawerPopupView(@NonNull Context context) { public CustomDrawerPopupView(@NonNull Context context, boolean is_shengwang) {
super(context); super(context);
mContext = context; mContext = context;
mIs_shengwang = is_shengwang;
} }
@Override @Override
@ -72,7 +74,7 @@ public class CustomDrawerPopupView extends DrawerPopupView {
private void initView() { private void initView() {
drawerList = findViewById(R.id.drawerList); drawerList = findViewById(R.id.drawerList);
adapter = new CustomDrawerPopupAdapter(mContext); adapter = new CustomDrawerPopupAdapter(mContext,mIs_shengwang);
adapter.setList(list).setLiveId(liveId); adapter.setList(list).setLiveId(liveId);
drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); drawerList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
drawerList.setAdapter(adapter); drawerList.setAdapter(adapter);

View File

@ -316,7 +316,7 @@ public class LiveAudienceActivity extends LiveActivity {
} }
}); });
} else { } else {
MainNetManager.get(mContext).anchorRecommendType("30", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() { MainNetManager.get(mContext).anchorRecommendType("30",isSw?"1":"0", new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override @Override
public void onSuccess(AnchorRecommendModel data) { public void onSuccess(AnchorRecommendModel data) {
if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) { if (TextUtils.equals(data.getList().get(0).getUid(), mLiveBean.getUid())) {
@ -898,7 +898,7 @@ public class LiveAudienceActivity extends LiveActivity {
if (userIndex != -1) { if (userIndex != -1) {
list.remove(userIndex); 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() { customDrawerPopupView.setCallBack(new CustomDrawerPopupView.CustomDrawerPopupCallBack() {
@Override @Override
@ -1577,6 +1577,8 @@ public class LiveAudienceActivity extends LiveActivity {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("num", "9"); map.put("num", "9");
map.put("live_recommend", "sidebar"); map.put("live_recommend", "sidebar");
map.put(" is_shengwang", isSw?"1":"0");
//推荐位 //推荐位
MainNetManager.get(mContext).anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() { MainNetManager.get(mContext).anchorRecommend(map, new com.yunbao.common.http.base.HttpCallback<AnchorRecommendModel>() {
@Override @Override