diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index aa5c3c898..cf043fdb8 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -130,6 +130,7 @@ public class Constants { public static final int LIVE_FUNC_MIC = 2013;//語音 public static final int LIVE_FUNC_WKS = 2014;//語音 public static final int LIVE_FUNC_ZSLK = 2015;//語音 + public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK //socket public static final String SOCKET_CONN = "conn"; diff --git a/common/src/main/res/layout/dialog_live_new_function.xml b/common/src/main/res/layout/dialog_live_new_function.xml index 234b8cb67..c60106ebf 100644 --- a/common/src/main/res/layout/dialog_live_new_function.xml +++ b/common/src/main/res/layout/dialog_live_new_function.xml @@ -256,6 +256,27 @@ android:textColor="#FF9A9A9A" android:textSize="12sp" /> + + + + + + 心願單 娛樂整蠱 多人PK + 随机PK 語音連麥 周星榜 暫時離開 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 18749ed6a..2f3a8e78d 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -67,6 +67,7 @@ import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience; +import com.yunbao.live.dialog.RandomPkDialogFragment; import com.yunbao.live.event.LinkMicTxMixStreamEvent; import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.http.LiveHttpConsts; @@ -377,6 +378,9 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl t.mirrorType = TRTC_VIDEO_MIRROR_TYPE_DISABLE; } break; + case Constants.LIVE_FUNC_RANDOM_PK: + openRandomPkWindow(); + break; default: break; } @@ -556,6 +560,15 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl fragment.show(getSupportFragmentManager(), "LiveLinkMicListDialogFragment"); } + /** + * 随机PK + */ + public void openRandomPkWindow(){ + RandomPkDialogFragment fragment=new RandomPkDialogFragment(); + Bundle bundle=new Bundle(); + fragment.setArguments(bundle); + fragment.show(getSupportFragmentManager(), "RandomPkDialogFragment"); + } /** * 打开选择游戏窗口 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java index 63db923f8..364ea23fd 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java @@ -25,6 +25,7 @@ import com.yunbao.live.interfaces.LiveFunctionClickListener; public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements View.OnClickListener { private View mWishView, mPrankView, mWksView, mBeautyView, mCameraView, mLeaveView, mOnePkView, mMultiPkView, mMicView; + private View mRandomPk; private LiveFunctionClickListener mFunctionClickListener; private int leave = 0; private boolean isPk; @@ -79,6 +80,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements mOnePkView = findViewById(R.id.live_tool_one_pk); mMultiPkView = findViewById(R.id.live_tool_multi_pk); mMicView = findViewById(R.id.live_tool_mic); + mRandomPk = findViewById(R.id.live_tool_random_pk); mWishView.setOnClickListener(this); mPrankView.setOnClickListener(this); @@ -89,6 +91,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements mOnePkView.setOnClickListener(this); mMultiPkView.setOnClickListener(this); mMicView.setOnClickListener(this); + mRandomPk.setOnClickListener(this); if (leave == 0) { ((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave); @@ -140,6 +143,8 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements mFunctionClickListener.onClick(LIVE_FUNC_DR); } else if (id == R.id.live_tool_mic) { mFunctionClickListener.onClick(LIVE_FUNC_MIC); + } else if (id == R.id.live_tool_random_pk) { + mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK); } } } diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java new file mode 100644 index 000000000..ed9d1f8ad --- /dev/null +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -0,0 +1,46 @@ +package com.yunbao.live.dialog; + +import android.view.View; +import android.view.Window; + +import androidx.recyclerview.widget.RecyclerView; + +import com.google.android.material.tabs.TabLayout; +import com.yunbao.common.dialog.AbsDialogFragment; +import com.yunbao.live.R; + +/** + * 随机PK + */ +public class RandomPkDialogFragment extends AbsDialogFragment { + private TabLayout tabLayout; + private View reset; + private RecyclerView mRecyclerView; + + @Override + protected int getLayoutId() { + return R.layout.dialog_live_random_pk_function; + } + + @Override + protected int getDialogStyle() { + return R.style.dialog2; + } + + @Override + protected boolean canCancel() { + return true; + } + + @Override + protected void setWindowAttributes(Window window) { + initView(); + } + + private void initView() { + tabLayout = (TabLayout) findViewById(R.id.menu_tab); + reset = findViewById(R.id.menu_reset); + mRecyclerView = (RecyclerView) findViewById(R.id.random_container_view); + + } +} diff --git a/live/src/main/res/drawable/background_7792d0.xml b/live/src/main/res/drawable/background_7792d0.xml new file mode 100644 index 000000000..47c4546ce --- /dev/null +++ b/live/src/main/res/drawable/background_7792d0.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml b/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml new file mode 100644 index 000000000..497f84aeb --- /dev/null +++ b/live/src/main/res/drawable/bg_live_random_pk_info_btn.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml new file mode 100644 index 000000000..8235463e9 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml new file mode 100644 index 000000000..2222919d5 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch_thumb.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml b/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml new file mode 100644 index 000000000..5816955f5 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_random_pk_info_switch_track.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_live_random_pk_function.xml b/live/src/main/res/layout/dialog_live_random_pk_function.xml new file mode 100644 index 000000000..6abeb2d5c --- /dev/null +++ b/live/src/main/res/layout/dialog_live_random_pk_function.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/item_random_pk_info.xml b/live/src/main/res/layout/item_random_pk_info.xml new file mode 100644 index 000000000..da4afa0af --- /dev/null +++ b/live/src/main/res/layout/item_random_pk_info.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + +