游戏房开箱,首充,活动入口统一
This commit is contained in:
@@ -635,7 +635,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
showRedPackage(roomInfo);
|
||||
getMvpPresenter().getActionDialog(2);
|
||||
}
|
||||
if (isRoomMin) {
|
||||
getMvpPresenter().judgeIsLimitEnter();
|
||||
@@ -790,17 +789,6 @@ public class AVRoomActivity extends BaseMvpActivity<IAvRoomView, AvRoomPresenter
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetActionDialog(List<BannerInfo> dialogInfo) {
|
||||
if (mCurrentFragment != null && mCurrentFragment.isVisible()) {
|
||||
mCurrentFragment.onShowActivity(dialogInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetActionDialogError(String error) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exitRoom(RoomInfo currentRoomInfo) {
|
||||
if (currentRoomInfo != null && currentRoomInfo.getUid() == roomUid) {
|
||||
|
@@ -49,12 +49,12 @@ class GameMicroViewAdapter(context: Context?) : BaseMicroViewAdapter(context) {
|
||||
public override fun bind(info: RoomQueueInfo, position: Int) {
|
||||
super.bind(info, position)
|
||||
info.mChatRoomMember?.let {
|
||||
if (it.gameStatus == 0 && !AvRoomDataManager.get().isRoomOwner) {
|
||||
if (it.gameStatus == 0 && !AvRoomDataManager.get().isRoomOwner(it.account)) {
|
||||
tvGameStatus.isVisible = false
|
||||
} else {
|
||||
tvGameStatus.isVisible = true
|
||||
val bgRes = when {
|
||||
AvRoomDataManager.get().isRoomOwner -> {
|
||||
AvRoomDataManager.get().isRoomOwner(it.account) -> {
|
||||
tvGameStatus.text = "房主"
|
||||
R.drawable.bg_game_status_owner
|
||||
}
|
||||
|
@@ -14,9 +14,6 @@ import java.util.List;
|
||||
public abstract class AbsRoomFragment extends BaseFragment {
|
||||
|
||||
|
||||
public abstract void onShowActivity(List<BannerInfo> dialogInfo);
|
||||
|
||||
|
||||
public void onRoomOnlineNumberSuccess(int onlineNumber) {
|
||||
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ import com.yizhuan.erban.event.OpenRoomIntroEvent
|
||||
import com.yizhuan.erban.friend.view.SelectFriendActivity
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter
|
||||
import com.yizhuan.erban.home.adapter.RoomActAdapter.RoomActClickListener
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper
|
||||
import com.yizhuan.erban.ui.webview.DialogWebViewActivity
|
||||
import com.yizhuan.erban.ui.widget.ButtonItem
|
||||
import com.yizhuan.erban.ui.widget.GiftDialog
|
||||
@@ -71,6 +72,7 @@ import com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.Util
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.hintview.ColorPointHintView
|
||||
import com.yizhuan.erban.utils.KeyBoardUtils
|
||||
import com.yizhuan.erban.utils.UserUtils
|
||||
import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity
|
||||
import com.yizhuan.xchat_android_core.Constants
|
||||
import com.yizhuan.xchat_android_core.UriProvider
|
||||
@@ -109,6 +111,7 @@ import com.yizhuan.xchat_android_core.super_admin.util.SuperAdminUtil
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.BaseInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils
|
||||
import com.yizhuan.xchat_android_library.base.factory.CreatePresenter
|
||||
import com.yizhuan.xchat_android_library.net.rxnet.utils.RxNetWorkUtils
|
||||
import com.yizhuan.xchat_android_library.rxbus.RxBus
|
||||
@@ -122,6 +125,7 @@ import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
/**
|
||||
* 轰趴房间
|
||||
@@ -203,9 +207,11 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
}
|
||||
}
|
||||
|
||||
gameDelegate = GameDelegate(requireActivity(),
|
||||
gameDelegate = GameDelegate(
|
||||
requireActivity(),
|
||||
gameBinding.flGameContainer,
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId)
|
||||
AvRoomDataManager.get().mCurrentRoomInfo?.mgId
|
||||
)
|
||||
gameDelegate.setOnGameStatusChangeListener(this)
|
||||
}
|
||||
|
||||
@@ -257,6 +263,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
) {
|
||||
mvpPresenter?.chatRoomReConnect(IMNetEaseManager.get().mCacheRoomQueueInfo)
|
||||
}
|
||||
mvpPresenter?.getBannerList()
|
||||
|
||||
// 接收公屏消息点击 可点击房间编辑页查看 事件
|
||||
RxBus.get().toFlowable(OpenRoomIntroEvent::class.java)
|
||||
@@ -486,16 +493,12 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示活动图标
|
||||
*/
|
||||
fun showActivity(dialogInfo: List<BannerInfo?>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfo, 11f)
|
||||
}
|
||||
|
||||
fun initRoomAct(rollPagerView: RollPagerView, dialogInfo: List<BannerInfo?>, bottomDp: Float) {
|
||||
rollPagerView.visibility = View.INVISIBLE
|
||||
if (!ListUtils.isListEmpty(dialogInfo) && !MarketVerifyModel.get().isMarketChecking) {
|
||||
private fun initRoomAct(
|
||||
rollPagerView: RollPagerView,
|
||||
dialogInfo: List<BannerInfo>,
|
||||
) {
|
||||
if (!ListUtils.isListEmpty(dialogInfo)) {
|
||||
rollPagerView.visibility = View.VISIBLE
|
||||
// 只有一个图标,隐藏底部指示器
|
||||
val show = dialogInfo.size > 1
|
||||
rollPagerView.setHintView(object : ColorPointHintView(
|
||||
@@ -546,9 +549,6 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
// 模拟指示器在viewpager底部效果
|
||||
val viewPager = rollPagerView.viewPager
|
||||
viewPager.offscreenPageLimit = dialogInfo.size
|
||||
val layoutParams = viewPager.layoutParams as RelativeLayout.LayoutParams
|
||||
layoutParams.setMargins(0, 0, 0, UIUtil.dip2px(mContext, bottomDp.toDouble()))
|
||||
viewPager.layoutParams = layoutParams
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1142,16 +1142,16 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
|
||||
gameBinding.microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onShowBanner(dialogInfos: List<BannerInfo>) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfos)
|
||||
}
|
||||
|
||||
private fun onSendGiftBtnClick() {
|
||||
if (giftDialog == null) {
|
||||
GiftDialog.GIFT_DIALOG_FROM = "房间"
|
||||
giftDialog = GiftDialog(context, 0, true)
|
||||
giftDialog?.setGiftDialogBtnClickListener(this@GameRoomFragment)
|
||||
giftDialog?.setOnDismissListener(object : DialogInterface.OnDismissListener {
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
giftDialog = null
|
||||
}
|
||||
})
|
||||
giftDialog?.setOnDismissListener { giftDialog = null }
|
||||
}
|
||||
if (giftDialog?.isShowing != true && !requireActivity().isFinishing) {
|
||||
giftDialog?.show()
|
||||
|
@@ -247,18 +247,12 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
mgId = JavaUtil.str2long(gameInfo.getMgId());
|
||||
}
|
||||
gameMainBinding.rvGame.setVisibility(View.GONE);
|
||||
|
||||
if (roomInfo.getType() != RoomInfo.ROOMTYPE_GAME &&
|
||||
mgId == roomInfo.getMgId() &&
|
||||
type == roomInfo.getType()) return;
|
||||
|
||||
OpenRoomHelper.updateRoomInfo(
|
||||
getBaseActivity(),
|
||||
AvRoomDataManager.get().mCurrentRoomInfo,
|
||||
type,
|
||||
mgId,
|
||||
false);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -636,13 +630,6 @@ public class HomePartyFragment extends AbsRoomFragment implements View.OnClickLi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowActivity(List<BannerInfo> dialogInfos) {
|
||||
if (roomFragment instanceof HomePartyRoomFragment && roomFragment.isAdded()) {
|
||||
((HomePartyRoomFragment) roomFragment).showActivity(dialogInfos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
@@ -442,6 +442,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
checkMiniWorld();
|
||||
otherInitView();
|
||||
getMvpPresenter().loadMessageHistory();
|
||||
getMvpPresenter().getBannerList();
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(userInfo -> {
|
||||
@@ -935,11 +936,7 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
* 显示活动图标
|
||||
*/
|
||||
public void showActivity(List<BannerInfo> dialogInfo) {
|
||||
initRoomAct(gameBinding.activityImg, dialogInfo, 11f);
|
||||
setActTimerVisibility(View.GONE);
|
||||
AvRoomModel.get().getRoomActTimer(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe();
|
||||
|
||||
}
|
||||
|
||||
private void setActTimerVisibility(int visibility) {
|
||||
@@ -2461,6 +2458,15 @@ public class HomePartyRoomFragment extends BaseMvpFragment<IHomePartyView, HomeP
|
||||
gameBinding.microView.getAdapter().notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onShowBanner(List<BannerInfo> bannerInfos) {
|
||||
initRoomAct(gameBinding.activityImg, bannerInfos, 11f);
|
||||
setActTimerVisibility(View.GONE);
|
||||
AvRoomModel.get().getRoomActTimer(AvRoomDataManager.get().getRoomUid())
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启相亲模式管理增加一条公屏提示
|
||||
*/
|
||||
|
@@ -418,26 +418,6 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动信息
|
||||
*/
|
||||
public void getActionDialog(int type) {
|
||||
mAvRoomModel.getActionDialog(type, new CallBack<List<BannerInfo>>() {
|
||||
@Override
|
||||
public void onSuccess(List<BannerInfo> data) {
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onGetActionDialog(data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String error) {
|
||||
if (getMvpView() != null) {
|
||||
getMvpView().onGetActionDialogError(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取房间内固定成员列表
|
||||
|
@@ -21,9 +21,12 @@ import com.netease.nimlib.sdk.util.Entry;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.erban.avroom.view.IGameRoomView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FaceAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomInfoAttachment;
|
||||
@@ -595,4 +598,29 @@ public class GameRoomPresenter extends BaseMvpPresenter<IGameRoomView> {
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
if (bannerInfos == null) bannerInfos = new ArrayList<>();
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
List<BannerInfo> finalBannerInfos = bannerInfos;
|
||||
GoldBoxHelper.isHideBox()
|
||||
.subscribe(isHide -> {
|
||||
if (!isHide) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setBox(true);
|
||||
finalBannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(finalBannerInfos);
|
||||
}, throwable -> getMvpView().onShowBanner(finalBannerInfos));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -25,10 +25,12 @@ import com.netease.nimlib.sdk.util.Entry;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
import com.yizhuan.erban.base.BaseMvpPresenter;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.utils.UserUtils;
|
||||
import com.yizhuan.xchat_android_core.Constants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.FaceAttachment;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomInfoAttachment;
|
||||
@@ -879,4 +881,14 @@ public class HomePartyPresenter extends BaseMvpPresenter<IHomePartyView> {
|
||||
.subscribe(s -> SingleToastUtil.showToast("选择成功")
|
||||
, e -> SingleToastUtil.showToast(e.getMessage()));
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void getBannerList() {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -46,16 +46,6 @@ public interface IAvRoomView extends IMvpBaseView {
|
||||
*/
|
||||
void dismissLoadingDialog();
|
||||
|
||||
/**
|
||||
* 获取活动信息成功
|
||||
*/
|
||||
void onGetActionDialog(List<BannerInfo> actionDialogInfoList);
|
||||
|
||||
/**
|
||||
* 获取活动信息失败
|
||||
*/
|
||||
void onGetActionDialogError(String error);
|
||||
|
||||
/**
|
||||
* 退出房间
|
||||
*
|
||||
|
@@ -4,6 +4,7 @@ import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.yizhuan.erban.avroom.widget.ViewItem;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomMicInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_library.base.IMvpBaseView;
|
||||
@@ -80,4 +81,6 @@ public interface IGameRoomView extends IMvpBaseView {
|
||||
|
||||
void updateMicView();
|
||||
|
||||
void onShowBanner(List<BannerInfo> dialogInfos);
|
||||
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.yizhuan.erban.avroom.widget.ViewItem;
|
||||
import com.yizhuan.xchat_android_core.bean.RoomMicInfo;
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo;
|
||||
import com.yizhuan.xchat_android_core.miniworld.bean.MiniWorldInWorldInfo;
|
||||
import com.yizhuan.xchat_android_core.pay.bean.WalletInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
@@ -116,4 +117,5 @@ public interface IHomePartyView extends IMvpBaseView {
|
||||
|
||||
void updateMicView();
|
||||
|
||||
void onShowBanner(List<BannerInfo> bannerInfos);
|
||||
}
|
||||
|
@@ -7,7 +7,15 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.yizhuan.erban.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.yizhuan.erban.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
import com.yizhuan.erban.utils.CommonJumpHelper;
|
||||
@@ -16,6 +24,8 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.room.model.AvRoomModel;
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager;
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol;
|
||||
import com.yizhuan.xchat_android_library.utils.TimeUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -23,12 +33,7 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
|
||||
private Context mContext;
|
||||
private List<BannerInfo> data;
|
||||
|
||||
public void setInRoom(boolean inRoom) {
|
||||
this.inRoom = inRoom;
|
||||
}
|
||||
|
||||
private boolean inRoom = true;
|
||||
private RoomActClickListener listener;
|
||||
|
||||
public RoomActAdapter(Context context, List<BannerInfo> data) {
|
||||
this.data = data;
|
||||
@@ -42,21 +47,30 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
BannerInfo bannerInfo = data.get(position);
|
||||
String url = bannerInfo.getSkipUri();
|
||||
String actId = String.valueOf(bannerInfo.getBannerId());
|
||||
ivCover.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
ImageLoadUtils.loadImage(mContext, bannerInfo.getBannerPic(), ivCover, R.drawable.default_cover);
|
||||
ivCover.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
if (bannerInfo.isFirstCharge()) {
|
||||
ivCover.setImageResource(R.drawable.ic_first_charge_enter);
|
||||
} else if (bannerInfo.isBox()) {
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(ivCover);
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(mContext, bannerInfo.getBannerPic(), ivCover, R.drawable.default_cover);
|
||||
|
||||
}
|
||||
ivCover.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
if (inRoom) {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.cp_room_activity, "陪伴房活动点击");
|
||||
} else {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.mp_room_activity, "普通房活动点击");
|
||||
}
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe();
|
||||
} else {
|
||||
AvRoomModel.get().activityClickLog("1", actId).subscribe();
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.game_homepage_activity, "首页活动点击");
|
||||
if (bannerInfo.isFirstCharge()) {
|
||||
FirstChargeDialog.start(mContext);
|
||||
} else if (bannerInfo.isBox()) {
|
||||
onClickBox();
|
||||
}
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.mp_room_activity, "普通房活动点击");
|
||||
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe();
|
||||
|
||||
if (!TextUtils.isEmpty(actId) && "19".equals(actId)) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_ROOM_RECOMMEND_CLICK, "我要上推荐");
|
||||
}
|
||||
@@ -89,12 +103,38 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
private RoomActClickListener listener;
|
||||
|
||||
public void setRoomActClickListener(RoomActClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间许愿池
|
||||
*/
|
||||
public void onClickBox() {
|
||||
|
||||
String openTime = GoldBoxHelper.getBoxOpenTime();
|
||||
int startTime = Integer.parseInt(openTime.substring(0, openTime.indexOf("-")).replace(":", ""));
|
||||
int endTime = Integer.parseInt(openTime.substring(openTime.indexOf("-") + 1).replace(":", ""));
|
||||
|
||||
if (startTime != endTime && TimeUtils.getTimeLimit(startTime, endTime)) {
|
||||
ChooseTreasureBoxDialogFragment chooseTreasureBoxDialogFragment = new ChooseTreasureBoxDialogFragment(GoldBoxHelper.getBoxOpenTime());
|
||||
chooseTreasureBoxDialogFragment.setOnTreasureBoxChooseListener(type -> {
|
||||
if (type == 0) {// 幸运许愿池(默认)
|
||||
TreasureBoxActivity.start(mContext);
|
||||
} else if (type == 1) {// 梦幻许愿池
|
||||
TreasureBoxHonourActivity.start(mContext);
|
||||
}
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_CP_ROOM_SMASH_EGG_CLICK, "砸蛋入口");
|
||||
} else
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.Event.EVENT_MP_ROOM_SMASH_EGG_CLICK, "砸蛋入口");
|
||||
});
|
||||
chooseTreasureBoxDialogFragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "chooseTreasureBoxDialogFragment");
|
||||
} else {
|
||||
TreasureBoxActivity.start(mContext);
|
||||
}
|
||||
}
|
||||
|
||||
public interface RoomActClickListener {
|
||||
void onWebClick(String url);
|
||||
}
|
||||
|
@@ -152,7 +152,7 @@
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:visibility="visible"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
|
@@ -84,18 +84,18 @@
|
||||
android:id="@+id/iv_show_mic"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="22dp"
|
||||
android:rotation="180"
|
||||
android:layout_marginStart="5dp"
|
||||
android:rotation="180"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ic_room_mic_right"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.yizhuan.erban.avroom.widget.MicroView
|
||||
android:id="@+id/micro_view"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -122,12 +122,12 @@
|
||||
|
||||
<com.yizhuan.erban.ui.widget.rollviewpager.RollPagerView
|
||||
android:id="@+id/activity_img"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignTop="@id/message_view"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_above="@id/bottom_view"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<RelativeLayout
|
||||
|
@@ -32,26 +32,6 @@ public class GoldBoxHelper {
|
||||
});
|
||||
}
|
||||
|
||||
// public static Single<Boolean> isHideBox(boolean isOpenBoxSwitch) {
|
||||
// return InitialModel.get().getBoxInfo().flatMap(boxInfo -> {
|
||||
// boolean isHide = true;
|
||||
// if (SuperAdminUtil.isSuperAdmin()) {
|
||||
// return Single.just(true);
|
||||
// }
|
||||
// UserInfo myInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
// UserLevelVo levelVo = null;
|
||||
// if (myInfo != null) {
|
||||
// levelVo = myInfo.getUserLevelVo();
|
||||
// }
|
||||
// if (myInfo != null && levelVo != null) {
|
||||
// //1.审核模式 2.全局隐藏 3. 用户等级小于后台配置等级 都需要隐藏开箱子
|
||||
// isHide = MarketVerifyModel.get().isMarketChecking() || !isOpenBoxSwitch
|
||||
// || levelVo.getExperLevelSeq() < boxInfo.getOpenBoxSwitchLevelNo() || AvRoomDataManager.get().isOpenPureMode();
|
||||
// }
|
||||
// return Single.just(isHide);
|
||||
// });
|
||||
// }
|
||||
|
||||
public static boolean isShowDiamondBox() {
|
||||
return AvRoomDataManager.get().mBoxSwitchVo.isDiamondBoxSwitch();
|
||||
}
|
||||
|
@@ -56,6 +56,13 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
/**1-全屏,2-半屏,默认值是1*/
|
||||
private int showType;
|
||||
|
||||
private boolean isFirstCharge;
|
||||
private boolean isBox;
|
||||
|
||||
public BannerInfo(){
|
||||
|
||||
}
|
||||
|
||||
protected BannerInfo(Parcel in) {
|
||||
bannerId = in.readInt();
|
||||
bannerName = in.readString();
|
||||
|
@@ -389,17 +389,6 @@ public class AvRoomModel extends RoomBaseModel implements IAvRoomModel {
|
||||
.compose(RxHelper.handleSchedulers());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动信息
|
||||
*/
|
||||
@Override
|
||||
public void getActionDialog(int type, CallBack<List<BannerInfo>> callBack) {
|
||||
execute(mRoomService.getActionDialog(String.valueOf(type), AvRoomDataManager.get().getRoomId())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.unsubscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread()), callBack);
|
||||
}
|
||||
|
||||
public void requestRoomInfoFromService(String uid, int pageType, CallBack<RoomInfo> callBack) {
|
||||
execute(mRoomService.getRoomInfo(uid, AuthModel.get().getCurrentUid())
|
||||
.timeout(10, TimeUnit.SECONDS)
|
||||
|
@@ -765,8 +765,10 @@ public class RoomBaseModel extends BaseModel implements IRoomBaseModel {
|
||||
.compose(RxHelper.singleMainResult());
|
||||
}
|
||||
|
||||
public Api getmRoomService() {
|
||||
return mRoomService;
|
||||
public Single<List<BannerInfo>> getRoomBanner() {
|
||||
return mRoomService.getActionDialog("2",AvRoomDataManager.get().getRoomId())
|
||||
.singleOrError()
|
||||
.compose(RxHelper.singleMainResult());
|
||||
}
|
||||
|
||||
public interface Api {
|
||||
|
@@ -71,10 +71,6 @@ public interface IAvRoomModel extends IModel {
|
||||
|
||||
Single<RoomInfo> requestRoomInfo(String uid);
|
||||
|
||||
/**
|
||||
* 获取活动信息
|
||||
*/
|
||||
void getActionDialog(int type, CallBack<List<BannerInfo>> callBack);
|
||||
|
||||
/**
|
||||
* 告知服务端用户进入房间(后端统计需要)
|
||||
|
Reference in New Issue
Block a user