游戏修改,粉丝团提示修改
This commit is contained in:
parent
d541a4d506
commit
69c0d5f28a
@ -104,6 +104,20 @@ public class CreateSudGamePopup extends BottomPopupView {
|
|||||||
public void onViewClicks() {
|
public void onViewClicks() {
|
||||||
String sill = gameSill.getText().toString();
|
String sill = gameSill.getText().toString();
|
||||||
String name = roomName.getText().toString();
|
String name = roomName.getText().toString();
|
||||||
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
|
if (name.length() > 10) {
|
||||||
|
ToastUtil.show("房间名太长");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() != Locale.SIMPLIFIED_CHINESE) {
|
||||||
|
if (name.length() > 15) {
|
||||||
|
ToastUtil.show("The room name is too long");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if (TextUtils.isEmpty(name)) {
|
if (TextUtils.isEmpty(name)) {
|
||||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||||
ToastUtil.show("房间名不能为空");
|
ToastUtil.show("房间名不能为空");
|
||||||
|
@ -77,22 +77,9 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
|||||||
findViewById(R.id.layout_history_empty).setVisibility(GONE);
|
findViewById(R.id.layout_history_empty).setVisibility(GONE);
|
||||||
searchHistory = findViewById(R.id.search_history);
|
searchHistory = findViewById(R.id.search_history);
|
||||||
searchHistory.removeAllViews();
|
searchHistory.removeAllViews();
|
||||||
// GridLayoutManager manager = (GridLayoutManager) listHistory.getLayoutManager();
|
|
||||||
// if (manager != null) {
|
|
||||||
// manager.setReverseLayout(true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// historyListAdapter = new SudGameSearchHistoryListAdapter(mContext, isHome);
|
|
||||||
sudGameListAdapter = new SudHomeGameListAdapter(mContext, isHome);
|
sudGameListAdapter = new SudHomeGameListAdapter(mContext, isHome);
|
||||||
// historyListAdapter.setOnItemClickListener(new OnItemClickListener<String>() {
|
|
||||||
// @Override
|
|
||||||
// public void onItemClick(String bean, int position) {
|
|
||||||
// editSearch.setText(bean);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
listRoom.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
listRoom.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
|
||||||
listRoom.setAdapter(sudGameListAdapter);
|
listRoom.setAdapter(sudGameListAdapter);
|
||||||
// listHistory.setAdapter(historyListAdapter);
|
|
||||||
initHistoryData();
|
initHistoryData();
|
||||||
switchList(true);
|
switchList(true);
|
||||||
|
|
||||||
@ -107,6 +94,7 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
|||||||
String value = s.toString();
|
String value = s.toString();
|
||||||
if (!StringUtil.isEmpty(value)) {
|
if (!StringUtil.isEmpty(value)) {
|
||||||
search(value);
|
search(value);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
switchList(true);
|
switchList(true);
|
||||||
}
|
}
|
||||||
@ -127,18 +115,10 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
private List<String> historyList;
|
private List<String> historyList;
|
||||||
|
|
||||||
private void initHistoryData() {
|
private void addHistoryData(String str) {
|
||||||
String value = SpUtil.getStringValue(SP_HISTORY);
|
|
||||||
historyList = new ArrayList<>();
|
|
||||||
if (!StringUtil.isEmpty(value)) {
|
|
||||||
historyList = JSONArray.parseArray(value, String.class);
|
|
||||||
}
|
|
||||||
// historyListAdapter.setList(historyList);
|
|
||||||
|
|
||||||
LinearLayout.LayoutParams layoutParams =
|
LinearLayout.LayoutParams layoutParams =
|
||||||
new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
layoutParams.setMargins(15, 10, 15, 7);
|
layoutParams.setMargins(15, 10, 15, 7);
|
||||||
for (String str : historyList) {
|
|
||||||
TextView chip = new TextView(mContext);
|
TextView chip = new TextView(mContext);
|
||||||
chip.setText(str);
|
chip.setText(str);
|
||||||
chip.setMaxEms(10);
|
chip.setMaxEms(10);
|
||||||
@ -164,16 +144,20 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
private void initHistoryData() {
|
||||||
|
String value = SpUtil.getStringValue(SP_HISTORY);
|
||||||
|
historyList = new ArrayList<>();
|
||||||
|
if (!StringUtil.isEmpty(value)) {
|
||||||
|
historyList = JSONArray.parseArray(value, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (String str : historyList) {
|
||||||
|
addHistoryData(str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void search(String value) {
|
private void search(String value) {
|
||||||
LiveNetManager.get(mContext)
|
|
||||||
.searchRoomList("0", "0,0", "0", value, 0, new HttpCallback<List<SudRoomListModel>>() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(List<SudRoomListModel> data) {
|
|
||||||
if (data.size() > 0) {
|
|
||||||
switchList(false);
|
|
||||||
sudGameListAdapter.setList(data);
|
|
||||||
boolean isValue = false;
|
boolean isValue = false;
|
||||||
for (String str : historyList) {
|
for (String str : historyList) {
|
||||||
if (!isValue) {
|
if (!isValue) {
|
||||||
@ -184,7 +168,16 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
|||||||
if (!isValue) {
|
if (!isValue) {
|
||||||
historyList.add(value);
|
historyList.add(value);
|
||||||
SpUtil.setStringValue(SP_HISTORY, JSONArray.toJSONString(historyList));
|
SpUtil.setStringValue(SP_HISTORY, JSONArray.toJSONString(historyList));
|
||||||
|
addHistoryData(value);
|
||||||
}
|
}
|
||||||
|
LiveNetManager.get(mContext)
|
||||||
|
.searchRoomList("0", "0,0", "0", value, 0, new HttpCallback<List<SudRoomListModel>>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(List<SudRoomListModel> data) {
|
||||||
|
if (data.size() > 0) {
|
||||||
|
switchList(false);
|
||||||
|
sudGameListAdapter.setList(data);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2228,7 +2228,12 @@ public class LiveNetManager {
|
|||||||
@Override
|
@Override
|
||||||
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
|
public void accept(ResponseModel<CreateSudRoomModel> createSudRoomModelResponseModel) throws Exception {
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
|
if (createSudRoomModelResponseModel.getData().getCode() == 200) {
|
||||||
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
callback.onSuccess(createSudRoomModelResponseModel.getData().getInfo());
|
||||||
|
} else {
|
||||||
|
callback.onError(createSudRoomModelResponseModel.getData().getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new Consumer<Throwable>() {
|
}, new Consumer<Throwable>() {
|
||||||
|
@ -48,7 +48,9 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/room_name"
|
android:id="@+id/room_name"
|
||||||
android:layout_width="wrap_content"
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:layout_width="150dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/interactive_game_create_room_name"
|
android:text="@string/interactive_game_create_room_name"
|
||||||
|
@ -48,7 +48,9 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/room_name"
|
android:id="@+id/room_name"
|
||||||
android:layout_width="wrap_content"
|
android:ellipsize="end"
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:singleLine="true"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/interactive_game_create_room_name"
|
android:text="@string/interactive_game_create_room_name"
|
||||||
|
Loading…
Reference in New Issue
Block a user