机器人自动发言

This commit is contained in:
18401019693 2022-12-24 14:45:20 +08:00
parent 404d45893f
commit 874800c19d
6 changed files with 35 additions and 1 deletions

View File

@ -133,6 +133,7 @@ public class Constants {
public static final int LIVE_FUNC_WKS = 2014;//語音 public static final int LIVE_FUNC_WKS = 2014;//語音
public static final int LIVE_FUNC_ZSLK = 2015;//語音 public static final int LIVE_FUNC_ZSLK = 2015;//語音
public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK public static final int LIVE_FUNC_RANDOM_PK = 2016;//随机PK
public static final int LIVE_ROBOT= 2017;//机器人
//socket //socket
public static final String SOCKET_CONN = "conn"; public static final String SOCKET_CONN = "conn";

View File

@ -95,6 +95,28 @@
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/live_tool_robot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/live_more_icon_robot" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/robot_setup"
android:textColor="#FF9A9A9A"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</HorizontalScrollView> </HorizontalScrollView>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -995,4 +995,5 @@
<string name="robot_minimum_interval" translatable="false">最少間隔5分鐘1次</string> <string name="robot_minimum_interval" translatable="false">最少間隔5分鐘1次</string>
<string name="robot_add_content_hint3" translatable="false">當有用戶進入直播間時,機器人會@該用戶並自動</string> <string name="robot_add_content_hint3" translatable="false">當有用戶進入直播間時,機器人會@該用戶並自動</string>
<string name="robot_add_content_hint4" translatable="false">隨機以下一句話。最少設置1條最多20條。</string> <string name="robot_add_content_hint4" translatable="false">隨機以下一句話。最少設置1條最多20條。</string>
<string name="robot_setup" translatable="false">機器人設置</string>
</resources> </resources>

View File

@ -34,6 +34,7 @@ import com.alibaba.fastjson.JSONObject;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget; import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition; import com.bumptech.glide.request.transition.Transition;
import com.lxj.xpopup.XPopup;
import com.opensource.svgaplayer.SVGAImageView; import com.opensource.svgaplayer.SVGAImageView;
import com.tencent.trtc.TRTCCloudDef; import com.tencent.trtc.TRTCCloudDef;
import com.yunbao.common.CommonAppConfig; 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.StringUtil;
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.common.views.LiveRobotSettingCustomPopup;
import com.yunbao.faceunity.FaceManager; import com.yunbao.faceunity.FaceManager;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; import com.yunbao.live.bean.LiveReceiveGiftBean;
import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.FreePkDialogFragment;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
import com.yunbao.live.dialog.LiveNewWishListDialogFragment; import com.yunbao.live.dialog.LiveNewWishListDialogFragment;
import com.yunbao.live.dialog.LivePrankDialogFragment; import com.yunbao.live.dialog.LivePrankDialogFragment;
@ -281,6 +282,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
@Override @Override
public void onClick(int functionID) { public void onClick(int functionID) {
switch (functionID) { switch (functionID) {
case Constants.LIVE_ROBOT:
new XPopup.Builder(mContext)
.asCustom(new LiveRobotSettingCustomPopup(mContext))
.show();
break;
case Constants.LIVE_FUNC_ZG://zg case Constants.LIVE_FUNC_ZG://zg
// ToastUtil.show("開發中,敬請期待"); // ToastUtil.show("開發中,敬請期待");
LivePrankDialogFragment fragment = new LivePrankDialogFragment(); LivePrankDialogFragment fragment = new LivePrankDialogFragment();

View File

@ -92,6 +92,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
mMultiPkView.setOnClickListener(this); mMultiPkView.setOnClickListener(this);
mMicView.setOnClickListener(this); mMicView.setOnClickListener(this);
mRandomPk.setOnClickListener(this); mRandomPk.setOnClickListener(this);
findViewById(R.id.live_tool_robot).setOnClickListener(this);
if (leave == 0) { if (leave == 0) {
((ImageView) mLeaveView.findViewById(R.id.live_tool_leave_img)).setImageResource(R.mipmap.icon_leave); ((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); mFunctionClickListener.onClick(LIVE_FUNC_MIC);
} else if (id == R.id.live_tool_random_pk) { } else if (id == R.id.live_tool_random_pk) {
mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK); mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK);
}else if (id==R.id.live_tool_robot){
mFunctionClickListener.onClick(LIVE_ROBOT);
dismiss();
} }
} }
} }