多人pk邀请人数限制
This commit is contained in:
parent
e185eb8612
commit
f770370be0
@ -5,7 +5,7 @@ ext {
|
|||||||
minSdkVersion : 21,
|
minSdkVersion : 21,
|
||||||
targetSdkVersion : 33,
|
targetSdkVersion : 33,
|
||||||
versionCode : 462,
|
versionCode : 462,
|
||||||
versionName : "6.6.3"
|
versionName : "6.6.4"
|
||||||
]
|
]
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
//正式、
|
//正式、
|
||||||
@ -21,10 +21,10 @@ ext {
|
|||||||
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S",
|
||||||
|
|
||||||
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
// true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包
|
||||||
isGooglePlay : 3,
|
isGooglePlay : 0,
|
||||||
//是否上报异常日志
|
//是否上报异常日志
|
||||||
isUploadLog : true,
|
isUploadLog : true,
|
||||||
//是否打包成插件包模式
|
//是否打包成插件包模式
|
||||||
isPluginModel : false,
|
isPluginModel : true,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1285,6 +1285,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
*/
|
*/
|
||||||
public void linkDrMicAnchorApply(String pkUid, String stream) {
|
public void linkDrMicAnchorApply(String pkUid, String stream) {
|
||||||
linkDrMicAnchorApply(pkUid, stream, SOCKET_LIVE_DRPK);
|
linkDrMicAnchorApply(pkUid, stream, SOCKET_LIVE_DRPK);
|
||||||
|
if (mLiveAnchorViewHolder != null) {
|
||||||
|
mLiveAnchorViewHolder.setYaoqing(pkUid);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,15 +15,17 @@ import com.yunbao.common.adapter.RefreshAdapter;
|
|||||||
import com.yunbao.common.bean.RandomPkUserBean;
|
import com.yunbao.common.bean.RandomPkUserBean;
|
||||||
import com.yunbao.common.bean.SetAttentsModel;
|
import com.yunbao.common.bean.SetAttentsModel;
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
import com.yunbao.common.glide.ImgLoader;
|
||||||
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
import com.yunbao.common.http.LiveHttpUtil;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单人PK/多人PK邀请的对话框适配器
|
* 单人PK/多人PK邀请的对话框适配器
|
||||||
@ -96,6 +98,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<String, String> yaoqing = new HashMap<>();
|
||||||
|
|
||||||
public class ItemViewHolder extends HeadViewHolder {
|
public class ItemViewHolder extends HeadViewHolder {
|
||||||
private TextView mNum;
|
private TextView mNum;
|
||||||
@ -152,7 +155,15 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
yaoqing.put(bean.getId(), bean.getId());
|
||||||
|
if (yaoqing.size() < 5) {
|
||||||
((LiveRyAnchorActivity) mContext).linkDrMicAnchorApply(bean.getId(), bean.getId());
|
((LiveRyAnchorActivity) mContext).linkDrMicAnchorApply(bean.getId(), bean.getId());
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(WordUtil.isNewZh() ? "多人PK最大參與人數為4人" : "The maximum number of participants in a multiplayer PK is 4 people");
|
||||||
|
}
|
||||||
|
if (freePkRecyclerListener != null) {
|
||||||
|
freePkRecyclerListener.onClose();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (WordUtil.isNewZh()) {
|
if (WordUtil.isNewZh()) {
|
||||||
@ -229,4 +240,15 @@ public class FreePkRecyclerAdapter extends RefreshAdapter<RandomPkUserBean> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FreePkRecyclerListener freePkRecyclerListener;
|
||||||
|
|
||||||
|
public FreePkRecyclerAdapter setFreePkRecyclerListener(FreePkRecyclerListener freePkRecyclerListener) {
|
||||||
|
this.freePkRecyclerListener = freePkRecyclerListener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface FreePkRecyclerListener {
|
||||||
|
void onClose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,6 +152,12 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl
|
|||||||
mRecyclerView.setRefreshEnable(false);
|
mRecyclerView.setRefreshEnable(false);
|
||||||
mRecyclerView.setEmptyLayoutId(R.layout.view_live_search_list_empty);
|
mRecyclerView.setEmptyLayoutId(R.layout.view_live_search_list_empty);
|
||||||
adapter.setDrPkNum(mDrPkNum);
|
adapter.setDrPkNum(mDrPkNum);
|
||||||
|
adapter.setFreePkRecyclerListener(new FreePkRecyclerAdapter.FreePkRecyclerListener() {
|
||||||
|
@Override
|
||||||
|
public void onClose() {
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
adapter.setOnItemClickListener(new OnItemClickListener<RandomPkUserBean>() {
|
adapter.setOnItemClickListener(new OnItemClickListener<RandomPkUserBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(RandomPkUserBean bean, int position) {
|
public void onItemClick(RandomPkUserBean bean, int position) {
|
||||||
|
@ -35,6 +35,7 @@ import com.yunbao.common.bean.MsgModel;
|
|||||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
|
import com.yunbao.common.http.LiveHttpUtil;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
@ -47,13 +48,14 @@ import com.yunbao.live.activity.ZhuangBanActivity;
|
|||||||
import com.yunbao.live.bean.WishlistModel;
|
import com.yunbao.live.bean.WishlistModel;
|
||||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
||||||
import com.yunbao.live.event.LiveAudienceEvent;
|
import com.yunbao.live.event.LiveAudienceEvent;
|
||||||
import com.yunbao.common.http.LiveHttpUtil;
|
|
||||||
|
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/9.
|
* Created by cxf on 2018/10/9.
|
||||||
@ -88,6 +90,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getmAnchorLiveTime() {
|
public long getmAnchorLiveTime() {
|
||||||
return mAnchorLiveTime;
|
return mAnchorLiveTime;
|
||||||
}
|
}
|
||||||
@ -159,17 +162,24 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
btn_start_dr_pk_view.setVisibility(View.GONE);
|
btn_start_dr_pk_view.setVisibility(View.GONE);
|
||||||
|
yaoqing.clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
btn_dr.setOnClickListener(new View.OnClickListener() {
|
btn_dr.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
if (yaoqing.size() < 3) {
|
||||||
if (PKing == false) {
|
if (PKing == false) {
|
||||||
((LiveRyAnchorActivity) mContext).openLinkMicAnchorWindow(true);
|
((LiveRyAnchorActivity) mContext).openLinkMicAnchorWindow(true);
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(WordUtil.isNewZh() ? "您已在PK中" : "You are already in the PK");
|
ToastUtil.show(WordUtil.isNewZh() ? "您已在PK中" : "You are already in the PK");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtil.show(WordUtil.isNewZh() ? "多人PK最大參與人數為4人" : "The maximum number of participants in a multiplayer PK is 4 people");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_link_mic).setOnClickListener(this);
|
findViewById(R.id.btn_link_mic).setOnClickListener(this);
|
||||||
@ -178,6 +188,12 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
mLiveRoomHandler = new LiveRoomHandler();
|
mLiveRoomHandler = new LiveRoomHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<String, String> yaoqing = new HashMap<>();
|
||||||
|
|
||||||
|
public void setYaoqing(String numinda) {
|
||||||
|
yaoqing.put(numinda, numinda);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (!canClick()) {
|
if (!canClick()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user