diff --git a/config.gradle b/config.gradle index b36cf64f4..dbecffd33 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { minSdkVersion : 21, targetSdkVersion : 33, versionCode : 462, - versionName : "6.6.3" + versionName : "6.6.4" ] manifestPlaceholders = [ //正式、 @@ -21,10 +21,10 @@ ext { baiduAppSecretKey: "nEVSgmuGpU0pjPr6VleEGGAl0hzGW52S", // true表示谷歌支付 false 0 链接包 1 谷歌包 2华为包 3 samsung包 - isGooglePlay : 3, + isGooglePlay : 0, //是否上报异常日志 isUploadLog : true, //是否打包成插件包模式 - isPluginModel : false, + isPluginModel : true, ] } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index ff234fadc..52545097d 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -1285,6 +1285,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl */ public void linkDrMicAnchorApply(String pkUid, String stream) { linkDrMicAnchorApply(pkUid, stream, SOCKET_LIVE_DRPK); + if (mLiveAnchorViewHolder != null) { + mLiveAnchorViewHolder.setYaoqing(pkUid); + } + } /** diff --git a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java index 96e27f2ed..1cf09e983 100644 --- a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java @@ -15,15 +15,17 @@ import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.bean.RandomPkUserBean; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.LiveRyAnchorActivity; -import com.yunbao.common.http.LiveHttpUtil; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * 单人PK/多人PK邀请的对话框适配器 @@ -86,7 +88,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { } public void setData(RandomPkUserBean bean, int position) { - if (!WordUtil.isNewZh() && itemView.findViewById(R.id.text1)!=null) { + if (!WordUtil.isNewZh() && itemView.findViewById(R.id.text1) != null) { ((TextView) itemView.findViewById(R.id.text1)).setText("number"); ((TextView) itemView.findViewById(R.id.text2)).setText("user"); ((TextView) itemView.findViewById(R.id.text3)).setText("status"); @@ -96,6 +98,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { } } + private Map yaoqing = new HashMap<>(); public class ItemViewHolder extends HeadViewHolder { private TextView mNum; @@ -152,7 +155,15 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { } return; } - ((LiveRyAnchorActivity) mContext).linkDrMicAnchorApply(bean.getId(), bean.getId()); + yaoqing.put(bean.getId(), bean.getId()); + if (yaoqing.size() < 5) { + ((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 { if (WordUtil.isNewZh()) { @@ -183,7 +194,7 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { @Override public void onError(String error) { - ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred"); + ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred"); } }); }); @@ -229,4 +240,15 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { } } } + + private FreePkRecyclerListener freePkRecyclerListener; + + public FreePkRecyclerAdapter setFreePkRecyclerListener(FreePkRecyclerListener freePkRecyclerListener) { + this.freePkRecyclerListener = freePkRecyclerListener; + return this; + } + + public interface FreePkRecyclerListener { + void onClose(); + } } diff --git a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java index 5d7ec954b..4ca24bbd0 100644 --- a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java @@ -152,6 +152,12 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl mRecyclerView.setRefreshEnable(false); mRecyclerView.setEmptyLayoutId(R.layout.view_live_search_list_empty); adapter.setDrPkNum(mDrPkNum); + adapter.setFreePkRecyclerListener(new FreePkRecyclerAdapter.FreePkRecyclerListener() { + @Override + public void onClose() { + dismiss(); + } + }); adapter.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(RandomPkUserBean bean, int position) { diff --git a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java index 024aeafa5..ccc49cf7d 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRyAnchorViewHolder.java @@ -35,6 +35,7 @@ import com.yunbao.common.bean.MsgModel; import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.manager.IMLoginManager; 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.dialog.LiveHDDialogFragment; import com.yunbao.live.event.LiveAudienceEvent; -import com.yunbao.common.http.LiveHttpUtil; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Created by cxf on 2018/10/9. @@ -88,6 +90,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { super(context, parentView); } + public long getmAnchorLiveTime() { return mAnchorLiveTime; } @@ -159,17 +162,24 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { } }); btn_start_dr_pk_view.setVisibility(View.GONE); + yaoqing.clear(); } }); btn_dr.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - if (PKing == false) { - ((LiveRyAnchorActivity) mContext).openLinkMicAnchorWindow(true); + + if (yaoqing.size() < 3) { + if (PKing == false) { + ((LiveRyAnchorActivity) mContext).openLinkMicAnchorWindow(true); + } else { + ToastUtil.show(WordUtil.isNewZh() ? "您已在PK中" : "You are already in the PK"); + } } else { - ToastUtil.show(WordUtil.isNewZh()?"您已在PK中":"You are already in the PK"); + 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); @@ -178,6 +188,12 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { mLiveRoomHandler = new LiveRoomHandler(); } + private Map yaoqing = new HashMap<>(); + + public void setYaoqing(String numinda) { + yaoqing.put(numinda, numinda); + } + @Override public void onClick(View v) { if (!canClick()) { @@ -349,7 +365,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { @Override public void onError(String error) { Log.e("PortraitLiveManager", error); - ToastUtil.show( mContext.getString(R.string.net_error)); + ToastUtil.show(mContext.getString(R.string.net_error)); } }); } @@ -477,7 +493,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append("&uid=") .append(userInfo.getId()) .append("&k=") - .append(System.currentTimeMillis()) .append("&isZh=") + .append(System.currentTimeMillis()).append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } else { type = bean.getShow_type(); @@ -489,11 +505,11 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append("&anchorUid=") .append(mLiveUid) .append("&t=") - .append(System.currentTimeMillis()) .append("&isZh=") + .append(System.currentTimeMillis()).append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,0); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 0); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString()); @@ -535,7 +551,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append("&uid=") .append(userInfo.getId()) .append("&k=") - .append(System.currentTimeMillis()) .append("&isZh=") + .append(System.currentTimeMillis()).append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } else { type = bean.getShow_type(); @@ -550,11 +566,11 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder { .append(mLiveUid) .append("&t=") .append(System.currentTimeMillis()) - .append("&g=Appapi&m=Wish&a=index") .append("&isZh=") + .append("&g=Appapi&m=Wish&a=index").append("&isZh=") .append(WordUtil.isNewZh() ? "1" : 0); } if (TextUtils.equals(type, "1")) { - ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false,0); + ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false, 0); } else { Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString());