修改上下滑动黑
This commit is contained in:
parent
9621d8a6d8
commit
d3de01666c
@ -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<AnchorRecommendItemModel> list = new ArrayList<>();
|
||||
|
||||
private List<CustomSidebarInfoModel> 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<AnchorRecommendModel>() {
|
||||
|
@ -96,27 +96,27 @@ public class MainNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*
|
||||
* @param num 请求数量
|
||||
* @return
|
||||
*/
|
||||
public void anchorRecommend(String num, HttpCallback<AnchorRecommendModel> 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<AnchorRecommendModel> 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<String, Object> map, HttpCallback<AnchorRecommendModel> httpCallback) {
|
||||
API.get().pdLiveApi(mContext).anchorRecommend(map)
|
||||
@ -140,11 +140,12 @@ public class MainNetManager {
|
||||
* @param num 请求数量
|
||||
* @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.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())
|
||||
|
@ -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);
|
||||
|
@ -316,7 +316,7 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
}
|
||||
});
|
||||
} 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
|
||||
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<String, Object> 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<AnchorRecommendModel>() {
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user