diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index 02b0020ea..fabbf6967 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -133,6 +133,7 @@ public class Constants { 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 + public static final int LIVE_ROBOT= 2017;//机器人 //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 c60106ebf..4182a2fc9 100644 --- a/common/src/main/res/layout/dialog_live_new_function.xml +++ b/common/src/main/res/layout/dialog_live_new_function.xml @@ -95,6 +95,28 @@ android:textSize="12sp" /> + + + + + + + diff --git a/common/src/main/res/mipmap-xxhdpi/live_more_icon_robot.png b/common/src/main/res/mipmap-xxhdpi/live_more_icon_robot.png new file mode 100644 index 000000000..bba2b0662 Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/live_more_icon_robot.png differ diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index f870e3804..b0b723181 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -995,4 +995,5 @@ 最少間隔5分鐘1次 當有用戶進入直播間時,機器人會@該用戶並自動 隨機以下一句話。最少設置1條,最多20條。 + 機器人設置 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 ae79b5bb8..8a46d8030 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -34,6 +34,7 @@ import com.alibaba.fastjson.JSONObject; import com.bumptech.glide.Glide; import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.transition.Transition; +import com.lxj.xpopup.XPopup; import com.opensource.svgaplayer.SVGAImageView; import com.tencent.trtc.TRTCCloudDef; import com.yunbao.common.CommonAppConfig; @@ -66,13 +67,13 @@ import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.LiveRobotSettingCustomPopup; import com.yunbao.faceunity.FaceManager; import com.yunbao.live.R; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.dialog.FreePkDialogFragment; -import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LivePrankDialogFragment; @@ -281,6 +282,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onClick(int functionID) { switch (functionID) { + case Constants.LIVE_ROBOT: + new XPopup.Builder(mContext) + .asCustom(new LiveRobotSettingCustomPopup(mContext)) + .show(); + break; case Constants.LIVE_FUNC_ZG://zg // ToastUtil.show("開發中,敬請期待"); LivePrankDialogFragment fragment = new LivePrankDialogFragment(); 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 364ea23fd..48e7168ef 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewFunctionDialogFragment.java @@ -92,6 +92,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements mMultiPkView.setOnClickListener(this); mMicView.setOnClickListener(this); mRandomPk.setOnClickListener(this); + findViewById(R.id.live_tool_robot).setOnClickListener(this); if (leave == 0) { ((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave); @@ -145,6 +146,9 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements mFunctionClickListener.onClick(LIVE_FUNC_MIC); } else if (id == R.id.live_tool_random_pk) { mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK); + }else if (id==R.id.live_tool_robot){ + mFunctionClickListener.onClick(LIVE_ROBOT); + dismiss(); } } }