小遊戲修改
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class HideShowEvent extends BaseModel {
|
||||
private boolean isClose = false;
|
||||
|
||||
public boolean isClose() {
|
||||
return isClose;
|
||||
}
|
||||
|
||||
public HideShowEvent setClose(boolean close) {
|
||||
isClose = close;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.yunbao.common.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class ShowHideEvent extends BaseModel {
|
||||
|
||||
}
|
||||
@@ -61,6 +61,14 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
return !TextUtils.isEmpty(getString("RedPoint")) && !TextUtils.equals(getString("RedPoint"), "1");
|
||||
}
|
||||
|
||||
public void setSudGameMin() {
|
||||
put("SudGameMin", "1");
|
||||
}
|
||||
|
||||
public boolean getSudGameMin() {
|
||||
return !TextUtils.isEmpty(getString("SudGameMin")) && !TextUtils.equals(getString("SudGameMin"), "1");
|
||||
}
|
||||
|
||||
public void setSudGame(String sudGameJson) {
|
||||
put(KEY_GAME, sudGameJson);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,15 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.R;
|
||||
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.ShowHideEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
@@ -92,6 +95,38 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
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 ShowHideEvent());
|
||||
} else {
|
||||
new XPopup.Builder(getContext())
|
||||
.asCustom(new HintCustomPopup(getContext(),
|
||||
getContext().getString(R.string.dialog_tip),
|
||||
getContext().getString(R.string.currently_in_the_game))
|
||||
.setLiveOpenOk(getContext().getString(R.string.sud_in_game_minimize))
|
||||
.setLiveOpenCancel(getContext().getString(R.string.cancel))
|
||||
.setCallBack(new HintCustomPopup.HintCustomCallBack() {
|
||||
@Override
|
||||
public void onSure() {
|
||||
IMLoginManager.get(getContext()).setSudGameMin();
|
||||
dialog.hide();
|
||||
Bus.get().post(new ShowHideEvent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
|
||||
}
|
||||
})).show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
|
||||
@Override
|
||||
public void onChanged(View view) {
|
||||
@@ -126,6 +161,16 @@ public class LiveSudGamePopup extends BottomPopupView {
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onHideShow(HideShowEvent event) {
|
||||
if (event.isClose()){
|
||||
dialog.dismiss();
|
||||
}else {
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||
if (event.getResults().size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user