游戏列表跳转游戏

This commit is contained in:
18401019693 2023-09-25 17:56:52 +08:00
parent ce48a7dcf0
commit 869ca75464
3 changed files with 38 additions and 27 deletions

View File

@ -92,6 +92,14 @@ public class SudGameListPopup extends BottomPopupView {
sudGameListAdapter = new SudGameListAdapter(getContext());
mRefreshView.setLoadMoreEnable(true);
mRefreshView.setRecyclerViewAdapter(sudGameListAdapter);
for (CustomSidebarChildModel model : customSidebarChildModels) {
if (TextUtils.equals(String.valueOf(interactionID), model.getSrc())) {
gameTitle.setText(model.getTitle().substring(0, 2));
id = model.getId();
}
}
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SudRoomListModel>() {
@Override
public RefreshAdapter<SudRoomListModel> getAdapter() {
@ -140,12 +148,7 @@ public class SudGameListPopup extends BottomPopupView {
}
});
mRefreshView.initData();
for (CustomSidebarChildModel model : customSidebarChildModels) {
if (TextUtils.equals(String.valueOf(interactionID), model.getSrc())) {
gameTitle.setText(model.getTitle().substring(0, 2));
id = model.getId();
}
}
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.interactive_game_room_game), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -215,8 +218,14 @@ public class SudGameListPopup extends BottomPopupView {
}
@Override
protected void onDismiss() {
public void dismiss() {
Bus.getOff(this);
super.dismiss();
}
@Override
protected void onDismiss() {
super.onDismiss();
}
@ -234,7 +243,7 @@ public class SudGameListPopup extends BottomPopupView {
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListEvent(SudGameListSillEvent event) {
public void onSudGameListSillEvent(SudGameListSillEvent event) {
mSill = event.getSill();
mSillName = event.getSillName();
if (TextUtils.equals("0,0", mSill)) {
@ -252,7 +261,7 @@ public class SudGameListPopup extends BottomPopupView {
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListEvent(RoomHolderTypeEvent event) {
public void onRoomHolderTypeEvent(RoomHolderTypeEvent event) {
roomHolderType = event.getRoomHolderType();
roomHolderTypeName = event.getRoomHolderTypeName();
houseOwnerTitle.setText(roomHolderTypeName);
@ -263,22 +272,7 @@ public class SudGameListPopup extends BottomPopupView {
mRefreshView.initData();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListEvent(SudRoomListModelEvent event) {
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
createSudRoomModel.setSudGameId(event.getModel().getSudGameId());
createSudRoomModel.setSudGameRoomId(event.getModel().getSudGameRoomId());
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();
dialog.dismiss();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onSudGameListDissMissEvent(SudGameListDissMissEvent event) {

View File

@ -8,10 +8,13 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.lxj.xpopup.XPopup;
import com.makeramen.roundedimageview.RoundedImageView;
import com.yunbao.common.R;
import com.yunbao.common.bean.CreateSudRoomModel;
import com.yunbao.common.bean.SudRoomListModel;
import com.yunbao.common.bean.playerObject;
import com.yunbao.common.event.SudGameListDissMissEvent;
import com.yunbao.common.event.SudRoomListModelEvent;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.utils.Bus;
@ -86,10 +89,23 @@ public class SudGameListViewHolder extends RecyclerView.ViewHolder {
break;
}
}
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
ViewClicksAntiShake.clicksAntiShake(itemView.findViewById(R.id.layout), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
Bus.get().post(new SudRoomListModelEvent().setModel(model));
CreateSudRoomModel createSudRoomModel = new CreateSudRoomModel();
createSudRoomModel.setSudGameId(model.getSudGameId());
createSudRoomModel.setSudGameRoomId(model.getSudGameRoomId());
createSudRoomModel.setAvatar(model.getAvatar());
createSudRoomModel.setRoomName(model.getRoomName());
createSudRoomModel.setSudGameName(model.getSudGameName());
new XPopup.Builder(itemView.getContext())
.enableDrag(false)
.dismissOnTouchOutside(false)
.dismissOnBackPressed(false)
.asCustom(new LiveSudGamePopup(itemView.getContext(), createSudRoomModel))
.show();
Bus.get().post(new SudGameListDissMissEvent());
}
});
}

View File

@ -4,6 +4,7 @@
android:layout_width="match_parent"
android:layout_height="88dp"
android:layout_marginStart="15dp"
android:id="@+id/layout"
android:layout_marginTop="14dp"
android:layout_marginEnd="15dp"
android:background="@mipmap/background_sud_game_list"