调整多人连麦踢人后刷新列表

This commit is contained in:
zlzw 2022-11-23 14:42:00 +08:00
parent 3d117dbcb4
commit d42835231e
2 changed files with 19 additions and 9 deletions

View File

@ -20,6 +20,7 @@ import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.BaseModel;
import com.yunbao.common.bean.LevelBean;
import com.yunbao.common.custom.CommonRefreshView;
import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.http.API;
@ -52,6 +53,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
public static final int TYPE_MIC_INVITE = 3;//邀请连麦
private AbsDialogFragment fragments;
private CommonRefreshView refreshView;
private String mLiveUid;
public AnchorUserMicInfoAdapter(Context context, AbsDialogFragment fragment) {
@ -62,10 +64,13 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
@Override
public int getItemViewType(int position) {
return position;
}
public void setRefreshView(CommonRefreshView refreshView) {
this.refreshView = refreshView;
}
public void setLiveUid(String mLiveUid) {
this.mLiveUid = mLiveUid;
}
@ -135,6 +140,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
}
});
}
SocketSendBean createSocketSendBean() {
return new SocketSendBean()
.param("_method_", Constants.LIAN_MAI)
@ -142,6 +148,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
.param("avatar", CommonAppConfig.getInstance().getUserBean().getAvatar())
.param("uid", CommonAppConfig.getInstance().getUid());
}
void applyMic(MicUserBean bean, int action, SocketSendBean msg) {
msg.param("action", action);
msg.create();
@ -157,12 +164,14 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
@Override
public void onSuccess(io.rong.imlib.model.Message message) {
Log.e("ry", "发送成功");
refreshView.initData();
}
@Override
public void onError(io.rong.imlib.model.Message message, RongIMClient.ErrorCode errorCode) {
Log.e("ry", "发送失敗" + errorCode.toString());
refreshView.initData();
}
});
}

View File

@ -224,6 +224,7 @@ public class LiveMicAnchorDialogFragment extends AbsDialogFragment implements Vi
});
userMicInfoAdapter = new AnchorUserMicInfoAdapter(mContext, LiveMicAnchorDialogFragment.this);
userMicInfoAdapter.setLiveUid(mLiveUid);
userMicInfoAdapter.setRefreshView(mRefreshView);
Up();
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<MicUserBean>() {