From 90f58054fa8944cd906fd6cb6df185f14928b9df Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 28 Dec 2022 18:21:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8F=91=E6=B6=88=E6=81=AF=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=9C=BA=E5=99=A8=E4=BA=BA=E6=B1=82?= =?UTF-8?q?=E5=85=B3=E6=B3=A8=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=B1=BB=E5=9E=8B=EF=BC=8C=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=BC=80=E6=92=AD=E6=B8=85=E6=99=B0=E5=BA=A6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/Constants.java | 1 + .../common/bean/LiveStetUpStatusModel.java | 49 ++++++ .../com/yunbao/common/http/PDLiveApi.java | 10 +- .../yunbao/common/manager/IMLoginManager.java | 19 ++- .../yunbao/common/views/InputCustomPopup.java | 10 +- .../common/views/LiveClarityCustomPopup.java | 116 +++++++++++++++ .../views/LiveRobotMessageCustomPopup.java | 2 +- .../views/LiveRobotSayHelloCustomPopup.java | 2 +- .../common/views/RobotMessageViewHolder.java | 2 +- .../common/views/RobotSayHelloViewHoler.java | 2 +- .../main/res/drawable/bg_btn_definition.xml | 15 ++ .../main/res/layout/dialog_live_clarity.xml | 139 ++++++++++++++++++ .../src/main/res/mipmap-xxhdpi/icon_fhd.png | Bin 0 -> 1275 bytes common/src/main/res/mipmap-xxhdpi/icon_hd.png | Bin 0 -> 1285 bytes common/src/main/res/mipmap-xxhdpi/icon_sd.png | Bin 0 -> 1720 bytes .../main/res/mipmap-xxhdpi/icon_selected.png | Bin 0 -> 1473 bytes common/src/main/res/values/strings.xml | 4 + config.gradle | 4 +- .../live/activity/LiveRyAnchorActivity.java | 11 +- .../yunbao/live/socket/SocketRyClient.java | 1 + .../live/views/LiveNewReadyRyViewHolder.java | 90 +++++++++++- .../main/res/layout/view_new_live_ready.xml | 43 +++++- 22 files changed, 504 insertions(+), 16 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/LiveStetUpStatusModel.java create mode 100644 common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java create mode 100644 common/src/main/res/drawable/bg_btn_definition.xml create mode 100644 common/src/main/res/layout/dialog_live_clarity.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_fhd.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_hd.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_sd.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_selected.png diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index fabbf6967..3063290c0 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -172,6 +172,7 @@ public class Constants { public static final String RECOMMEND_CARD_NOTIFY = "recommendCardNotify";//推荐卡通知消息 public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力 public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手 + public static final String AI_AUTOMATIC_SPEECH_LIVE = "aiAutomaticSpeechNew";//机器人助手 public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功 public static final String SUPER_VISION = "supervision";//超级发言警告 public static final String PK_RANK_UPDATE = "RankingRankUpdate";//PK排位赛更新数据 diff --git a/common/src/main/java/com/yunbao/common/bean/LiveStetUpStatusModel.java b/common/src/main/java/com/yunbao/common/bean/LiveStetUpStatusModel.java new file mode 100644 index 000000000..a4a98aa0d --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/LiveStetUpStatusModel.java @@ -0,0 +1,49 @@ +package com.yunbao.common.bean; + +import android.text.TextUtils; + +import com.google.gson.annotations.SerializedName; + +public class LiveStetUpStatusModel extends BaseModel { + + @SerializedName("wishList") + private String wishList; + @SerializedName("ai_state") + private String aiState; + + /** + * wishList 1设置 0 未设置 + * + * @return + */ + public boolean getWishListState() { + return TextUtils.equals(wishList, "1"); + } + + /** + * aiState 1打开机器人 0 未设置 + * + * @return + */ + public boolean getAiStateState() { + return TextUtils.equals(aiState, "1"); + } + + public String getWishList() { + return wishList; + } + + public LiveStetUpStatusModel setWishList(String wishList) { + this.wishList = wishList; + return this; + } + + public String getAiState() { + return aiState; + } + + public LiveStetUpStatusModel setAiState(String aiState) { + this.aiState = aiState; + return this; + } +} 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 1edb1f6ca..50fd3d6a0 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -15,6 +15,7 @@ import com.yunbao.common.bean.LinkMicUserBeanV2; import com.yunbao.common.bean.LiveAiRobotBean; import com.yunbao.common.bean.LiveInfoModel; import com.yunbao.common.bean.LiveRoomActivityBanner; +import com.yunbao.common.bean.LiveStetUpStatusModel; import com.yunbao.common.bean.MsgSwitchDetailModel; import com.yunbao.common.bean.NewPeopleInfo; import com.yunbao.common.bean.NobleRankHideUserListModel; @@ -522,11 +523,18 @@ public interface PDLiveApi { /** * 机器人修改话术 */ - @GET("/api/public/?service=Live.updateAiAutomaticSpeech ") + @GET("/api/public/?service=Live.updateAiAutomaticSpeech") Observable>> updateAiAutomaticSpeech( @Query("type") String type, @Query("id") String id, @Query("content") String content ); + /** + * 开播获取机器人状态和心愿单状态 + */ + @GET("/api/public/?service=Live.getLiveStetUpStatus") + Observable> getLiveStetUpStatus( + @Query("liveuid") String liveUid + ); } diff --git a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java index edd422440..cb0e8a0c6 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMLoginManager.java @@ -7,7 +7,6 @@ import android.text.TextUtils; import androidx.annotation.NonNull; -import com.cosmos.baseutil.app.AppContext; import com.google.gson.Gson; import com.lzf.easyfloat.EasyFloat; import com.yunbao.common.CommonAppContext; @@ -39,7 +38,25 @@ public class IMLoginManager extends BaseCacheManager { private final String IS_FLOAT = "is_float"; private final String IS_HINT = "is_hint"; private final String IS_HINT2 = "is_hint2"; + private final String SELECT_CLARITY = "selectClarity"; + /** + * 设置清晰度 + * + * @param selectClarity + */ + public void setSelectClarity(int selectClarity) { + put(SELECT_CLARITY, selectClarity); + } + + /** + * 获取清晰度 + * + * @return + */ + public int getSelectClarity() { + return getInt(SELECT_CLARITY, 1); + } public boolean isHint() { return 1 == getInt(IS_HINT, 0); diff --git a/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java b/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java index 8ad8f995a..25a8e22da 100644 --- a/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/InputCustomPopup.java @@ -4,6 +4,7 @@ import android.content.Context; import android.text.TextUtils; import android.view.View; import android.widget.EditText; +import android.widget.TextView; import androidx.annotation.NonNull; @@ -17,14 +18,17 @@ import com.yunbao.common.utils.ToastUtil; */ public class InputCustomPopup extends CenterPopupView { private String message = ""; + private int title = R.string.dialog_tip; - public InputCustomPopup(@NonNull Context context, String message) { + public InputCustomPopup(@NonNull Context context, String message, int title) { super(context); this.message = message; + this.title = title; } - public InputCustomPopup(@NonNull Context context) { + public InputCustomPopup(@NonNull Context context,int title) { super(context); + this.title = title; } // 返回自定义弹窗的布局 @@ -38,7 +42,9 @@ public class InputCustomPopup extends CenterPopupView { protected void onCreate() { super.onCreate(); EditText content = findViewById(R.id.content); + TextView titleText = findViewById(R.id.title); content.setText(message); + titleText.setText(title); findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { diff --git a/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java new file mode 100644 index 000000000..13ec97ca9 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/views/LiveClarityCustomPopup.java @@ -0,0 +1,116 @@ +package com.yunbao.common.views; + +import android.content.Context; +import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; + +import androidx.annotation.NonNull; + +import com.lxj.xpopup.core.BottomPopupView; +import com.yunbao.common.R; +import com.yunbao.common.views.weight.ViewClicksAntiShake; + +public class LiveClarityCustomPopup extends BottomPopupView implements View.OnClickListener { + private int selectClarity = 1; + private RelativeLayout lineSd, lineHd, lineFhd; + private ImageView iconSd, iconHd, iconFhd; + + public int getSelectClarity() { + return selectClarity; + } + + public LiveClarityCustomPopup(@NonNull Context context, int selectClarity) { + super(context); + this.selectClarity = selectClarity; + } + + public LiveClarityCustomPopup(@NonNull Context context) { + super(context); + } + + @Override + public void onClick(View v) { + + } + + // 返回自定义弹窗的布局 + @Override + protected int getImplLayoutId() { + return R.layout.dialog_live_clarity; + } + + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + initView(); + initDate(); + } + + private void initView() { + lineSd = findViewById(R.id.line_sd); + lineHd = findViewById(R.id.line_hd); + lineFhd = findViewById(R.id.line_fhd); + iconSd = findViewById(R.id.icon_sd); + iconHd = findViewById(R.id.icon_hd); + iconFhd = findViewById(R.id.icon_fhd); + selectClarity(selectClarity); + //流畅 + ViewClicksAntiShake.clicksAntiShake(lineSd, () -> { + selectClarity = 0; + selectClarity(selectClarity); + dismiss(); + }); + //高清 + ViewClicksAntiShake.clicksAntiShake(lineHd, () -> { + selectClarity = 1; + selectClarity(selectClarity); + dismiss(); + + }); + //超高清 + ViewClicksAntiShake.clicksAntiShake(lineFhd, () -> { + selectClarity = 2; + selectClarity(selectClarity); + dismiss(); + }); + } + + /** + * 状态选择 + * + * @param selectClarity + */ + private void selectClarity(int selectClarity) { + switch (selectClarity) { + case 0: + lineSd.setSelected(true); + lineHd.setSelected(false); + lineFhd.setSelected(false); + iconSd.setVisibility(VISIBLE); + iconHd.setVisibility(GONE); + iconFhd.setVisibility(GONE); + break; + case 1: + lineSd.setSelected(false); + lineHd.setSelected(true); + lineFhd.setSelected(false); + iconSd.setVisibility(GONE); + iconHd.setVisibility(VISIBLE); + iconFhd.setVisibility(GONE); + break; + case 2: + lineSd.setSelected(false); + lineHd.setSelected(false); + lineFhd.setSelected(true); + iconSd.setVisibility(GONE); + iconHd.setVisibility(GONE); + iconFhd.setVisibility(VISIBLE); + break; + } + } + + private void initDate() { + } +} diff --git a/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java index 953e9c7fe..f4652a3d6 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveRobotMessageCustomPopup.java @@ -136,7 +136,7 @@ public class LiveRobotMessageCustomPopup extends BottomPopupView { @Override public void onClick(View v) { new XPopup.Builder(getContext()) - .asCustom(new InputCustomPopup(getContext()).setListener(new InputCustomPopup.InputCustomListener() { + .asCustom(new InputCustomPopup(getContext(),R.string.automatic_message_sending).setListener(new InputCustomPopup.InputCustomListener() { @Override public void onConfirm(String text) { //添加消息语 diff --git a/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java b/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java index 93e61f37c..a76fcadef 100644 --- a/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java +++ b/common/src/main/java/com/yunbao/common/views/LiveRobotSayHelloCustomPopup.java @@ -82,7 +82,7 @@ public class LiveRobotSayHelloCustomPopup extends BottomPopupView { @Override public void onClick(View v) { new XPopup.Builder(getContext()) - .asCustom(new InputCustomPopup(getContext()).setListener(new InputCustomPopup.InputCustomListener() { + .asCustom(new InputCustomPopup(getContext(), R.string.automatic_greeting_setting).setListener(new InputCustomPopup.InputCustomListener() { @Override public void onConfirm(String text) { //添加消息语 diff --git a/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java b/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java index f182a0c12..c14de79f2 100644 --- a/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/RobotMessageViewHolder.java @@ -53,7 +53,7 @@ public class RobotMessageViewHolder extends RecyclerView.ViewHolder { @Override public void onClick(View v) { new XPopup.Builder(itemView.getContext()) - .asCustom(new InputCustomPopup(itemView.getContext(), message.getContent()).setListener(new InputCustomPopup.InputCustomListener() { + .asCustom(new InputCustomPopup(itemView.getContext(), message.getContent(), R.string.automatic_message_sending).setListener(new InputCustomPopup.InputCustomListener() { @Override public void onConfirm(String text) { LiveNetManager.get(itemView.getContext()) diff --git a/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java b/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java index 359f7ba1a..75ee2e293 100644 --- a/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java +++ b/common/src/main/java/com/yunbao/common/views/RobotSayHelloViewHoler.java @@ -53,7 +53,7 @@ public class RobotSayHelloViewHoler extends RecyclerView.ViewHolder { @Override public void onClick(View v) { new XPopup.Builder(itemView.getContext()) - .asCustom(new InputCustomPopup(itemView.getContext(), message.getContent()).setListener(new InputCustomPopup.InputCustomListener() { + .asCustom(new InputCustomPopup(itemView.getContext(), message.getContent(), R.string.automatic_greeting_setting).setListener(new InputCustomPopup.InputCustomListener() { @Override public void onConfirm(String text) { LiveNetManager.get(itemView.getContext()) diff --git a/common/src/main/res/drawable/bg_btn_definition.xml b/common/src/main/res/drawable/bg_btn_definition.xml new file mode 100644 index 000000000..f4a1222ee --- /dev/null +++ b/common/src/main/res/drawable/bg_btn_definition.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_clarity.xml b/common/src/main/res/layout/dialog_live_clarity.xml new file mode 100644 index 000000000..35fd83425 --- /dev/null +++ b/common/src/main/res/layout/dialog_live_clarity.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_fhd.png b/common/src/main/res/mipmap-xxhdpi/icon_fhd.png new file mode 100644 index 0000000000000000000000000000000000000000..278b37842e1da0a98df9e5ae76eab15d6f44a8d2 GIT binary patch literal 1275 zcmVPx(wMj%lRCr$Pnp>=1LlnnK>tG$@@((k``h3CoSbvMHBaY! zduGk--~P{OG z{K5x?fpolwXghFh4;|E1 z8IiQr%w7i;C6&j$Se>B)^ku-4NnKaM{*rzx>Z~X}MlU9Fb>0C+C4HECSOW6tu}8l> zRN5_-^rD%41dJs1)=RpuNgrl*4e&sw%{)n86@YF8?rCB-Q`g`BR!MiK&q_f4RR*!5 zohoU|Gz3&~StV&4>_Gwgy6{1F6kl~JDCk+Bx^TD?cVBjLjWb^%$=h~HH$ZEETY8ah zx~fbO1kPE{@ zhB*nOCnSvyJ)mN$Jq=uv0Qx}E{Gp#>1)!UNG)VlT6R{T+a)F}90&8oQd5<%;OZvQ8 zZ-Qn1HNd0ZCgoyaRi;5Nk#yHpEE(@aerRM6fue5!JxpI+aeTRDz6qGRx`PIE7O*MP z>7qdZa=SlEI&c~TIt|FBV=fpJAZN3eB%imQKACO`IuY2KQP9dk0oo?XJL!~Z2xvaA zIRj`}H$c7t^?gaVvJ3bOxKq;mHGqBxzOQpG$#ai%510fey%2aa)6e3FgZ|B^zK{X5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z8Wt5p0d>IoY&aACO)Pr z3dBgxyUuGBFqTFJFny4VEwS-%B2&e=)(Rt7EXBU^#WMOHYZ1;u8TOIM&cnt#Bj{_6 z_*o=Nu*nr3(D@IcRWe7))0}uRh%$a_zvtTU1=4R%oC)+tiAR7&Pd{Z>!z^(*L!Eue zpdleYE6B~MP7u)9@7)RBhNvgEj8+iiYZZc*6mljTTv2mWkW! zC9hWm3$5&M#Cq$9x*cuSn8&T?7T{!+`+H%rTa6bx05yYEToQ)1;TVYM(^}cDu1qlM z{CBAN1JcO)ZK(KGe4T4+kYYcVXsB63Qab$l<@jC0Q0r8lDGvW+I&@54Zn|Y7HX|ix z+NgO#j-A&*Li&b-(({d@v=sDo+>k-FxDDO&T_ims>+$M2+kJhGKxEDtDa+@;7Q-v; z(sg22dE9&0_W||cujvC(LqE$g->L#>rOVLh#cu4}+JGt7^jqr6^fGXYTh54=g?zSR zb&|61{`lGHl5D!rNXJm-4qym<5K^Ac!NQ$F)mZpha=VM2Ti+FZIDA>G8gL(Wn>r z=%QPj`?{CJtFh}0)pWB A?f?J) literal 0 HcmV?d00001 diff --git a/common/src/main/res/mipmap-xxhdpi/icon_selected.png b/common/src/main/res/mipmap-xxhdpi/icon_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..5aeea828a91492a08bddd2b1cdbaed6997f9f0bd GIT binary patch literal 1473 zcmV;y1wQ(TP)Px)dr3q=RA@upn_FxYWfXwFv)dL*OB-$?DoPicUO3=y4G~c{ zx?KV4@72Y0Tx|g6yHT2jH9ILSTqIKu{o`cI5l};wlc0MSs`ol6%j*9{euIK}5^On< z$ZkSF6HdGLf!>x?=Up3_t#Qch+(39^CrgIc#S2$kK=VKe1wJ1_ z-#Mo}-AS02wot$}^0$dq=gCabP+&Q#^`4x_l#s6wDmOxDoxO!Cd*JY5 zXX_#>L_?D|qLHP}tFyGiUksI-p=5@=!M}e1WB0V%*&*?55^W6Z0iET%ItwfOB~ZNu zito2KW`yJ)%Rt?B6J@VxsH_cTk|*~i4>asaG)5?IG*oYeqAGiRm%fCf%Yh{N!ompy z@KVwV-Z`j{n>QCsQboEkF+;I`KugYnlC1bqhJX%-XqOx7+JE^8uWG*W1qZN?9T5;gB)% z)U?l_XsS2J5f#>fl0Vj7{!~4j{V+8+GenI;#%r3$E46l@C{71I-cA-xgQ_i%Kgu59 z#2Pr)cVA5r(o7R6B>H3_iywfhk0Gxl)^SzqFuAZTMW}w_!p77~HMfu@Gp!26Ut|Lp zvC_a_JJJVdouVs5_XlPW*8M4Ic7nY0HH>-`{KIYF!d3!r|0*RHY=zBY+v=pHeqC~c zwDTa+4M(4Mz7=>u@4YS=vT3{UCIe|yKt|DgyO6ng;WYu%*|Km0+4CQ?JOiB} z7mj*d64kOuche~mWVj1jmO$45kDj{_8`yL*cd;?eZ9_ZAa0eWE8vZ@#!pl^a3}_o# zfEj4~`bWauFGFb%uC~I-b#SdM70;bz<28OQ$Q*9nn}E6g^2JISIsE#pH^4QQUw~Sn zn&YpqO~_mxLbw&GIXp%Z1(~aZKz)$8Jj&Gvnajg?{p+Kg9jAowh4I&SNRH0gt_-6%j1oSYfKM|bX>}4)H b(H-i4>yU9mdps*^00000NkvXXu0mjf+Q!A` literal 0 HcmV?d00001 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index b0b723181..7371b9465 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -996,4 +996,8 @@ 當有用戶進入直播間時,機器人會@該用戶並自動 隨機以下一句話。最少設置1條,最多20條。 機器人設置 + 高清 + 流暢 + 超高清 + 確定清晰度開播後,需要重新開播才能更改 diff --git a/config.gradle b/config.gradle index 6f21be570..ac60b7e57 100644 --- a/config.gradle +++ b/config.gradle @@ -10,9 +10,9 @@ ext { manifestPlaceholders = [ //正式 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 測試 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", 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 6e02d0be9..8a1dc02df 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -918,6 +918,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl LiveHttpUtil.stopLive(mStream, new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { + if (robotRunnable != null) { + robotHandler.removeCallbacks(robotRunnable); + robotRunnable = null; + } if (code == 0) { JSONObject obj = JSON.parseObject(info[0]); JSONObject datas = obj.getJSONObject("data"); @@ -1622,7 +1626,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onSuccess(List messageList) { Random random = new Random(); - int randNumber = random.nextInt(messageList.size() - 1) - 1; + int randNumber = random.nextInt(messageList.size()) - 1; + if (randNumber < 0) { + randNumber = 0; + } Log.e("随机打招呼", "(((((((((((((((((((((((((((((((((((((((((((((((data.randNumber())" + randNumber); Log.e("随机打招呼", "(((((((((((((((((((((((((((((((((((((((((((((((data)" + messageList.toString()); sendRobotMessage(robotName, messageList.get(randNumber).getContent()); @@ -1673,7 +1680,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl .setContent(content); SocketSendBean msg = new SocketSendBean() - .param("_method_", "aiAutomaticSpeech") + .param("_method_", "aiAutomaticSpeechNew") .param("msgtype", "10") .param("ct", GsonUtils.toJson(aiAutomaticSpeechModel, AiAutomaticSpeechModel.class)); msg.create(); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index ce6ea69f5..b2685d167 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -529,6 +529,7 @@ public class SocketRyClient { } break; case Constants.AI_AUTOMATIC_SPEECH: + case Constants.AI_AUTOMATIC_SPEECH_LIVE: //{"name_color":"#f19ec2","ai_name":"助手小小P","content":"@1 ","user_name":"1","icon":"https://downs.yaoulive.com/xzs_tab.png","system_bubble":"https://downs.yaoulive.com/xzs_qipao.9.png"} AiAutomaticSpeechModel aiAutomaticSpeechModel = GsonUtils.fromJson(map.getString("ct"), AiAutomaticSpeechModel.class); Bus.get().post(new LiveAudienceEvent() 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 57be40428..019a85805 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadyRyViewHolder.java @@ -11,12 +11,15 @@ import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; +import android.widget.ImageView; import android.widget.TextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.core.content.ContextCompat; import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.core.BasePopupView; +import com.lxj.xpopup.interfaces.XPopupCallback; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.Constants; import com.yunbao.common.bean.LiveClassBean; @@ -25,6 +28,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.ImageResultCallback; +import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.L; import com.yunbao.common.utils.ProcessImageUtil; @@ -32,7 +36,9 @@ import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsViewHolder; +import com.yunbao.common.views.LiveClarityCustomPopup; import com.yunbao.common.views.LiveRobotSettingCustomPopup; +import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.faceunity.FaceManager; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; @@ -59,7 +65,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl private ProcessImageUtil mImageUtil; private File mAvatarFile; private TextView mLiveClass; - private TextView mLiveTypeTextView;//房间类型TextView + private TextView mLiveTypeTextView, liveClarity;//房间类型TextView private TextView mLiveWishListTextView;//心愿单TextView private int mLiveClassID;//直播频道id private int mLiveType;//房间类型 @@ -70,6 +76,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl private LiveClassBean classBean; private FaceManager manager; private TextView faceTextView;//提示人脸未检测到的TextView + private ImageView imgClarity; + private int selectClarity = 1; public LiveNewReadyRyViewHolder(Context context, ViewGroup parentView, int liveSdk) { super(context, parentView, liveSdk); @@ -90,6 +98,8 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl @Override public void init() { mRootView = (ConstraintLayout) findViewById(R.id.traceroute_rootview); + imgClarity = (ImageView) findViewById(R.id.img_clarity); + liveClarity = (TextView) findViewById(R.id.live_clarity); mRootView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -163,6 +173,7 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl findViewById(R.id.btn_start_live).setOnClickListener(this); findViewById(R.id.btn_wishlist).setOnClickListener(this); findViewById(R.id.btn_horizontally).setOnClickListener(this); + if (manager != null) { manager.setFaceStatusChanged(new FaceManager.FaceStatusChanged() { final Handler handler = new Handler(Looper.getMainLooper()); @@ -180,6 +191,83 @@ public class LiveNewReadyRyViewHolder extends AbsViewHolder implements View.OnCl }); //新美颜 setFaceUnity(true); + + } + //设置清晰度 + selectClarity = IMLoginManager.get(mContext).getSelectClarity(); + setSelectClarity(selectClarity); + ViewClicksAntiShake + .clicksAntiShake( + findViewById(R.id.btn_live_clarity), () -> { + LiveClarityCustomPopup liveClarityCustomPopup = new LiveClarityCustomPopup(mContext, selectClarity); + new XPopup.Builder(mContext) + .setPopupCallback(new XPopupCallback() { + @Override + public void onCreated(BasePopupView popupView) { + + } + + @Override + public void beforeShow(BasePopupView popupView) { + + } + + @Override + public void onShow(BasePopupView popupView) { + + } + + @Override + public void onDismiss(BasePopupView popupView) { + setSelectClarity(liveClarityCustomPopup.getSelectClarity()); + } + + @Override + public void beforeDismiss(BasePopupView popupView) { + + } + + @Override + public boolean onBackPressed(BasePopupView popupView) { + return false; + } + + @Override + public void onKeyBoardStateChanged(BasePopupView popupView, int height) { + + } + + @Override + public void onDrag(BasePopupView popupView, int value, float percent, boolean upOrLeft) { + + } + + @Override + public void onClickOutside(BasePopupView popupView) { + + } + }) + .asCustom(liveClarityCustomPopup) + .show(); + }); + } + + private void setSelectClarity(int selectClarity) { + this.selectClarity = selectClarity; + IMLoginManager.get(mContext).setSelectClarity(selectClarity); + switch (selectClarity) { + case 0: + imgClarity.setImageResource(R.mipmap.icon_sd); + liveClarity.setText(R.string.standard_clear); + break; + case 1: + imgClarity.setImageResource(R.mipmap.icon_hd); + liveClarity.setText(R.string.high_definition); + break; + case 2: + imgClarity.setImageResource(R.mipmap.icon_fhd); + liveClarity.setText(R.string.ultra_hd); + break; } } 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 98af6cebf..eadb2a80c 100644 --- a/live/src/main/res/layout/view_new_live_ready.xml +++ b/live/src/main/res/layout/view_new_live_ready.xml @@ -54,6 +54,43 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> + + + + + + + + +