From c1d6b67322668aad9d5a96072e543534a71669cf Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Thu, 5 Oct 2023 15:44:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E4=BF=AE=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E7=B2=89=E4=B8=9D=E5=9B=A2=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LiveNewRoleInteractionGamesAdapter.java | 2 +- .../common/dialog/CreateSudGamePopup.java | 4 +- .../dialog/SudGameSearchDialogPopup.java | 44 ++++++++++---- .../common/http/live/LiveNetManager.java | 2 +- .../layout/dialog_home_search_sud_game.xml | 42 ++++++------- .../res/layout/dialog_search_sud_game.xml | 50 ++++++++-------- ...ew_live_new_role_fun_games_child_view3.xml | 55 ++++++++++++++++++ .../main/res/mipmap-xxhdpi/icon_new_game.png | Bin 0 -> 1682 bytes 8 files changed, 138 insertions(+), 61 deletions(-) create mode 100644 common/src/main/res/layout/view_live_new_role_fun_games_child_view3.xml create mode 100644 common/src/main/res/mipmap-xxhdpi/icon_new_game.png diff --git a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java index 58c920ae2..38a531bce 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LiveNewRoleInteractionGamesAdapter.java @@ -33,7 +33,7 @@ public class LiveNewRoleInteractionGamesAdapter extends RecyclerView.Adapter { @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { - View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view, parent, false); + View runGamesView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_live_new_role_fun_games_child_view3, parent, false); return new InteractionGamesChildViewHolder(runGamesView); } diff --git a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java index 7b721bb4c..95f7d825f 100644 --- a/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/CreateSudGamePopup.java @@ -106,14 +106,14 @@ public class CreateSudGamePopup extends BottomPopupView { String name = roomName.getText().toString(); if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) { if (name.length() > 10) { - ToastUtil.show("房间名太长"); + ToastUtil.show("房間名长度为[1-10]"); return; } } if (IMLoginManager.get(getContext()).getLocaleLanguage() != Locale.SIMPLIFIED_CHINESE) { if (name.length() > 15) { - ToastUtil.show("The room name is too long"); + ToastUtil.show("Room name length is [1-15]"); return; } diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameSearchDialogPopup.java b/common/src/main/java/com/yunbao/common/dialog/SudGameSearchDialogPopup.java index b5c4ac0fc..5f0ba505b 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameSearchDialogPopup.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameSearchDialogPopup.java @@ -96,6 +96,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow { search(value); } else { + findViewById(R.id.layout_history_empty).setVisibility(GONE); switchList(true); } } @@ -144,7 +145,9 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow { } }); } + private void initHistoryData() { + searchHistory.removeAllViews(); String value = SpUtil.getStringValue(SP_HISTORY); historyList = new ArrayList<>(); if (!StringUtil.isEmpty(value)) { @@ -158,18 +161,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow { } private void search(String value) { - boolean isValue = false; - for (String str : historyList) { - if (!isValue) { - isValue = TextUtils.equals(value, str); - } - } - if (!isValue) { - historyList.add(value); - SpUtil.setStringValue(SP_HISTORY, JSONArray.toJSONString(historyList)); - addHistoryData(value); - } LiveNetManager.get(mContext) .searchRoomList("0", "0,0", "0", value, 0, new HttpCallback>() { @Override @@ -178,14 +170,42 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow { switchList(false); sudGameListAdapter.setList(data); + findViewById(R.id.layout_history_empty).setVisibility(GONE); + boolean isValue = false; + for (String str : historyList) { + if (!isValue) { + isValue = TextUtils.equals(value, str); + } + } + if (!isValue) { + + if (historyList.size() < 6) { + if (historyList.size() == 5) { + historyList.remove(0); + } + historyList.add(value); + SpUtil.setStringValue(SP_HISTORY, JSONArray.toJSONString(historyList)); + searchHistory.removeAllViews(); + + for (String str : historyList) { + addHistoryData(str); + } + } + + } + }else { + findViewById(R.id.layout_history_empty).setVisibility(VISIBLE); + listRoom.setVisibility(GONE); + history.setVisibility(GONE); } } @Override public void onError(String error) { - + findViewById(R.id.layout_history_empty).setVisibility(VISIBLE); + switchList(false); } }); } 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 e31bb2aa0..4d34a996d 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 @@ -2228,7 +2228,7 @@ public class LiveNetManager { @Override public void accept(ResponseModel createSudRoomModelResponseModel) throws Exception { if (callback != null) { - if (createSudRoomModelResponseModel.getData().getCode() == 200) { + if (createSudRoomModelResponseModel.getData().getCode() == 0) { callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo()); } else { callback.onError(createSudRoomModelResponseModel.getData().getMsg()); diff --git a/common/src/main/res/layout/dialog_home_search_sud_game.xml b/common/src/main/res/layout/dialog_home_search_sud_game.xml index 13a5785c7..9dbafb0a2 100644 --- a/common/src/main/res/layout/dialog_home_search_sud_game.xml +++ b/common/src/main/res/layout/dialog_home_search_sud_game.xml @@ -96,31 +96,31 @@ android:layout_height="wrap_content" android:layout_marginTop="10dp" /> - - - + + + @@ -89,44 +89,46 @@ + - + + + + - - - - + android:layout_gravity="center" + android:background="@drawable/bg_home_search_not" + android:gravity="center" + android:paddingStart="30dp" + android:paddingTop="12dp" + android:paddingEnd="30dp" + android:paddingBottom="12dp" + android:text="@string/interactive_game_search_room_have_been_found" + android:textColor="#CCFFFFFF" + android:textSize="14sp" /> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/mipmap-xxhdpi/icon_new_game.png b/common/src/main/res/mipmap-xxhdpi/icon_new_game.png new file mode 100644 index 0000000000000000000000000000000000000000..fddfd586f94f9e7136c4bd333575998f23cff34a GIT binary patch literal 1682 zcmV;D25tF?P)Px*Oi4sRR9HvNmKoBEdl;p0Y^%R7*#$ z-z5PofpB3nJSz1}{-zzFbtK%(gPX^oNjS8MFpV%@;Rvb9p8^FxK-jzL`^62O1~=;t z&AP$uV{qr3Yb~%jv>XC@ITUSmyGH{}Dxl&uiOf1$$&kMMnM_2YDqr9&`QIx5TNB9N z1p7bsG$3>|^iP4~DR3ecLPkN~CH{-SmTnM}4h>qtp%3B4Z^}sqOOYF)aX9>y3x}t< zoYy)AUit*?UWD8PZ;HA{A~Rw{UuNqB)-!%3*8xbcfUL=IWtZ!LVeWuZOh8Maa0?Ws zd1va+9Oy9*LdLE7!4s|)N^K@u83i4OLl^?5wp&3aPWt~O0 z+h!rwM2}Fbn*0+kf@V`*e|!(N$H4t!_0Z5UFu-6aSuxaM6!cpPC+%=@neW2eb~yA} z47X0gukWaRZHB=siSVEVf?7cC2k`e1<-CZ^(69|0`3P?RVLrE70iPqfJ!mh;>wYW$ zgi8ucUJCS@50|z<_EhzvFgHL(*cl<$FG+zrRTYpKRt`~#KMV%zJNhXDyUl_QV@gaIf?34(<*j(!`^iIG-U%|NV+{I)z!Kpi~g z^2JyfyhgnwZ>eI)QI|?`z_=Y&*BWYeO|4#jfOrcYR{!ja6HlFwBF0%g??)7 z;3OzLP!KD808?Pd^Fo zl_C406rjcQ#u{)C5vj&hUE2Qo8wzzQ=qtnaA99TkN!BHZHog8?s>#^xJ|B4--AR(@ z1JgZ9p1uGpO{|%S7U{v#|0}G#)u4Tp9*A;`;+`Y;B3cpc-n%cfaWW2LB)x}`HCqi`^-PcocW2z(+K5!RQ-^W-ffkV+` zHkgB-KlQ1<