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 000000000..fddfd586f Binary files /dev/null and b/common/src/main/res/mipmap-xxhdpi/icon_new_game.png differ