梦幻许愿池逻辑修改
This commit is contained in:
@@ -128,7 +128,6 @@ import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment;
|
|||||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2;
|
import com.yizhuan.xchat_android_core.im.custom.bean.RoomFollowOwnerAttachment2;
|
||||||
import com.yizhuan.xchat_android_core.im.game.ImGameInfo;
|
import com.yizhuan.xchat_android_core.im.game.ImGameInfo;
|
||||||
import com.yizhuan.xchat_android_core.im.game.ImGameMode;
|
import com.yizhuan.xchat_android_core.im.game.ImGameMode;
|
||||||
import com.yizhuan.xchat_android_core.initial.bean.BoxInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.magic.bean.MagicInfo;
|
import com.yizhuan.xchat_android_core.magic.bean.MagicInfo;
|
||||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||||
@@ -1485,13 +1484,11 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
break;
|
break;
|
||||||
case R.id.iv_treasure_box:
|
case R.id.iv_treasure_box:
|
||||||
case R.id.iv_treasure_box_cp:
|
case R.id.iv_treasure_box_cp:
|
||||||
GoldBoxHelper.isShowDiamondBox().subscribe(hide -> {
|
// if (!GoldBoxHelper.isShowDiamondBox()) {
|
||||||
if (hide != null && !hide) {
|
// TreasureBoxActivity.start(getActivity());
|
||||||
TreasureBoxActivity.start(getActivity());
|
// } else {
|
||||||
} else {
|
onClickBox();
|
||||||
onClickBox();
|
// }
|
||||||
}
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case R.id.iv_dragon_start_button:
|
case R.id.iv_dragon_start_button:
|
||||||
if (AvRoomDataManager.get().haveStartDragon) {
|
if (AvRoomDataManager.get().haveStartDragon) {
|
||||||
@@ -1539,7 +1536,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
*/
|
*/
|
||||||
public void onClickBox() {
|
public void onClickBox() {
|
||||||
if (getFragmentManager() != null) {
|
if (getFragmentManager() != null) {
|
||||||
ChooseTreasureBoxDialogFragment chooseTreasureBoxDialogFragment = new ChooseTreasureBoxDialogFragment();
|
ChooseTreasureBoxDialogFragment chooseTreasureBoxDialogFragment = new ChooseTreasureBoxDialogFragment(GoldBoxHelper.getBoxOpenTime());
|
||||||
chooseTreasureBoxDialogFragment.setOnTreasureBoxChooseListener(type -> {
|
chooseTreasureBoxDialogFragment.setOnTreasureBoxChooseListener(type -> {
|
||||||
if (type == 0) {// 幸运许愿池(默认)
|
if (type == 0) {// 幸运许愿池(默认)
|
||||||
TreasureBoxActivity.start(getActivity());
|
TreasureBoxActivity.start(getActivity());
|
||||||
@@ -2588,18 +2585,17 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// boolean isOpenBoxSwitch = AvRoomDataManager.get().mCurrentRoomInfo.getBoxSwitchVo().isOpenBoxSwitch();
|
|
||||||
// boolean isDiamondBoxSwitch = AvRoomDataManager.get().mCurrentRoomInfo.getBoxSwitchVo().isDiamondBoxSwitch();
|
|
||||||
// String getDiamondBoxOpenTime = AvRoomDataManager.get().mCurrentRoomInfo.getBoxSwitchVo().getDiamondBoxOpenTime();
|
|
||||||
// String getOpenBoxIcon = AvRoomDataManager.get().mCurrentRoomInfo.getBoxSwitchVo().getOpenBoxIcon();
|
|
||||||
// LogUtils.e("isOpenBoxSwitch:"+isOpenBoxSwitch);
|
|
||||||
// LogUtils.e("isDiamondBoxSwitch:"+isDiamondBoxSwitch);
|
|
||||||
// LogUtils.e("getDiamondBoxOpenTime:"+getDiamondBoxOpenTime);
|
|
||||||
// LogUtils.e("getOpenBoxIcon:"+getOpenBoxIcon);
|
|
||||||
|
|
||||||
BoxInfo boxSwitchVo = AvRoomDataManager.get().mCurrentRoomInfo.getBoxSwitchVo();
|
|
||||||
LogUtils.e("isOpenBoxSwitch:"+boxSwitchVo);
|
|
||||||
|
|
||||||
|
if (AvRoomDataManager.get().mBoxSwitchVo != null){
|
||||||
|
boolean isOpenBoxSwitch = AvRoomDataManager.get().mBoxSwitchVo.isOpenBoxSwitch();
|
||||||
|
boolean isDiamondBoxSwitch = AvRoomDataManager.get().mBoxSwitchVo.isDiamondBoxSwitch();
|
||||||
|
String getDiamondBoxOpenTime = AvRoomDataManager.get().mBoxSwitchVo.getDiamondBoxOpenTime();
|
||||||
|
String getOpenBoxIcon = AvRoomDataManager.get().mBoxSwitchVo.getOpenBoxIcon();
|
||||||
|
LogUtils.e("isOpenBoxSwitch:"+isOpenBoxSwitch);
|
||||||
|
LogUtils.e("isDiamondBoxSwitch:"+isDiamondBoxSwitch);
|
||||||
|
LogUtils.e("getDiamondBoxOpenTime:"+getDiamondBoxOpenTime);
|
||||||
|
LogUtils.e("getOpenBoxIcon:"+getOpenBoxIcon);
|
||||||
|
}
|
||||||
GoldBoxHelper.isHideBox().subscribe(
|
GoldBoxHelper.isHideBox().subscribe(
|
||||||
hide -> {
|
hide -> {
|
||||||
if (hide != null && !hide) {
|
if (hide != null && !hide) {
|
||||||
@@ -2610,12 +2606,12 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
|||||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||||
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
GoldBoxHelper.getBoxIcon().subscribe(icon -> {
|
|
||||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||||
.load(icon)
|
.load(GoldBoxHelper.getBoxIcon())
|
||||||
.error(R.drawable.icon_room_treasure_box)
|
.error(R.drawable.icon_room_treasure_box)
|
||||||
.into(gameBinding.ivTreasureBox);
|
.into(gameBinding.ivTreasureBox);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||||
|
@@ -9,6 +9,7 @@ import android.text.TextUtils;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
|
|
||||||
|
import com.coorchice.library.utils.LogUtils;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -66,6 +67,7 @@ import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
|
|||||||
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
import com.yizhuan.xchat_android_library.rxbus.RxBus;
|
||||||
import com.yizhuan.xchat_android_library.threadmgr.ThreadPoolManager;
|
import com.yizhuan.xchat_android_library.threadmgr.ThreadPoolManager;
|
||||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||||
|
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
@@ -133,6 +135,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
|||||||
}
|
}
|
||||||
//我们自己服务端信息
|
//我们自己服务端信息
|
||||||
AvRoomDataManager.get().mCurrentRoomInfo = roomInfo;
|
AvRoomDataManager.get().mCurrentRoomInfo = roomInfo;
|
||||||
|
AvRoomDataManager.get().mBoxSwitchVo = roomInfo.boxSwitchVo;
|
||||||
|
|
||||||
// 第一次进房,离开模式下更新本地房主位ui
|
// 第一次进房,离开模式下更新本地房主位ui
|
||||||
AvRoomDataManager.get().nick = roomInfo.getNick();
|
AvRoomDataManager.get().nick = roomInfo.getNick();
|
||||||
|
5
app/src/main/res/drawable/selector_choose_box_bg.xml
Normal file
5
app/src/main/res/drawable/selector_choose_box_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@drawable/choose_box_bg_disable" android:state_enabled="false" />
|
||||||
|
<item android:drawable="@drawable/choose_box_bg" android:state_enabled="true" />
|
||||||
|
</selector>
|
@@ -9,6 +9,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -16,6 +17,7 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
|
|
||||||
|
import com.coorchice.library.utils.LogUtils;
|
||||||
import com.yizhuan.erban.R;
|
import com.yizhuan.erban.R;
|
||||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
import com.yizhuan.erban.ui.webview.DialogWebViewActivity;
|
||||||
import com.yizhuan.treasure_box.bean.BoxOpenStatusInfo;
|
import com.yizhuan.treasure_box.bean.BoxOpenStatusInfo;
|
||||||
@@ -24,6 +26,8 @@ import com.yizhuan.xchat_android_core.UriProvider;
|
|||||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||||
|
import com.yizhuan.xchat_android_library.utils.LogUtil;
|
||||||
|
import com.yizhuan.xchat_android_library.utils.TimeUtils;
|
||||||
|
|
||||||
import io.reactivex.SingleObserver;
|
import io.reactivex.SingleObserver;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
@@ -34,6 +38,16 @@ public class ChooseTreasureBoxDialogFragment extends DialogFragment implements V
|
|||||||
|
|
||||||
private OnTreasureBoxChooseListener onTreasureBoxChooseListener;
|
private OnTreasureBoxChooseListener onTreasureBoxChooseListener;
|
||||||
|
|
||||||
|
private TextView tvOpenTime;
|
||||||
|
|
||||||
|
private String mOpenTime;
|
||||||
|
|
||||||
|
private TextView mTvOpenHonour;
|
||||||
|
|
||||||
|
public ChooseTreasureBoxDialogFragment(String openTime) {
|
||||||
|
this.mOpenTime = openTime;
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
@@ -50,9 +64,25 @@ public class ChooseTreasureBoxDialogFragment extends DialogFragment implements V
|
|||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
clBoxNormal = view.findViewById(R.id.cl_box_normal);
|
clBoxNormal = view.findViewById(R.id.cl_box_normal);
|
||||||
clBoxHonour = view.findViewById(R.id.cl_box_honour);
|
clBoxHonour = view.findViewById(R.id.cl_box_honour);
|
||||||
|
tvOpenTime = view.findViewById(R.id.tv_open_time);
|
||||||
|
mTvOpenHonour = view.findViewById(R.id.tv_open_honour);
|
||||||
view.findViewById(R.id.iv_close).setOnClickListener(this);
|
view.findViewById(R.id.iv_close).setOnClickListener(this);
|
||||||
clBoxNormal.setOnClickListener(this);
|
clBoxNormal.setOnClickListener(this);
|
||||||
clBoxHonour.setOnClickListener(this);
|
clBoxHonour.setOnClickListener(this);
|
||||||
|
tvOpenTime.setText("限时 "+ mOpenTime);
|
||||||
|
int currentTime = TimeUtils.getTime24();
|
||||||
|
int startTime = Integer.parseInt(mOpenTime.substring(0,mOpenTime.indexOf("-")).replace(":",""));
|
||||||
|
int endTime = Integer.parseInt(mOpenTime.substring(mOpenTime.indexOf("-") + 1).replace(":",""));
|
||||||
|
LogUtils.e("startTime"+startTime);
|
||||||
|
LogUtils.e("endTime"+endTime);
|
||||||
|
LogUtils.e("当前小时"+TimeUtils.getTime24());
|
||||||
|
LogUtils.e("范围:"+TimeUtils.getTimeLimit(17,59,13,20));
|
||||||
|
// LogUtils.e("范围:"+TimeUtils.getTimeLimit());
|
||||||
|
if (TimeUtils.getTimeLimit(10,10,18,20)){
|
||||||
|
mTvOpenHonour.setEnabled(true);
|
||||||
|
}else {
|
||||||
|
mTvOpenHonour.setEnabled(false);
|
||||||
|
}
|
||||||
view.findViewById(R.id.ll_get_key).setOnClickListener(v -> DialogWebViewActivity.start(getContext(), UriProvider.getBoxKey()));
|
view.findViewById(R.id.ll_get_key).setOnClickListener(v -> DialogWebViewActivity.start(getContext(), UriProvider.getBoxKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ public class GoldBoxHelper {
|
|||||||
}
|
}
|
||||||
if (myInfo != null && levelVo != null) {
|
if (myInfo != null && levelVo != null) {
|
||||||
//1.审核模式 2.全局隐藏 3. 用户等级小于后台配置等级 都需要隐藏开箱子
|
//1.审核模式 2.全局隐藏 3. 用户等级小于后台配置等级 都需要隐藏开箱子
|
||||||
isHide = MarketVerifyModel.get().isMarketChecking() || !boxInfo.isOpenBoxSwitch()
|
isHide = MarketVerifyModel.get().isMarketChecking() || !AvRoomDataManager.get().mBoxSwitchVo.isOpenBoxSwitch()
|
||||||
|| levelVo.getExperLevelSeq() < boxInfo.getOpenBoxSwitchLevelNo() || AvRoomDataManager.get().isOpenPureMode();
|
|| levelVo.getExperLevelSeq() < boxInfo.getOpenBoxSwitchLevelNo() || AvRoomDataManager.get().isOpenPureMode();
|
||||||
}
|
}
|
||||||
return Single.just(isHide);
|
return Single.just(isHide);
|
||||||
@@ -52,11 +52,16 @@ public class GoldBoxHelper {
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public static Single<Boolean> isShowDiamondBox() {
|
public static boolean isShowDiamondBox() {
|
||||||
return InitialModel.get().getBoxInfo().flatMap(boxInfo -> Single.just(boxInfo.isDiamondBoxSwitch()));
|
return AvRoomDataManager.get().mBoxSwitchVo.isDiamondBoxSwitch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Single<String> getBoxIcon() {
|
public static String getBoxIcon() {
|
||||||
return InitialModel.get().getBoxInfo().flatMap(boxInfo -> Single.just(boxInfo.getOpenBoxIcon()));
|
return AvRoomDataManager.get().mBoxSwitchVo.getOpenBoxIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getBoxOpenTime(){
|
||||||
|
return AvRoomDataManager.get().mBoxSwitchVo.getDiamondBoxOpenTime();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@@ -114,15 +114,28 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_title_honour" />
|
app:layout_constraintTop_toBottomOf="@id/iv_title_honour" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_open_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#DDFFF8"
|
||||||
|
android:text="限时"
|
||||||
|
android:textSize="11dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_open_honour"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/iv_open_honour"
|
android:id="@+id/tv_open_honour"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
android:background="@drawable/choose_box_bg"
|
android:background="@drawable/selector_choose_box_bg"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:enabled="true"
|
||||||
android:text="立即开启"
|
android:text="立即开启"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
@@ -418,10 +418,7 @@ public class InitialModel extends BaseModel implements IInitialModel {
|
|||||||
|
|
||||||
private BoxInfo initBoxInfo(InitInfo info) {
|
private BoxInfo initBoxInfo(InitInfo info) {
|
||||||
BoxInfo boxInfo = new BoxInfo();
|
BoxInfo boxInfo = new BoxInfo();
|
||||||
boxInfo.setOpenBoxSwitch(info.isOpenBoxSwitch());
|
|
||||||
boxInfo.setOpenBoxSwitchLevelNo(info.getOpenBoxSwitchLevelNo());
|
boxInfo.setOpenBoxSwitchLevelNo(info.getOpenBoxSwitchLevelNo());
|
||||||
boxInfo.setDiamondBoxSwitch(info.isDiamondBoxSwitch());
|
|
||||||
boxInfo.setOpenBoxIcon(info.getOpenBoxIcon());
|
|
||||||
return boxInfo;
|
return boxInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,14 +9,6 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class BoxInfo {
|
public class BoxInfo {
|
||||||
/**宝箱开关*/
|
|
||||||
private boolean openBoxSwitch;
|
|
||||||
/**宝箱限制等级*/
|
/**宝箱限制等级*/
|
||||||
private int openBoxSwitchLevelNo;
|
private int openBoxSwitchLevelNo;
|
||||||
/**梦幻许愿池开关*/
|
|
||||||
private boolean diamondBoxSwitch;
|
|
||||||
/**许愿池图标*/
|
|
||||||
private String openBoxIcon;
|
|
||||||
/**梦幻许愿池开启时间*/
|
|
||||||
private String diamondBoxOpenTime;
|
|
||||||
}
|
}
|
||||||
|
@@ -22,6 +22,7 @@ import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
|||||||
import com.netease.nimlib.sdk.msg.constant.NotificationType;
|
import com.netease.nimlib.sdk.msg.constant.NotificationType;
|
||||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||||
|
import com.yizhuan.xchat_android_core.room.bean.BoxSwitchVo;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.bean.SimplePartyRoomInfo;
|
import com.yizhuan.xchat_android_core.room.bean.SimplePartyRoomInfo;
|
||||||
import com.yizhuan.xchat_android_core.room.game.GameModel;
|
import com.yizhuan.xchat_android_core.room.game.GameModel;
|
||||||
@@ -56,6 +57,8 @@ public final class AvRoomDataManager {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public RoomInfo mCurrentRoomInfo;
|
public RoomInfo mCurrentRoomInfo;
|
||||||
|
|
||||||
|
public BoxSwitchVo mBoxSwitchVo;
|
||||||
|
|
||||||
public EnterChatRoomResultData mEnterChatRoomResultData;
|
public EnterChatRoomResultData mEnterChatRoomResultData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -0,0 +1,92 @@
|
|||||||
|
package com.yizhuan.xchat_android_core.room.bean;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class BoxSwitchVo implements Parcelable, Serializable {
|
||||||
|
/**宝箱开关*/
|
||||||
|
private boolean openBoxSwitch;
|
||||||
|
/**梦幻许愿池开关*/
|
||||||
|
private boolean diamondBoxSwitch;
|
||||||
|
/**许愿池图标*/
|
||||||
|
private String openBoxIcon;
|
||||||
|
/**梦幻许愿池开启时间*/
|
||||||
|
private String diamondBoxOpenTime;
|
||||||
|
|
||||||
|
public boolean isOpenBoxSwitch() {
|
||||||
|
return openBoxSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenBoxSwitch(boolean openBoxSwitch) {
|
||||||
|
this.openBoxSwitch = openBoxSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDiamondBoxSwitch() {
|
||||||
|
return diamondBoxSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDiamondBoxSwitch(boolean diamondBoxSwitch) {
|
||||||
|
this.diamondBoxSwitch = diamondBoxSwitch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenBoxIcon() {
|
||||||
|
return openBoxIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenBoxIcon(String openBoxIcon) {
|
||||||
|
this.openBoxIcon = openBoxIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDiamondBoxOpenTime() {
|
||||||
|
return diamondBoxOpenTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDiamondBoxOpenTime(String diamondBoxOpenTime) {
|
||||||
|
this.diamondBoxOpenTime = diamondBoxOpenTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BoxSwitchVo(Parcel in) {
|
||||||
|
openBoxSwitch = in.readByte() != 0;
|
||||||
|
diamondBoxSwitch = in.readByte() != 0;
|
||||||
|
openBoxIcon = in.readString();
|
||||||
|
diamondBoxOpenTime = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeByte((byte) (openBoxSwitch ? 1 : 0));
|
||||||
|
dest.writeByte((byte) (diamondBoxSwitch ? 1 : 0));
|
||||||
|
dest.writeString(openBoxIcon);
|
||||||
|
dest.writeString(diamondBoxOpenTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<BoxSwitchVo> CREATOR = new Creator<BoxSwitchVo>() {
|
||||||
|
@Override
|
||||||
|
public BoxSwitchVo createFromParcel(Parcel in) {
|
||||||
|
return new BoxSwitchVo(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BoxSwitchVo[] newArray(int size) {
|
||||||
|
return new BoxSwitchVo[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "BoxInfo{" +
|
||||||
|
"openBoxSwitch=" + openBoxSwitch +
|
||||||
|
", diamondBoxSwitch=" + diamondBoxSwitch +
|
||||||
|
", openBoxIcon='" + openBoxIcon + '\'' +
|
||||||
|
", diamondBoxOpenTime='" + diamondBoxOpenTime + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@@ -4,7 +4,6 @@ package com.yizhuan.xchat_android_core.room.bean;
|
|||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.yizhuan.xchat_android_core.initial.bean.BoxInfo;
|
|
||||||
import com.yizhuan.xchat_android_core.room.game.GameInfo;
|
import com.yizhuan.xchat_android_core.room.game.GameInfo;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -91,7 +90,7 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
|
|
||||||
public GameInfo roomGame;
|
public GameInfo roomGame;
|
||||||
|
|
||||||
public BoxInfo boxSwitchVo;
|
public BoxSwitchVo boxSwitchVo;
|
||||||
|
|
||||||
private String singingMusicName;
|
private String singingMusicName;
|
||||||
// 限制类型
|
// 限制类型
|
||||||
@@ -155,13 +154,11 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
// */
|
// */
|
||||||
// private String badge;
|
// private String badge;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "RoomInfo{" +
|
return "RoomInfo{" +
|
||||||
"uid=" + uid +
|
"uid=" + uid +
|
||||||
"limitType=" + limitType +
|
|
||||||
"isOpengame=" + isOpenGame +
|
|
||||||
"roomGame=" + roomGame +
|
|
||||||
", officeUser=" + officeUser +
|
", officeUser=" + officeUser +
|
||||||
", roomId=" + roomId +
|
", roomId=" + roomId +
|
||||||
", title='" + title + '\'' +
|
", title='" + title + '\'' +
|
||||||
@@ -186,7 +183,11 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
", background=" + background +
|
", background=" + background +
|
||||||
", hasKTVPriv=" + hasKTVPriv +
|
", hasKTVPriv=" + hasKTVPriv +
|
||||||
", isOpenKTV=" + isOpenKTV +
|
", isOpenKTV=" + isOpenKTV +
|
||||||
|
", isOpenGame=" + isOpenGame +
|
||||||
|
", roomGame=" + roomGame +
|
||||||
|
", boxSwitchVo=" + boxSwitchVo +
|
||||||
", singingMusicName='" + singingMusicName + '\'' +
|
", singingMusicName='" + singingMusicName + '\'' +
|
||||||
|
", limitType='" + limitType + '\'' +
|
||||||
", roomModeType=" + roomModeType +
|
", roomModeType=" + roomModeType +
|
||||||
", isPermitRoom=" + isPermitRoom +
|
", isPermitRoom=" + isPermitRoom +
|
||||||
", showGiftValue=" + showGiftValue +
|
", showGiftValue=" + showGiftValue +
|
||||||
@@ -229,6 +230,7 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
gender = in.readInt();
|
gender = in.readInt();
|
||||||
hideFlag = in.readInt();
|
hideFlag = in.readInt();
|
||||||
closeScreenFlag = in.readInt();
|
closeScreenFlag = in.readInt();
|
||||||
|
boxSwitchVo = in.readParcelable(BoxSwitchVo.class.getClassLoader());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -265,6 +267,7 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
dest.writeString(nick);
|
dest.writeString(nick);
|
||||||
dest.writeInt(hideFlag);
|
dest.writeInt(hideFlag);
|
||||||
dest.writeInt(closeScreenFlag);
|
dest.writeInt(closeScreenFlag);
|
||||||
|
dest.writeParcelable(boxSwitchVo, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -528,4 +531,7 @@ public class RoomInfo implements Parcelable,Serializable {
|
|||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -10,8 +10,10 @@ import java.text.ParseException;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.IllegalFormatException;
|
import java.util.IllegalFormatException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Zhanghuiping on 14/6/5.
|
* Created by Zhanghuiping on 14/6/5.
|
||||||
@@ -815,4 +817,68 @@ public class TimeUtils {
|
|||||||
return currYear == cacheYear;
|
return currYear == cacheYear;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得系统时间 年、月、日、小时、分钟
|
||||||
|
* @return HashMap
|
||||||
|
*/
|
||||||
|
public static int getTime24(){
|
||||||
|
Calendar calendar=Calendar.getInstance();
|
||||||
|
String hour = String.valueOf(calendar.get(Calendar.HOUR_OF_DAY));
|
||||||
|
String minute = String.valueOf(calendar.get(Calendar.MINUTE));
|
||||||
|
return Integer.parseInt(hour +minute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getTimeLimit(int start_hour,int start_minute,int end_hour,int end_minute) {
|
||||||
|
SimpleDateFormat hh = new SimpleDateFormat("HH", Locale.CHINA);
|
||||||
|
SimpleDateFormat mm = new SimpleDateFormat("mm", Locale.CHINA);
|
||||||
|
hh.setTimeZone(TimeZone.getTimeZone("GMT+08")); // 获取指定时区的时间
|
||||||
|
mm.setTimeZone(TimeZone.getTimeZone("GMT+08"));
|
||||||
|
Date date = new Date();
|
||||||
|
String hour = hh.format(date);
|
||||||
|
String minute = mm.format(date);
|
||||||
|
final int start = start_hour * start_minute;// 起始时间 8:00的分钟数
|
||||||
|
final int end = end_hour * end_minute;// 结束时间 19:00的分钟数
|
||||||
|
int minuteOfDay = Integer.parseInt(hour) * 60 + Integer.parseInt(minute);
|
||||||
|
Log.i("stf", "--hour:minute-->" + hour + ":" + minute);
|
||||||
|
LogUtil.print("start" +start);
|
||||||
|
LogUtil.print("end" +end);
|
||||||
|
LogUtil.print("minuteOfDay" +minuteOfDay);
|
||||||
|
if (minuteOfDay >= start && minuteOfDay <= end) {
|
||||||
|
LogUtil.print("工作时间内" + hour + ":" + minute);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
if (start > end){
|
||||||
|
if (minuteOfDay >= start || minuteOfDay <= end){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LogUtil.print( "工作时间外" + hour + ":" + minute);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// public static boolean getTimeLimit() {
|
||||||
|
// SimpleDateFormat hh = new SimpleDateFormat("HH", Locale.CHINA);
|
||||||
|
// SimpleDateFormat mm = new SimpleDateFormat("mm", Locale.CHINA);
|
||||||
|
// hh.setTimeZone(TimeZone.getTimeZone("GMT+08")); // 获取指定时区的时间
|
||||||
|
// mm.setTimeZone(TimeZone.getTimeZone("GMT+08"));
|
||||||
|
// Date date = new Date();
|
||||||
|
// String hour = hh.format(date);
|
||||||
|
// String minute = mm.format(date);
|
||||||
|
// final int start = 8 * 60;// 起始时间 8:00的分钟数
|
||||||
|
// final int end = 19 * 60;// 结束时间 19:00的分钟数
|
||||||
|
// int minuteOfDay = Integer.parseInt(hour) * 60 + Integer.parseInt(minute);
|
||||||
|
// Log.i("stf", "--hour:minute-->" + hour + ":" + minute);
|
||||||
|
// if (minuteOfDay >= start && minuteOfDay <= end) {
|
||||||
|
// LogUtil.print("工作时间内" + hour + ":" + minute);
|
||||||
|
// return true;
|
||||||
|
// } else {
|
||||||
|
// LogUtil.print( "工作时间外" + hour + ":" + minute);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user