房间开箱入口适配小屏手机
This commit is contained in:
@@ -273,8 +273,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
|
||||
ivRadishEntrance?.isVisible =
|
||||
(UserModel.get().cacheLoginUserInfo?.userLevelVo?.getExperLevelSeq() ?: 0) >=
|
||||
(InitialModel.get().cacheInitInfo?.linearlyPoolOpenLevel ?: 999)
|
||||
!GoldBoxHelper.needIntegrateBoxEntrance() && GoldBoxHelper.isShowRadish()
|
||||
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
|
@@ -147,6 +147,7 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
updatePkScoreBoard();
|
||||
initRoomPkOrder(AvRoomDataManager.get().showPkBeginTime, AvRoomDataManager.get().pkBeginTime);
|
||||
getMvpPresenter().getBannerList();
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(userInfo -> {
|
||||
@@ -156,6 +157,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveRoomEvent(RoomEvent roomEvent) {
|
||||
super.onReceiveRoomEvent(roomEvent);
|
||||
@@ -803,6 +806,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
@@ -827,6 +832,11 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
});
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
setDragonView();
|
||||
}
|
||||
|
||||
|
@@ -11,10 +11,12 @@ import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder;
|
||||
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMessage;
|
||||
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
|
||||
import com.yizhuan.erban.avroom.view.IHomePartyView;
|
||||
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.manager.AvRoomDataManager;
|
||||
@@ -299,7 +301,33 @@ public class HomePartyPresenter extends BaseRoomPresenter<IHomePartyView> {
|
||||
mAvRoomModel.getRoomBanner()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(bannerInfos -> {
|
||||
if (GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
final boolean firstCharge = UserUtils.getUserInfo().isFirstCharge();
|
||||
if (firstCharge) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setFirstCharge(true);
|
||||
bannerInfos.add(0, bannerInfo);
|
||||
}
|
||||
if (GoldBoxHelper.isShowRadish()) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setRadish(true);
|
||||
bannerInfos.add(firstCharge ? 1 : 0, bannerInfo);
|
||||
}
|
||||
GoldBoxHelper.isHideBox()
|
||||
.subscribe(isHide -> {
|
||||
if (!isHide) {
|
||||
BannerInfo bannerInfo = new BannerInfo();
|
||||
bannerInfo.setBox(true);
|
||||
int index = 0;
|
||||
if (firstCharge) index++;
|
||||
if (GoldBoxHelper.isShowRadish()) index++;
|
||||
bannerInfos.add(index, bannerInfo);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}, throwable -> getMvpView().onShowBanner(bannerInfos));
|
||||
} else {
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import android.widget.ImageView;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.avroom.firstcharge.FirstChargeDialog;
|
||||
import com.yizhuan.erban.shipantics.PullRadishActivity;
|
||||
import com.yizhuan.erban.treasure_box.widget.GoldBoxHelper;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.erban.ui.widget.rollviewpager.adapter.StaticPagerAdapter;
|
||||
@@ -38,7 +39,6 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
View view = LayoutInflater.from(mContext).inflate(R.layout.item_room_act, container, false);
|
||||
ImageView ivCover = view.findViewById(R.id.iv_cover);
|
||||
BannerInfo bannerInfo = data.get(position);
|
||||
String url = bannerInfo.getSkipUri();
|
||||
String actId = String.valueOf(bannerInfo.getBannerId());
|
||||
ivCover.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
if (bannerInfo.isFirstCharge()) {
|
||||
@@ -48,22 +48,21 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(ivCover);
|
||||
} else if (bannerInfo.isRadish()) {
|
||||
ivCover.setImageResource(R.drawable.ic_radish_entrance);
|
||||
} else {
|
||||
ImageLoadUtils.loadImage(mContext, bannerInfo.getBannerPic(), ivCover, R.drawable.default_cover);
|
||||
|
||||
}
|
||||
ivCover.setOnClickListener(v -> {
|
||||
if (bannerInfo.isFirstCharge()) {
|
||||
FirstChargeDialog.start(mContext);
|
||||
} else if (bannerInfo.isBox()) {
|
||||
GoldBoxHelper.handleBoxClick(mContext);
|
||||
}
|
||||
if (TextUtils.isEmpty(url)) return;
|
||||
|
||||
} else if (bannerInfo.isRadish()) {
|
||||
PullRadishActivity.start(mContext);
|
||||
} else {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.mp_room_activity, "普通房活动点击");
|
||||
|
||||
AvRoomModel.get().activityClickLog("2", actId).subscribe();
|
||||
|
||||
if (!TextUtils.isEmpty(actId) && "19".equals(actId)) {
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_ROOM_RECOMMEND_CLICK, "我要上推荐");
|
||||
}
|
||||
@@ -83,6 +82,7 @@ public class RoomActAdapter extends StaticPagerAdapter {
|
||||
StatisticManager.Instance().onEvent(
|
||||
StatisticsProtocol.EVENT_ROOM_ACTIVITY_ENTRANCE_B,
|
||||
"房间右下角活动入口-区分活动:" + actName);
|
||||
}
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
@@ -5,10 +5,12 @@ import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
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.xchat_android_core.initial.InitialModel;
|
||||
import com.yizhuan.xchat_android_core.initial.bean.InitInfo;
|
||||
import com.yizhuan.xchat_android_core.level.UserLevelVo;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.market_verify.MarketVerifyModel;
|
||||
@@ -87,4 +89,21 @@ public class GoldBoxHelper {
|
||||
return AvRoomDataManager.get().mBoxSwitchVo.getDiamondBoxOpenTime();
|
||||
}
|
||||
|
||||
public static boolean isShowRadish() {
|
||||
InitInfo initInfo = InitialModel.get().getCacheInitInfo();
|
||||
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
|
||||
if (initInfo == null || userInfo == null) return false;
|
||||
return userInfo.getUserLevelVo().getExperLevelSeq() >= initInfo.getLinearlyPoolOpenLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 屏幕宽高比小于2的机型房间活动入口和开箱入口整合,个播房不需要整合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static boolean needIntegrateBoxEntrance() {
|
||||
return !AvRoomDataManager.get().isSingleRoom() && ScreenUtil.screenHeight / ScreenUtil.screenWidth < 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -58,6 +58,7 @@ public class BannerInfo implements Parcelable, Serializable {
|
||||
|
||||
private boolean isFirstCharge;
|
||||
private boolean isBox;
|
||||
private boolean isRadish;
|
||||
|
||||
public BannerInfo(){
|
||||
|
||||
|
Reference in New Issue
Block a user