From 64f9cee3aff232b0c31ac0b4bfa0827ac13eb275 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Tue, 23 Jan 2024 09:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/bean/SudGameChatImModel.java | 11 +++ .../yunbao/common/bean/SudGameUserModel.java | 17 ++++ .../manager/imrongcloud/GameMicManager.java | 42 ++++++++-- .../common/views/SudGameChatViewHolder.java | 33 +++++--- .../views/SudGameUserListViewHolder.java | 15 ++-- .../src/main/res/layout/activity_sud_game.xml | 12 ++- .../res/layout/item_home_sud_game_list.xml | 7 +- .../main/res/layout/view_sud_game_small.xml | 2 +- .../layout/view_sud_game_user_list_holder.xml | 11 ++- .../mipmap-xxhdpi/icon_game_review_input.png | Bin 0 -> 4594 bytes .../res/mipmap-xxhdpi/icon_game_status.png | Bin 0 -> 2289 bytes config.gradle | 4 +- .../yunbao/live/activity/SudGameActivity.java | 77 +++++++++--------- .../layout/view_main_home_sud_game_list.xml | 1 + 14 files changed, 154 insertions(+), 78 deletions(-) create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_game_review_input.png create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_game_status.png diff --git a/common/src/main/java/com/yunbao/common/bean/SudGameChatImModel.java b/common/src/main/java/com/yunbao/common/bean/SudGameChatImModel.java index e55ee691d..3caf0159e 100644 --- a/common/src/main/java/com/yunbao/common/bean/SudGameChatImModel.java +++ b/common/src/main/java/com/yunbao/common/bean/SudGameChatImModel.java @@ -6,6 +6,17 @@ public class SudGameChatImModel extends BaseModel { //文字消息 private String textMessage; + private boolean welcomMessage; + + public boolean isWelcomMessage() { + return welcomMessage; + } + + public SudGameChatImModel setWelcomMessage(boolean welcomMessage) { + this.welcomMessage = welcomMessage; + return this; + } + public String getNickname() { return nickname; } diff --git a/common/src/main/java/com/yunbao/common/bean/SudGameUserModel.java b/common/src/main/java/com/yunbao/common/bean/SudGameUserModel.java index a614ee9d7..78aefaed9 100644 --- a/common/src/main/java/com/yunbao/common/bean/SudGameUserModel.java +++ b/common/src/main/java/com/yunbao/common/bean/SudGameUserModel.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import android.text.TextUtils; + import com.google.gson.annotations.SerializedName; public class SudGameUserModel extends BaseModel { @@ -14,6 +16,21 @@ public class SudGameUserModel extends BaseModel { private int id; @SerializedName("mic_status") private int micStatus; //麦克风状态 2.打开麦克风 3.关闭麦克风 + @SerializedName("game_status") + private String gameStatus;// 游戏状态 1.未在游戏状态 2.游戏中; + + public String getGameStatus() { + return gameStatus; + } + + public boolean isGameIng() { + return TextUtils.equals(getGameStatus(), "2") ; + } + + public SudGameUserModel setGameStatus(String gameStatus) { + this.gameStatus = gameStatus; + return this; + } private boolean mute = false; diff --git a/common/src/main/java/com/yunbao/common/manager/imrongcloud/GameMicManager.java b/common/src/main/java/com/yunbao/common/manager/imrongcloud/GameMicManager.java index 09da6f188..eecc6647f 100644 --- a/common/src/main/java/com/yunbao/common/manager/imrongcloud/GameMicManager.java +++ b/common/src/main/java/com/yunbao/common/manager/imrongcloud/GameMicManager.java @@ -392,6 +392,7 @@ public class GameMicManager { @Override public void onSuccess() { Log.i("tx", "加入成功"); + enterRoom(); } @@ -440,7 +441,18 @@ public class GameMicManager { SudGameSocketImEvent.MsgDTO msgDTO = msgDTOS.get(0); //正常文字消息 if (TextUtils.equals(msgDTO.getMethod(), "SendMsg")) { - getView().insertItem(new SudGameChatImModel().setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt())); + getView().insertItem(new SudGameChatImModel().setWelcomMessage(false).setNickname(msgDTO.getUname()).setTextMessage(msgDTO.getCt())); + } else if (TextUtils.equals(msgDTO.getMethod(), "welcomMessage")) { + // 欢迎(用户名)进入房间 Welcome (username) to the room + + StringBuffer stringBuffer = new StringBuffer(); + if (WordUtil.isNewZh()) { + stringBuffer.append("歡迎 ").append(msgDTO.getUname()).append(" 進入房間"); + } else { + stringBuffer.append("Welcome ").append(msgDTO.getUname()).append(" to enter the room"); + } + + getView().insertItem(new SudGameChatImModel().setWelcomMessage(true).setNickname(msgDTO.getUname()).setTextMessage(stringBuffer.toString())); } else if (TextUtils.equals(msgDTO.getMethod(), "sudGameRoomVoiceList")) { List personList = new Gson().fromJson(msgDTO.getCt(), new TypeToken>() { }.getType()); @@ -451,12 +463,7 @@ public class GameMicManager { } } - /** - * 发送聊天信息 - * - * @param textMessage - */ - public void sendMessage(String textMessage) { + private void sendChatMessage(String textMessage, String method) { IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo(); SudGameSocketImEvent sudGameSocketImEvent = new SudGameSocketImEvent(); sudGameSocketImEvent.setRetcode("000000"); @@ -467,7 +474,7 @@ public class GameMicManager { .setCt(textMessage) .setEquipment("app") .setUid(String.valueOf(loginModel.getId())) - .setMethod("SendMsg") + .setMethod(method) .setUname(loginModel.getUserNicename()) .setRoomnum(mRoomID); @@ -494,11 +501,28 @@ public class GameMicManager { @Override public void onError(Message message, RongIMClient.ErrorCode errorCode) { - Log.i("tx", "发送成功"+errorCode.toString()); + Log.i("tx", "发送成功" + errorCode.toString()); } }); } + /** + * 发送聊天信息 + * + * @param textMessage + */ + public void sendMessage(String textMessage) { + sendChatMessage(textMessage, "SendMsg"); + } + + /** + * 进房间 + */ + public void enterRoom() { + IMLoginModel loginModel = IMLoginManager.get(CommonAppContext.sInstance.getApplicationContext()).getUserInfo(); + sendChatMessage(loginModel.getUserNicename(), "welcomMessage"); + } + /** * activity相关回调 */ diff --git a/common/src/main/java/com/yunbao/common/views/SudGameChatViewHolder.java b/common/src/main/java/com/yunbao/common/views/SudGameChatViewHolder.java index a76cbc058..bc7214618 100644 --- a/common/src/main/java/com/yunbao/common/views/SudGameChatViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/SudGameChatViewHolder.java @@ -32,18 +32,29 @@ public class SudGameChatViewHolder extends RecyclerView.ViewHolder { public void sudGameChat(SudGameChatImModel msgModel) { new LoadDian9TuUtilSud().loadDian9TuAssets(itemView.getContext(), mBg, 1); StringBuffer buffer = new StringBuffer(); - String userName = msgModel.getNickname() + ":"; - buffer.append(userName) - .append(" ") - .append(msgModel.getTextMessage()); - - String msg = buffer.toString(); - - int unameIndexOf = msg.indexOf(userName); - int unameSize = userName.length(); SpannableStringBuilder builder = new SpannableStringBuilder(); - builder.append(msg); - builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBD0D")), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + if (msgModel.isWelcomMessage()) { + String userName = msgModel.getNickname(); + buffer.append(msgModel.getTextMessage()); + String msg = buffer.toString(); + int unameIndexOf = msg.indexOf(userName); + int unameSize = userName.length(); + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBD0D")), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } else { + + String userName = msgModel.getNickname() + ":"; + buffer.append(userName) + .append(" ") + .append(msgModel.getTextMessage()); + String msg = buffer.toString(); + + int unameIndexOf = msg.indexOf(userName); + int unameSize = userName.length(); + + builder.append(msg); + builder.setSpan(new ForegroundColorSpan(Color.parseColor("#FFBD0D")), unameIndexOf, unameIndexOf + unameSize, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + } chatMessage.setText(builder); } } diff --git a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java index 98ba77a66..0ba2aa016 100644 --- a/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java +++ b/common/src/main/java/com/yunbao/common/views/SudGameUserListViewHolder.java @@ -1,8 +1,6 @@ package com.yunbao.common.views; -import android.app.Activity; import android.view.View; -import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -19,11 +17,11 @@ import com.yunbao.common.bean.SudGameUserModel; import com.yunbao.common.dialog.SudGameSmallPopupPindow; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.utils.Bus; -import com.yunbao.common.utils.DeviceUtils; +import com.yunbao.common.utils.DpUtil; import com.yunbao.common.views.weight.ViewClicksAntiShake; public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { - private ImageView vacancy_sud_game, mic_status; + private ImageView vacancy_sud_game, mic_status, game_status; private FrameLayout user_layout; private RoundedImageView sud_game_user; private LinearLayout layout; @@ -35,6 +33,7 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { user_layout = itemView.findViewById(R.id.user_layout); mic_status = itemView.findViewById(R.id.mic_status); layout = itemView.findViewById(R.id.layout); + game_status = itemView.findViewById(R.id.game_status); } public void upData(SudGameUserModel sudGameUserModel, SudGameUserListAdapter.SudGameSmallCallBack sudGameSmallCallBack, int position) { @@ -67,13 +66,19 @@ public class SudGameUserListViewHolder extends RecyclerView.ViewHolder { if (sudGameUserModel.isMute()) { ImgLoader.display2(itemView.getContext(), R.mipmap.icon_game_close_wheat_mute, mic_status); } + if (sudGameUserModel.isGameIng()) { + game_status.setVisibility(View.VISIBLE); + } else { + game_status.setVisibility(View.GONE); + } ViewClicksAntiShake.clicksAntiShake(user_layout, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - XPopup.Builder builder = new XPopup.Builder(itemView.getContext()).atView(user_layout); + XPopup.Builder builder = new XPopup.Builder(itemView.getContext()).atView(sud_game_user); builder.hasShadowBg(false) .isDestroyOnDismiss(true) .isLightStatusBar(false) + .maxHeight(DpUtil.dp2px(70)) .popupPosition(PopupPosition.Bottom) .asCustom(new SudGameSmallPopupPindow(itemView.getContext(), sudGameUserModel, diff --git a/common/src/main/res/layout/activity_sud_game.xml b/common/src/main/res/layout/activity_sud_game.xml index e358ac494..509fdd08c 100644 --- a/common/src/main/res/layout/activity_sud_game.xml +++ b/common/src/main/res/layout/activity_sud_game.xml @@ -23,20 +23,20 @@ android:layout_marginStart="23dp" android:layout_marginTop="25dp" android:background="@drawable/bg_live_sud_game_top_new" - android:gravity="center"> + android:gravity="start|center_vertical"> diff --git a/common/src/main/res/layout/item_home_sud_game_list.xml b/common/src/main/res/layout/item_home_sud_game_list.xml index 93aeb12d2..266e1d844 100644 --- a/common/src/main/res/layout/item_home_sud_game_list.xml +++ b/common/src/main/res/layout/item_home_sud_game_list.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="88dp" android:layout_marginStart="15dp" - android:layout_marginTop="14dp" + android:layout_marginEnd="15dp" android:background="@mipmap/background_home_sud_game_list" android:orientation="horizontal"> @@ -76,14 +76,14 @@ diff --git a/common/src/main/res/layout/view_sud_game_small.xml b/common/src/main/res/layout/view_sud_game_small.xml index 8c8d2aae6..95146fa4a 100644 --- a/common/src/main/res/layout/view_sud_game_small.xml +++ b/common/src/main/res/layout/view_sud_game_small.xml @@ -1,7 +1,7 @@ diff --git a/common/src/main/res/layout/view_sud_game_user_list_holder.xml b/common/src/main/res/layout/view_sud_game_user_list_holder.xml index 2d86b7c83..d1cf29387 100644 --- a/common/src/main/res/layout/view_sud_game_user_list_holder.xml +++ b/common/src/main/res/layout/view_sud_game_user_list_holder.xml @@ -1,7 +1,7 @@ + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_game_review_input.png b/common/src/main/res/mipmap-xxhdpi/icon_game_review_input.png new file mode 100644 index 0000000000000000000000000000000000000000..3f3af8b8070b560057a476ddf7d968677386e9cb GIT binary patch literal 4594 zcmVPx`tVu*cRCr$PT@Q3qRhs|qeQBDeDTVT%q5KiVQX$PtSQmA0E3iAxFw25Y!8)MB zzb!&fRd!}!o!ztJI*Xu=s~*I%SY2esVmk`UkuxrX)sX>Qm*k~|wurz09siU=jyn8X+xPbtk}j0FH7_#=ccOiKUpzv|yOrr@~9 zpEBX!0{#dgf-K9;gphLpfMlHnfV23wBuQT;5*7(Vj3|mTI%oHz05A~%QgJmX0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cmV?d00001 diff --git a/common/src/main/res/mipmap-xxhdpi/icon_game_status.png b/common/src/main/res/mipmap-xxhdpi/icon_game_status.png new file mode 100644 index 0000000000000000000000000000000000000000..3ada94753d763098fb66603f8b255b2b5a896314 GIT binary patch literal 2289 zcmVPx-t4TybRA@uRnG0}~R~5&9=iA+Eb~leD1PaI?Eh99Qwhpu~Pzq%X8=f;NQXG&B zGD1a=4hlmZ?MT5F9W7F47`0l9v`ovZwpB>NBW)d8o{FOuq(f=30&OAWwMq7Q&HcXJ zJT{x%%_hM!v$L7({m!}nd(Qcv^PMYXAZj-@3b-9%0WcHcUW7uTTtqlUlDRl{`t3k7H-YU$*e0`0u-!^ZP^yXt5MIK@ zr%W)ZL<5WxK=B(XV@)Q&)NXR{QUy#wu%+~Y-l;xF;omr!E>pSMosDimsl(hsgku;C zN$>Cu>h;M+I19`XA6JqYRtkedj5EVZDC&`Z3*0FTW=SbGlIc$hN>!6fkkjPwSwfkd zdBPe85aJ5LPl@tJDdRu!6{?c)z(Nexqpj;u?y0!UaNH?A$}Y3_6L{ijgpR)kSf%6r{`I*yHrX7NiVb_n=|>(>p!VKIpy&l6?f zpcsW^!(>Ua+}|j)vs+q%xPYe{*vE zhCwJ~8TELgj2IEY=WAm49T7UGY!(i(L&cw5oH*_z*QHp#yn&*k6sKi{V4e8zb_G?* zN}Oy@wkZwZ4?FYt``H{+H=UQmp;)%8fw5z=DQq3UJ7C|79;&Nzak~}k*Vi#s=N661t1Oh@$jX`s>Go{HNQ4)zG*e3*+@2^tPngWKJIDB&bQt!MO|q0GFMNCFPnzst?hqb@W2 zHf*S6;NXOuioYdvKD6sZ86z{PF~d()vKZm_mh)pGP*-cPd9&AKBF#dZHr-6lL;`QV z;bhmYeC&3`v}r9YSmf9JUuto}&S&xvqdid#flHShT)k$)VTZ9}gE(_LfKoz9Ns#dq zf{BObN0=)!c-;bZh#$0mZ|u}X2weWa&bDm@CaAkgLOk+~dh9xWlgRs*?ELsAUYt(F zm^(wPUR$4@2|ci4adDS}G7M#gvX-#<%G2KX=tw9nZRX1h{fQy2SFRKvzZLas9Nf8UqxtaN2@-yAnq8TZ*7;xo7o5`B(fZ*Uk7bj0Tak&&rmo`#V)R}cW9z{Vx zLY`S5aPEH|=?9#+KVej)E4j*x$Lt^OA2&-1rQ#34Ug_b@Y1CCWY*|8%J zrxPL(;mIvE(Y%7Fkx^3|3$r#?48 z+#E>RnG2kI$H9REZZ2GK#JUH|{~Dav8)ed@mYTWqn(`g?4rL)tN+tc-0lQ!DaP)`^ zwkCoKWNW)K`RI#fI2)8WB` z21j&Na`ehe+P)1=pKx;Syu)PD*|VC-&(E;^*F9hhU(lY~hLbft>aKNi#~CYmb)mBgRSH9@V^pk5${MQN*l@3whsp4LOvAWw^`BK3>mt=UfBSka9^kmoh1 zcQ7c)YW~(YTj@J3)*$tSrgS}%>Al3~-m!vAik z&1dnjut(Z0P^UHfoxsL~jAshgJ=8fA_qWd4G!gWRsJC#@NCgH{GtM!K(syW3zr?}n z9=N)ZD4&;^oa`4g9h9mnJ_l4o`%EvTOtOYEKPoy#zZ46r|j!)mQyoe5|`wfI0ws95I9>C-<8H2BzZH(|P z!b$AB!9(20rl|Jy0jQ0wmx5CmK$MBC1Tqc9X!BNIc$p}><81stobnVql(rb}00000 LNkvXXu0mjf80ktP literal 0 HcmV?d00001 diff --git a/config.gradle b/config.gradle index dbecffd33..7f16e5253 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 - serverHost : "https://napi.yaoulive.com", +// serverHost : "https://napi.yaoulive.com", // 测试 - //serverHost : " https://ceshi.yaoulive.com", + serverHost : " https://ceshi.yaoulive.com", //百度语音识别 diff --git a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java index 1a24684c3..7c4122ed9 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java @@ -297,6 +297,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti .asCustom(new LiveSudGameHistoryPopup(mContext, customSidebarChildModels)).show(); } }); + ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.game_seat), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { @@ -333,53 +334,51 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti @Override public void onViewClicks() { if (imOff && gameMicManager != null) { - if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) { - if (disable) { - disable = false; - // 设置禁用麦克风采集 - RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable); - ImgLoader.display(mContext, R.mipmap.icon_game_open_wheat, gameCloseWheat); - LiveNetManager.get(mContext) - .onMic(mLiveUid, new HttpCallback() { - @Override - public void onSuccess(HttpCallbackModel data) { - } + gameCloseWheat.post(new Runnable() { + @Override + public void run() { + if (disable) { + disable = false; + // 设置禁用麦克风采集 + RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable); + ImgLoader.display(mContext, R.mipmap.icon_game_open_wheat, gameCloseWheat); + LiveNetManager.get(mContext) + .onMic(mLiveUid, new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { - @Override - public void onError(String error) { + } - } - }); - ToastUtil.show(WordUtil.isNewZh() ? "麥克風已開啟" : "Microphone turned on"); - } else { - disable = true; - // 设置禁用麦克风采集 - RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable); - ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat); - LiveNetManager.get(mContext) - .offMic(mLiveUid, new HttpCallback() { - @Override - public void onSuccess(HttpCallbackModel data) { + @Override + public void onError(String error) { - } + } + }); + ToastUtil.show(WordUtil.isNewZh() ? "麥克風已開啟" : "Microphone turned on"); + } else { + disable = true; + // 设置禁用麦克风采集 + RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable); + ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat); + LiveNetManager.get(mContext) + .offMic(mLiveUid, new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { - @Override - public void onError(String error) { + } - } - }); - ToastUtil.show(WordUtil.isNewZh() ? "麥克風已關閉" : "Microphone turned off"); - } - - } else { - mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() { - @Override - public void run() { + @Override + public void onError(String error) { + } + }); + ToastUtil.show(WordUtil.isNewZh() ? "麥克風已關閉" : "Microphone turned off"); } - }); - } + } + }); + + } diff --git a/main/src/main/res/layout/view_main_home_sud_game_list.xml b/main/src/main/res/layout/view_main_home_sud_game_list.xml index 12b6f8349..55e2b6618 100644 --- a/main/src/main/res/layout/view_main_home_sud_game_list.xml +++ b/main/src/main/res/layout/view_main_home_sud_game_list.xml @@ -191,6 +191,7 @@ android:layout_height="match_parent">