遊戲bug修復
This commit is contained in:
@@ -47,10 +47,14 @@ public class CreateSudRoomModel extends BaseModel {
|
||||
}
|
||||
|
||||
public long getLongSudGameId() {
|
||||
if (TextUtils.isEmpty(sudGameId)) {
|
||||
try {
|
||||
if (TextUtils.isEmpty(sudGameId)) {
|
||||
return 0;
|
||||
} else {
|
||||
return Long.parseLong(sudGameId);
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
return 0;
|
||||
} else {
|
||||
return Long.parseLong(sudGameId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.yunbao.common.activity.SudGameActivity;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.event.CreateSudGameEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
@@ -205,12 +206,8 @@ public class CreateSudGamePopup extends BottomPopupView {
|
||||
intent.putExtra("CreateSudRoom", new Gson().toJson(data));
|
||||
getContext().startActivity(intent);
|
||||
} else {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.dismissOnBackPressed(false)
|
||||
.asCustom(new LiveSudGamePopup(getContext(), data))
|
||||
.show();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
|
||||
dialog.dismiss();
|
||||
Bus.get().post(new SudGameListDissMissEvent());
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.RoomHolderTypeEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.event.SudGameListEvent;
|
||||
@@ -161,12 +162,8 @@ public class SudGameListPopup extends BottomPopupView {
|
||||
@Override
|
||||
public void onSuccess(CreateSudRoomModel data) {
|
||||
if (data != null) {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.dismissOnBackPressed(false)
|
||||
.asCustom(new LiveSudGamePopup(getContext(), data))
|
||||
.show();
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(data));
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
if (IMLoginManager.get(getContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
|
||||
@@ -22,9 +22,11 @@ import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.SudHomeGameListAdapter;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudRoomListModelEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.views.FlowLayout;
|
||||
@@ -234,12 +236,8 @@ public class SudGameSearchDialogPopup extends AbsDialogPopupWindow {
|
||||
createSudRoomModel.setAvatar(event.getModel().getAvatar());
|
||||
createSudRoomModel.setRoomName(event.getModel().getRoomName());
|
||||
createSudRoomModel.setSudGameName(event.getModel().getSudGameName());
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.dismissOnBackPressed(false)
|
||||
.asCustom(new LiveSudGamePopup(getContext(), createSudRoomModel))
|
||||
.show();
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
|
||||
public class LiveSudGamePopupShowOrHideEvent {
|
||||
private int type = 0;//0展示,1hide隱藏,2dismiss關閉
|
||||
private CreateSudRoomModel createSudRoomModel;
|
||||
|
||||
public CreateSudRoomModel getCreateSudRoomModel() {
|
||||
return createSudRoomModel;
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setCreateSudRoomModel(CreateSudRoomModel createSudRoomModel) {
|
||||
this.createSudRoomModel = createSudRoomModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public LiveSudGamePopupShowOrHideEvent setType(int type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.HideShowEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.ShowHideEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
@@ -92,14 +93,14 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
gameViewModel.onDestroy();
|
||||
dialog.dismiss();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(2));
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.min_game), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (IMLoginManager.get(getContext()).getSudGameMin()) {
|
||||
dialog.hide();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(1));
|
||||
Bus.get().post(new ShowHideEvent());
|
||||
} else {
|
||||
IMLoginManager.get(getContext()).setSudGameMin();
|
||||
@@ -112,8 +113,7 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
|
||||
dialog.hide();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(1));
|
||||
Bus.get().post(new ShowHideEvent());
|
||||
}
|
||||
|
||||
@@ -162,15 +162,16 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onHideShow(HideShowEvent event) {
|
||||
if (event.isClose()) {
|
||||
dialog.dismiss();
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(2));
|
||||
} else {
|
||||
if (event.isHide()) {
|
||||
findViewById(R.id.min_game).setVisibility(GONE);
|
||||
}
|
||||
dialog.show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.SudRoomListModel;
|
||||
import com.yunbao.common.event.LiveOpenSudRoomEvent;
|
||||
import com.yunbao.common.event.LiveSudGamePopupShowOrHideEvent;
|
||||
import com.yunbao.common.event.SudGameListDissMissEvent;
|
||||
import com.yunbao.common.event.SudGameListRefreshEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
@@ -160,13 +161,8 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
|
||||
}
|
||||
|
||||
} else {
|
||||
new XPopup.Builder(itemView.getContext())
|
||||
.enableDrag(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.dismissOnBackPressed(false)
|
||||
.asCustom(new LiveSudGamePopup(itemView.getContext(), createSudRoomModel))
|
||||
.show();
|
||||
|
||||
Bus.get().post(new LiveSudGamePopupShowOrHideEvent().setType(0).setCreateSudRoomModel(createSudRoomModel));
|
||||
Bus.get().post(new SudGameListDissMissEvent());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user