From e3a9a037bac1ca1493366d8fe16a3743cf1e86c2 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 23 Dec 2022 11:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/bean/LiveAiRobotBean.java | 12 +- .../com/yunbao/common/http/PDLiveApi.java | 11 +- .../common/http/live/LiveNetManager.java | 6 +- .../common/views/CustomDrawerPopupView.java | 3 +- .../src/main/res/drawable/bg_robot_shape.xml | 10 + common/src/main/res/drawable/icon_robot.png | Bin 0 -> 3840 bytes .../main/res/layout/custom_drawer_popup.xml | 2 +- .../src/main/res/mipmap-xxhdpi/icon_robot.png | Bin 0 -> 3840 bytes .../src/main/res/mipmap-xxhdpi/icon_tip.png | Bin 0 -> 2865 bytes common/src/main/res/values/strings.xml | 10 + .../LiveRobotSettingDialogFragment.java | 69 ++++-- .../live/views/LiveNewReadyRyViewHolder.java | 29 ++- .../res/layout/dialog_live_robot_setting.xml | 222 ++++++++++++++++-- .../main/res/layout/view_new_live_ready.xml | 20 +- .../yunbao/main/views/MainHomeViewHolder.java | 3 +- 15 files changed, 329 insertions(+), 68 deletions(-) create mode 100644 common/src/main/res/drawable/bg_robot_shape.xml create mode 100644 common/src/main/res/drawable/icon_robot.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_robot.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_tip.png diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java index 44e8b9f95..26ba27052 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveAiRobotBean.java @@ -15,9 +15,9 @@ public class LiveAiRobotBean extends BaseModel { @SerializedName("ai_time") private int time; @SerializedName("ai_sayhi") - private int autoSeyHiNumber;// 自动打招呼已配置数量 + private String autoSeyHiNumber;// 自动打招呼已配置数量 @SerializedName("ai_gz") - private int autoRequestFollowNumber;//自动求关注已配置数量 + private String autoRequestFollowNumber;//自动求关注已配置数量 public LiveAiRobotBean() { } @@ -46,19 +46,19 @@ public class LiveAiRobotBean extends BaseModel { this.time = time; } - public int getAutoSeyHiNumber() { + public String getAutoSeyHiNumber() { return autoSeyHiNumber; } - public void setAutoSeyHiNumber(int autoSeyHiNumber) { + public void setAutoSeyHiNumber(String autoSeyHiNumber) { this.autoSeyHiNumber = autoSeyHiNumber; } - public int getAutoRequestFollowNumber() { + public String getAutoRequestFollowNumber() { return autoRequestFollowNumber; } - public void setAutoRequestFollowNumber(int autoRequestFollowNumber) { + public void setAutoRequestFollowNumber(String autoRequestFollowNumber) { this.autoRequestFollowNumber = autoRequestFollowNumber; } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 576df8487..91d73d34c 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -20,10 +20,10 @@ import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleRankHideUserListModel; import com.yunbao.common.bean.NobleTrumpetModel; import com.yunbao.common.bean.PkRankBean; -import com.yunbao.common.bean.RandomPkUserBean; -import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.PrankGiftBean; import com.yunbao.common.bean.PrankHttpTurntableBean; +import com.yunbao.common.bean.RandomPkUserBean; +import com.yunbao.common.bean.RankPkInfoBean; import com.yunbao.common.bean.SearchModel; import com.yunbao.common.bean.SetAttentsModel; import com.yunbao.common.bean.SlideInBannerModel; @@ -31,6 +31,7 @@ import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.VipModel; import java.util.List; +import java.util.Map; import io.reactivex.Observable; import retrofit2.http.Field; @@ -38,6 +39,7 @@ import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Query; +import retrofit2.http.QueryMap; /** * PDLive网络接口访问 @@ -485,9 +487,8 @@ public interface PDLiveApi { * 修改机器人信息 */ @GET("/api/public/?service=Live.setAnchorAiState") - Observable> setAnchorAiState( - @Query("name") String name, - @Query("value") String value + Observable> setAnchorAiState( + @QueryMap Map map ); /** diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 4e6e91a91..41a7dce15 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -33,7 +33,9 @@ import com.yunbao.common.http.base.CheckLiveCallBack; import com.yunbao.common.http.base.HttpCallback; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; @@ -934,8 +936,10 @@ public class LiveNetManager { } public void setAiRobotDate(String name, String value, HttpCallback callback) { + Map map = new HashMap<>(); + map.put(name, value); API.get().pdLiveApi(mContext) - .setAnchorAiState(name, value) + .setAnchorAiState(map) .subscribeOn(Schedulers.io()) .subscribe(responseModel -> { if (callback != null) { diff --git a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java index e111905c0..ab2199dbd 100644 --- a/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java +++ b/common/src/main/java/com/yunbao/common/views/CustomDrawerPopupView.java @@ -127,7 +127,8 @@ public class CustomDrawerPopupView extends DrawerPopupView { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.system_notice), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - dismiss(); +// dismiss(); + } diff --git a/common/src/main/res/drawable/bg_robot_shape.xml b/common/src/main/res/drawable/bg_robot_shape.xml new file mode 100644 index 000000000..24885134c --- /dev/null +++ b/common/src/main/res/drawable/bg_robot_shape.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/drawable/icon_robot.png b/common/src/main/res/drawable/icon_robot.png new file mode 100644 index 0000000000000000000000000000000000000000..aa0d8b45742845e5feb171de6fdc89c4d01f3184 GIT binary patch literal 3840 zcmV+b5C8CqP)Px@x=BPqRCr$PoCmNiMG=PoHs_pkE^}d^)G{C$Nur=)z=R+m2qKCih$3P_Fn|Io zh!_CHh!{{rfl^Dv1fpU9M8PZwD5A9WJ$k5l`}XY4oUr#?IbF4NZrw9ycJ|+%p60^`uo6SC{lvNqd+Xz|WlwHU5c!4ox^p(z=qaGXlk{B%LT} zt9jGxA;&){(9e_fkrqvEVvc4%-^@NbPb%&1gN=VupuZvM$%WvZY-Vc~wjHFIyAL-0 zNrApt(k%*6xx~zFS=e@vX6`=N_!mGAq$raDJ=oNng^DjH(=pg$G9#b|8~>ylO`y`} z-ht6iC2e44znukO?!KF(cVq)0usYVvww(6hW&(6*IV97^B;7U} z^!buDGqWE|`$1~^bN7cxI$6@~vfrL7>8WP+hU#jpCx+{Uq^u zM@e^xi{ITO+FYu=b0lqQW9KkR^yl%(C&U~ zNgGRgk)$;`Xw+FfTTQ>0NqPn5#LWIy^TX1%Qw7@HF$H&*w4)@VuG^FjWKP=sRT5M# z>&W@jbVa8Iw7Wk@(hDU$JHW2N?%$HIseh4#4~tphlMB1bLY1zxP+^L$mtDN%o5uyC z$i<7s=Ck`hv-JR9@-2pHU-z9)bNd8?(XG{7y+9T95^ndsVRy#_Vb7l)S^Z|_h}j9)1Y6YsO*PQ& z&f5lHN(^#M#+Fi2u#K4!q%2!;cYJKP8cHd0Ru9cai4Hb1W^J*I12i}Pq$HgFTs|-9 zRc7{!;=9jrLwA2b5KfymhWTsAvf4V8DxibErAC9ycmCV2;ntbipXV66>Y=$igcEMw zI*lKb!dutOn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P)O=rBW$LCclfB#b*J;DTBHC9yg%T#=W%NZvprQ00~=%m2j17KB5GQSMqU5A#P}BI5=MLfdLY! z>FDUFEGsK(a$WaoW)>%#L`F`9U*{cWmISD0wbtuI87x%K$prRnXDFq%DW#f+hK62fZ*MJN^8tJWfJAF6 znRyZs#h6*3i7xftyLs=uy!eVlvmRDT4T@_7K#G}nXsuff!$=)CaG)>De=tzYD(2g^ zC;i>iz$c44)i8`{BO@bmt#z&Iy7DmQEFzMWze%Dxc<;L;E#)mDk{fBCQc9jF^caS5 zaA08I=-jz;hr*DU69<3F02M{`H27!&P@YAY05kz;eEW1lf+i$rd=m6ul%_?L#_#?P P00000NkvXXu0mjf`4(B; literal 0 HcmV?d00001 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 2e408f8e0..aa2b8a418 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -978,4 +978,14 @@ 拒绝 坚持拒绝 随机PK提示 + + 自動發言機器人設置 + 機器人開關 + 機器人名字設置 + 字數限制2-8個字 + 自動打招呼設置 + 已配置條數 + 自動發消息設置 + 前往設置 + 感謝送禮、PK開始、PK結束的自動機器人消息,\n暫不支持自定義。 diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java index 6f413f971..56b118f65 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveRobotSettingDialogFragment.java @@ -4,19 +4,25 @@ import android.app.ActionBar; import android.os.Bundle; import android.util.Log; import android.view.Gravity; +import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; +import android.view.inputmethod.EditorInfo; +import android.widget.EditText; +import android.widget.TextView; +import androidx.annotation.Nullable; +import androidx.appcompat.widget.AppCompatTextView; + +import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; -import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; -import androidx.annotation.Nullable; - import java.util.List; /** @@ -25,6 +31,8 @@ import java.util.List; public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements View.OnClickListener { private static String TAG = "AI机器人"; + private EditText robotNameSetting; + private AppCompatTextView automaticGreetingNumber, automaticMessageNumber; @Override protected int getLayoutId() { @@ -45,7 +53,7 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements protected void setWindowAttributes(Window window) { WindowManager.LayoutParams params = window.getAttributes(); params.width = ActionBar.LayoutParams.MATCH_PARENT; - params.height = DpUtil.dp2px(460); + params.height = ActionBar.LayoutParams.WRAP_CONTENT; params.gravity = Gravity.BOTTOM; window.setAttributes(params); } @@ -53,23 +61,44 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); + intiView(); initDate(); } + private void intiView() { + robotNameSetting = (EditText) findViewById(R.id.robot_name_setting); + automaticGreetingNumber = (AppCompatTextView) findViewById(R.id.automatic_greeting_number); + automaticMessageNumber = (AppCompatTextView) findViewById(R.id.automatic_message_number); + robotNameSetting.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_DONE) { + // 修改助手名字 + LiveNetManager.get(mContext) + .setAiRobotDate("ai_name", robotNameSetting.getText().toString(), new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + + } + return false; + } + }); + } + private void initDate() { - LiveNetManager.get(mContext) - .getAiRobotStatus(new HttpCallback() { - @Override - public void onSuccess(LiveAiRobotBean data) { - Log.i(TAG, "onSuccess: " + data.toString()); - initListType1(); - } - - @Override - public void onError(String error) { - - } - }); + robotNameSetting.setText(getArguments().getString("Name", "1")); + automaticGreetingNumber.setText(getArguments().getString("AutoSeyHiNumber", "1")); + automaticMessageNumber.setText(getArguments().getString("AutoRequestFollowNumber", "1")); + initListType1(); + initListType2(); } private void initListType1() { @@ -77,11 +106,12 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements .getAiRobotBody(LiveAiRobotBean.Message.TYPE_SAY_HI, new HttpCallback>() { @Override public void onSuccess(List data) { - Log.i(TAG, "onSuccess: " + data.size()); + Log.i(TAG, "onSuccess 自动打招呼 : " + data.size()); for (LiveAiRobotBean.Message message : data) { Log.i(TAG, "onSuccess: message=" + message.toString()); } - initListType2(); + + } @Override @@ -100,6 +130,7 @@ public class LiveRobotSettingDialogFragment extends AbsDialogFragment implements for (LiveAiRobotBean.Message message : data) { Log.i(TAG, "onSuccess: message=" + message.toString()); } + } @Override diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java index ecdbdcd42..032294d3f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -2,7 +2,6 @@ package com.yunbao.live.views; import android.app.Dialog; import android.content.Context; -import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; @@ -19,11 +18,12 @@ import androidx.core.content.ContextCompat; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; +import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveClassBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.interfaces.ActivityResultCallback; +import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.utils.DialogUitl; @@ -35,7 +35,6 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsViewHolder; import com.yunbao.faceunity.FaceManager; import com.yunbao.live.R; -import com.yunbao.live.activity.Beauty360Activity3; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; import com.yunbao.live.bean.LiveRoomTypeBean; @@ -43,6 +42,7 @@ import com.yunbao.live.dialog.LiveFaceUnityDialogFragment; import com.yunbao.live.dialog.LiveNewRoomClassDialogFragment; import com.yunbao.live.dialog.LiveNewRoomTypeDialogFragment; import com.yunbao.live.dialog.LiveNewWishListDialogFragment; +import com.yunbao.live.dialog.LiveRobotSettingDialogFragment; import com.yunbao.live.dialog.LiveTimeDialogFragment; import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpUtil; @@ -160,6 +160,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl findViewById(R.id.btn_live_class).setOnClickListener(this); findViewById(R.id.btn_close).setOnClickListener(this); findViewById(R.id.btn_beauty).setOnClickListener(this); + findViewById(R.id.btn_robot).setOnClickListener(this); findViewById(R.id.btn_start_live).setOnClickListener(this); findViewById(R.id.btn_wishlist).setOnClickListener(this); findViewById(R.id.btn_horizontally).setOnClickListener(this); @@ -218,6 +219,28 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl } else if (i == R.id.btn_horizontally) { RCRTCCameraOutputStream cameraStream = RCRTCEngine.getInstance().getDefaultVideoStream(); cameraStream.setPreviewMirror(!cameraStream.isPreviewMirror()); + } else if (i == R.id.btn_robot) { + if (mContext instanceof LiveRyAnchorActivity) { + LiveNetManager.get(mContext) + .getAiRobotStatus(new com.yunbao.common.http.base.HttpCallback() { + @Override + public void onSuccess(LiveAiRobotBean data) { + Bundle mArguments = new Bundle(); + mArguments.putString("Name", data.getName()); + mArguments.putString("AutoSeyHiNumber", data.getAutoSeyHiNumber()); + mArguments.putString("AutoRequestFollowNumber", data.getAutoRequestFollowNumber()); + LiveRobotSettingDialogFragment fragment = new LiveRobotSettingDialogFragment(); + fragment.setArguments(mArguments); + fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveRobotSettingDialogFragment"); + } + + @Override + public void onError(String error) { + ToastUtil.show(error); + } + }); + + } } } diff --git a/live/src/main/res/layout/dialog_live_robot_setting.xml b/live/src/main/res/layout/dialog_live_robot_setting.xml index 8d8001e4a..1f1a2bd77 100644 --- a/live/src/main/res/layout/dialog_live_robot_setting.xml +++ b/live/src/main/res/layout/dialog_live_robot_setting.xml @@ -1,10 +1,10 @@ - + android:layout_height="wrap_content" + android:background="#000" + android:paddingBottom="23dp"> @@ -22,18 +23,19 @@ android:id="@+id/robot_status" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_below="@id/textView6" android:layout_marginTop="18dp" - android:orientation="horizontal" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/textView6"> + android:orientation="horizontal"> - + android:text="@string/robot_switch" + android:textColor="#FFF" + android:textSize="15sp" /> + android:layout_below="@+id/robot_status" + android:layout_marginTop="20dp" + android:orientation="horizontal"> - + android:orientation="vertical"> - + + + + + + + android:imeOptions="actionDone" + android:inputType="text" + android:maxLines="1" + android:textColor="#FFF" + android:textSize="12sp" /> - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_new_live_ready.xml b/live/src/main/res/layout/view_new_live_ready.xml index 9d2a0de5d..98af6cebf 100644 --- a/live/src/main/res/layout/view_new_live_ready.xml +++ b/live/src/main/res/layout/view_new_live_ready.xml @@ -1,8 +1,6 @@ - @@ -254,13 +252,23 @@ android:id="@+id/faceTextView" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textColor="#FFFFFF" - android:visibility="gone" - android:textSize="16sp" android:text="" + android:textColor="#FFFFFF" + android:textSize="16sp" + android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 3517a8fbd..ce721b3f9 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -40,8 +40,7 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder { ImgLoader.display(mContext, "https://downs.yaoulive.com/gif_trophy.gif", img_trophy); img_trophy.setOnClickListener(v -> { - LiveRobotSettingDialogFragment fragment=new LiveRobotSettingDialogFragment(); - fragment.show(((MainActivity)mContext).getSupportFragmentManager(),"LiveRobotSettingDialogFragment"); + }); }