小遊戲修改

This commit is contained in:
18401019693
2023-10-24 15:46:47 +08:00
parent 993b09b853
commit 926de0463c
18 changed files with 279 additions and 46 deletions

View File

@@ -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;
}
}

View File

@@ -0,0 +1,7 @@
package com.yunbao.common.event;
import com.yunbao.common.bean.BaseModel;
public class ShowHideEvent extends BaseModel {
}

View File

@@ -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);
}

View File

@@ -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) {

View File

@@ -28,11 +28,12 @@
android:layout_weight="1" />
<ImageView
android:visibility="gone"
android:id="@+id/min_game"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="16dp"
android:src="@mipmap/icon_interactive_game_create_room_seats" />
android:src="@mipmap/icon_min_game"
android:visibility="visible" />
<TextView
android:id="@+id/exit"
@@ -66,9 +67,9 @@
android:id="@+id/avatar"
android:layout_width="35dp"
android:layout_height="35dp"
android:visibility="gone"
android:layout_marginStart="6dp"
android:scaleType="centerCrop"
android:visibility="gone"
app:riv_oval="true" />
<LinearLayout

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -1363,5 +1363,9 @@ Limited ride And limited avatar frame</string>
<string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string>
<string name="choose_a_prank_gift_hint2">Input quantity</string>
<string name="sud_in_game">IN GAME</string>
<string name="currently_in_the_game">You are currently in the game, please return in a timely manner.\\nFailure to return for a long time will be considered a surrender.</string>
<string name="the_live_room">Exiting the live room will synchronize with exiting the game room.\\nDo you want to continue</string>
<string name="sud_in_game_minimize">minimize</string>
</resources>

View File

@@ -1360,4 +1360,8 @@
<string name="choose_a_prank_gift">選擇整蠱禮物</string>
<string name="choose_a_prank_gift_hint">輸入整蠱內容...</string>
<string name="choose_a_prank_gift_hint2">输入数量</string>
<string name="sud_in_game">遊戲中</string>
<string name="currently_in_the_game">您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
</resources>

View File

@@ -1359,4 +1359,8 @@
<string name="choose_a_prank_gift">選擇整蠱禮物</string>
<string name="choose_a_prank_gift_hint">輸入整蠱內容...</string>
<string name="choose_a_prank_gift_hint2">输入数量</string>
<string name="sud_in_game">遊戲中</string>
<string name="currently_in_the_game">您正在遊戲中,請及時返回 長時間未返回將會視爲認輸哦</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間 是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
</resources>

View File

@@ -1359,5 +1359,9 @@
<string name="choose_a_prank_gift">選擇整蠱禮物</string>
<string name="choose_a_prank_gift_hint">輸入整蠱內容...</string>
<string name="choose_a_prank_gift_hint2">输入数量</string>
<string name="sud_in_game">遊戲中</string>
<string name="currently_in_the_game">您正在遊戲中,請及時返回\n長時間未返回將會視爲認輸哦</string>
<string name="the_live_room">退出直播間將會同步退出遊戲房間\n是否继续</string>
<string name="sud_in_game_minimize">最小化</string>
</resources>

View File

@@ -1366,4 +1366,8 @@ Limited ride And limited avatar frame</string>
<string name="choose_a_prank_gift">Choose a prank gift</string>
<string name="choose_a_prank_gift_hint">Enter the prank content...</string>
<string name="choose_a_prank_gift_hint2">Input quantity</string>
<string name="currently_in_the_game">You are currently in the game, please return in a timely manner.\\nFailure to return for a long time will be considered a surrender.</string>
<string name="the_live_room">Exiting the live room will synchronize with exiting the game room.\\nDo you want to continue</string>
<string name="sud_in_game">IN GAME</string>
<string name="sud_in_game_minimize">minimize</string>
</resources>