房间开箱入口统一
This commit is contained in:
@@ -98,7 +98,7 @@ public class RoomTitleEditActivity extends BaseBindingActivity<ActivityRoomTitle
|
||||
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
// Toast.makeText(this, "主题不能为空", Toast.LENGTH_SHORT).show();
|
||||
SingleToastUtil.showToastShort("主题不能为空");
|
||||
SingleToastUtil.showToast("主题不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,14 +153,8 @@ public class RoomTitleEditActivity extends BaseBindingActivity<ActivityRoomTitle
|
||||
mDialogManager.dismissDialog();
|
||||
|
||||
if (throwable != null) {
|
||||
// Toast.makeText(this, "设置失败", Toast.LENGTH_SHORT).show();
|
||||
SingleToastUtil.showToastShort("设置失败");
|
||||
SingleToastUtil.showToast(throwable.getMessage());
|
||||
} else {
|
||||
// Intent intent = new Intent();
|
||||
// Bundle bundle = new Bundle();
|
||||
// bundle.putSerializable(ROOM_TITLE_EDIT_REQUEST_RESULT, roomInfo);
|
||||
// intent.putExtras(bundle);
|
||||
// setResult(RESULT_OK, intent);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,65 @@
|
||||
package com.mango.moshen.avroom.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Display;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.mango.moshen.R;
|
||||
import com.mango.moshen.databinding.DialogRoomPlayBinding;
|
||||
import com.mango.moshen.shipantics.PullRadishActivity;
|
||||
import com.mango.moshen.treasure_box.widget.GoldBoxHelper;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
|
||||
|
||||
/**
|
||||
* 房间操作dialog
|
||||
* Created by lvzebiao on 2018/11/15.
|
||||
*/
|
||||
|
||||
public class RoomPlayDialog extends BottomSheetDialog {
|
||||
|
||||
private Context context;
|
||||
private DialogRoomPlayBinding binding;
|
||||
|
||||
public RoomPlayDialog(@NonNull Context context) {
|
||||
super(context, R.style.ErbanBottomSheetDialogDimFalse);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setCanceledOnTouchOutside(true);
|
||||
binding = DialogRoomPlayBinding.inflate(LayoutInflater.from(context));
|
||||
setContentView(binding.getRoot());
|
||||
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||
Display d = windowManager.getDefaultDisplay();
|
||||
DisplayMetrics realDisplayMetrics = new DisplayMetrics();
|
||||
d.getRealMetrics(realDisplayMetrics);
|
||||
WindowManager.LayoutParams params = getWindow().getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
getWindow().setAttributes(params);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GlideApp.with(context)
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(binding.ivBox);
|
||||
binding.llBox.setOnClickListener(v -> GoldBoxHelper.handleBoxClick(context));
|
||||
binding.llBox.setVisibility(GoldBoxHelper.isShowBox() ? View.VISIBLE : View.GONE);
|
||||
|
||||
binding.llRadish.setVisibility(GoldBoxHelper.isShowRadish() ? View.VISIBLE : View.GONE);
|
||||
binding.llRadish.setOnClickListener(v -> PullRadishActivity.start(context));
|
||||
}
|
||||
|
||||
}
|
@@ -165,7 +165,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
private var pagerViewWishList: RollPagerView? = null
|
||||
private var isCloseScreen = false
|
||||
private var isOpenRedPackage = false
|
||||
private val llBox: View by lazy { mView.findViewById(R.id.ll_box) }
|
||||
|
||||
@JvmField
|
||||
protected var isDatingMode = false
|
||||
@@ -208,7 +207,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
microView = mView.findViewById(R.id.micro_view)
|
||||
mVsMusicPlayer = mView.findViewById(R.id.vs_music_player)
|
||||
ivMusicFlag = mView.findViewById(R.id.iv_music_flag)
|
||||
ivRadishEntrance = mView.findViewById(R.id.iv_radish_entrance)
|
||||
pagerViewWishList = mView.findViewById(R.id.pager_view_wish_list)
|
||||
messageView.setClickConsumer {
|
||||
if (!TextUtils.isEmpty(it) && it != "0") {
|
||||
@@ -758,15 +756,6 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
mvpPresenter?.loadRoomRank()
|
||||
}
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
R.id.iv_radish_entrance -> PullRadishActivity.start(mContext)
|
||||
R.id.tv_box_more -> {
|
||||
val translationX = llBox.width - ScreenUtil.dip2px(33f).toFloat()
|
||||
llBox.animate()
|
||||
.translationX(if (llBox.translationX == 0f) translationX else 0f)
|
||||
.setDuration(300)
|
||||
.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -150,19 +150,17 @@ 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 -> {
|
||||
if (userInfo.isFirstCharge()) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.VISIBLE);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("name", "新人充值");
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_POP_SHOW, "房间pop曝光", map);
|
||||
}
|
||||
});
|
||||
}
|
||||
UserModel.get().getCurrentUserInfo()
|
||||
.compose(bindToLifecycle())
|
||||
.subscribe(userInfo -> {
|
||||
if (userInfo.isFirstCharge()) {
|
||||
gameBinding.ivFirstChargeEnter.setVisibility(View.VISIBLE);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("name", "新人充值");
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_POP_SHOW, "房间pop曝光", map);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -809,42 +807,6 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (AvRoomDataManager.get().mCurrentRoomInfo.getIsPermitRoom() == 1) {
|
||||
gameBinding.tvHourRank.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
gameBinding.tvHourRank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (!GoldBoxHelper.needIntegrateBoxEntrance()) {
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
} else {
|
||||
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
||||
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
.load(GoldBoxHelper.getBoxIcon())
|
||||
.error(R.drawable.icon_room_treasure_box)
|
||||
.into(gameBinding.ivTreasureBox);
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("name", "糖果树");
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_POP_SHOW, "房间pop曝光", map);
|
||||
}
|
||||
} else {
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
},
|
||||
throwable -> {
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
});
|
||||
} else {
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
setDragonView();
|
||||
}
|
||||
|
||||
|
@@ -100,25 +100,6 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
)
|
||||
}
|
||||
}
|
||||
GoldBoxHelper.isHideBox().subscribe(
|
||||
{
|
||||
if (it == false) {
|
||||
gameBinding.ivTreasureBox.visibility = View.VISIBLE
|
||||
gameBinding.ivTreasureBox.load(
|
||||
GoldBoxHelper.getBoxIcon(),
|
||||
defaultRes = R.drawable.icon_room_treasure_box
|
||||
)
|
||||
val map = HashMap<String, String>()
|
||||
map["name"] = "糖果树"
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_ROOM_POP_SHOW, "房间pop曝光", map)
|
||||
} else {
|
||||
gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
) {
|
||||
gameBinding.ivTreasureBox.visibility = View.GONE
|
||||
}
|
||||
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
|
||||
|
@@ -32,16 +32,7 @@ public class GameRoomPresenter extends BaseRoomPresenter<IGameRoomView> {
|
||||
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));
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -301,33 +301,7 @@ 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);
|
||||
}
|
||||
getMvpView().onShowBanner(bannerInfos);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,9 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mango.core.DemoCache;
|
||||
import com.mango.moshen.avroom.dialog.RoomPlayDialog;
|
||||
import com.mango.moshen.treasure_box.widget.GoldBoxHelper;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.netease.nimlib.sdk.msg.model.RecentContact;
|
||||
@@ -79,12 +82,18 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
private ImageView iconMicQueue;
|
||||
private ImageView iconRoomMsg;
|
||||
private ImageView iconVip;
|
||||
private ImageView iconPlay;
|
||||
|
||||
@Nullable
|
||||
private PopupWindow msgTipPopupWindow;
|
||||
@NonNull
|
||||
private final Runnable msgRunnable = this::dismissMsgPopupWindow;
|
||||
|
||||
@Nullable
|
||||
private PopupWindow playTipPopupWindow;
|
||||
@NonNull
|
||||
private final Runnable playRunnable = this::dismissPlayPopupWindow;
|
||||
|
||||
public BottomView(Context context) {
|
||||
super(context);
|
||||
init();
|
||||
@@ -114,10 +123,11 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
faceLayout = findViewById(R.id.room_face_layout);
|
||||
micLayout = findViewById(R.id.room_mic_layout);
|
||||
|
||||
iconMicQueue = (ImageView) findViewById(R.id.icon_mic_queue);
|
||||
iconMicQueue = findViewById(R.id.icon_mic_queue);
|
||||
|
||||
iconRoomMsg = findViewById(R.id.iv_room_message);
|
||||
iconVip = findViewById(R.id.icon_room_vip);
|
||||
iconPlay = findViewById(R.id.icon_room_play);
|
||||
openMic.setOnClickListener(this);
|
||||
sendMsg.setOnClickListener(this);
|
||||
sendMsgInput.setOnClickListener(this);
|
||||
@@ -128,11 +138,13 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
iconMicQueue.setOnClickListener(this);
|
||||
iconRoomMsg.setOnClickListener(this);
|
||||
iconVip.setOnClickListener(this);
|
||||
iconPlay.setOnClickListener(this);
|
||||
|
||||
setMicBtnEnable(false);
|
||||
setMicBtnOpen(false);
|
||||
updateQueuingMicButton();
|
||||
setRoomMessageUnread(IMMessageManager.get().queryUnreadMsg());
|
||||
initRoomPlayEntrance();
|
||||
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
sendGift.setVisibility(GONE);
|
||||
@@ -343,6 +355,10 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
StatisticManager.Instance()
|
||||
.onEvent(StatisticsProtocol.EVENT_VIP_ENTRANCE_ROOM_CLICK, "贵族房间入口点击事件");
|
||||
break;
|
||||
case R.id.icon_room_play:
|
||||
dismissPlayPopupWindow();
|
||||
new RoomPlayDialog(getContext()).show();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -425,4 +441,68 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
parent.postDelayed(msgRunnable, 3000);
|
||||
}
|
||||
|
||||
private void initRoomPlayEntrance() {
|
||||
boolean showPlayEntrance = false;
|
||||
if (GoldBoxHelper.isShowRadish()) {
|
||||
showPlayEntrance = true;
|
||||
if (DemoCache.readShowRadishTip()) {
|
||||
iconPlay.post(() -> {
|
||||
showPlayTipsPopup(iconPlay);
|
||||
DemoCache.saveShowRadishTip(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (GoldBoxHelper.isShowBox()) {
|
||||
showPlayEntrance = true;
|
||||
if (DemoCache.readShowBoxTip()) {
|
||||
iconPlay.post(() -> {
|
||||
showPlayTipsPopup(iconPlay);
|
||||
DemoCache.saveShowBoxTip(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
iconPlay.setVisibility(showPlayEntrance ? VISIBLE : GONE);
|
||||
}
|
||||
|
||||
private void showPlayTipsPopup(View parent) {
|
||||
if (parent == null || !isAttachedToWindow()) return;
|
||||
if (getContext() instanceof Activity && ((Activity) getContext()).isFinishing()) return;
|
||||
if (playTipPopupWindow != null && playTipPopupWindow.isShowing()) return;
|
||||
|
||||
parent.removeCallbacks(playRunnable);
|
||||
View contentView;
|
||||
if (playTipPopupWindow == null) {
|
||||
contentView = LayoutInflater.from(getContext()).inflate(R.layout.popup_play_tip, null);
|
||||
playTipPopupWindow = new PopupWindow(contentView, ScreenUtil.dip2px(136), ScreenUtil.dip2px(23));
|
||||
playTipPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
playTipPopupWindow.setAnimationStyle(R.style.style_anim_message_tip);
|
||||
}
|
||||
int[] vLoc = new int[2];
|
||||
parent.getLocationInWindow(vLoc);
|
||||
try {
|
||||
playTipPopupWindow.showAtLocation(
|
||||
parent,
|
||||
Gravity.START | Gravity.TOP,
|
||||
vLoc[0] - ScreenUtil.dip2px(18),//
|
||||
vLoc[1] - ScreenUtil.dip2px(28)//23+5
|
||||
);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
parent.postDelayed(playRunnable, 5000);
|
||||
}
|
||||
|
||||
private void dismissPlayPopupWindow() {
|
||||
if (playTipPopupWindow != null) {
|
||||
try {
|
||||
playTipPopupWindow.dismiss();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
playTipPopupWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/bg_room_play_pop.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/bg_room_play_pop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_room_bottom_play.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_room_bottom_play.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.1 KiB |
92
app/src/main/res/layout/dialog_room_play.xml
Normal file
92
app/src/main/res/layout/dialog_room_play.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/dialog_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.mango.moshen.ui.widget.TopRoundLinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#01ffffff"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.github.mmin18.widget.RealtimeBlurView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:realtimeBlurRadius="80dp"
|
||||
app:realtimeDownsampleFactor="1"
|
||||
app:realtimeOverlayColor="#1affffff" />
|
||||
|
||||
</com.mango.moshen.ui.widget.TopRoundLinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_radish"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:src="@drawable/ic_radish_entrance" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="航海冒险"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_box"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_box"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:src="@drawable/icon_room_treasure_box" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="糖果树"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -68,9 +68,9 @@
|
||||
<LinearLayout
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:gravity="center">
|
||||
android:gravity="center"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_open_remote_mic"
|
||||
@@ -120,6 +120,15 @@
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/icon_send_magic" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_play"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginStart="@dimen/dp_9"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_room_bottom_play"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_room_vip"
|
||||
android:layout_width="30dp"
|
||||
|
9
app/src/main/res/layout/popup_play_tip.xml
Normal file
9
app/src/main/res/layout/popup_play_tip.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll_container"
|
||||
android:layout_width="136dp"
|
||||
android:layout_height="23dp"
|
||||
android:src="@drawable/bg_room_play_pop" />
|
||||
|
@@ -272,51 +272,6 @@
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="首充红包" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/activity_img"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:gravity="center"
|
||||
android:translationX="71dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_box_more"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_room_box_more"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="更多玩法"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="航海冒险" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="许愿池" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_queuing_micro"
|
||||
android:layout_width="65dp"
|
||||
|
@@ -232,7 +232,7 @@
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_first_charge_enter"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_box"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_speedy_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="首充红包" />
|
||||
|
||||
@@ -261,51 +261,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/barrier_micro"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:translationX="71dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_img">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_box_more"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_room_box_more"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="0dp"
|
||||
android:onClick="@{click}"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="更多玩法"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="航海冒险" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="许愿池" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/input_layout"
|
||||
android:layout_width="0dp"
|
||||
|
@@ -5,46 +5,60 @@ import android.content.Context;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.mango.moshen.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.mango.moshen.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.mango.moshen.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
import com.mango.core.DemoCache;
|
||||
import com.mango.core.initial.InitialModel;
|
||||
import com.mango.core.initial.bean.InitInfo;
|
||||
import com.mango.core.level.UserLevelVo;
|
||||
import com.mango.core.manager.AvRoomDataManager;
|
||||
import com.mango.core.market_verify.MarketVerifyModel;
|
||||
import com.mango.core.statistic.StatisticManager;
|
||||
import com.mango.core.statistic.protocol.StatisticsProtocol;
|
||||
import com.mango.core.super_admin.util.SuperAdminUtil;
|
||||
import com.mango.core.user.UserModel;
|
||||
import com.mango.core.user.bean.UserInfo;
|
||||
import com.mango.moshen.treasure_box.activity.TreasureBoxActivity;
|
||||
import com.mango.moshen.treasure_box.activity.TreasureBoxHonourActivity;
|
||||
import com.mango.moshen.treasure_box.fragment.ChooseTreasureBoxDialogFragment;
|
||||
import com.mango.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.mango.xchat_android_library.utils.TimeUtils;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public class GoldBoxHelper {
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public static Single<Boolean> isHideBox() {
|
||||
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() || !AvRoomDataManager.get().mBoxSwitchVo.isOpenBoxSwitch()
|
||||
|| levelVo.getExperLevelSeq() < boxInfo.getOpenBoxSwitchLevelNo() || AvRoomDataManager.get().isOpenPureMode();
|
||||
}
|
||||
return Single.just(isHide);
|
||||
});
|
||||
return InitialModel.get()
|
||||
.getBoxInfo()
|
||||
.flatMap(boxInfo -> Single.just(!isShowBox(boxInfo.getOpenBoxSwitchLevelNo())));
|
||||
}
|
||||
|
||||
public static boolean isShowBox() {
|
||||
InitInfo initInfo = InitialModel.get().getCacheInitInfo();
|
||||
if (initInfo == null) return false;
|
||||
return isShowBox(initInfo.getOpenBoxSwitchLevelNo());
|
||||
}
|
||||
|
||||
private static boolean isShowBox(int switchLevelNo) {
|
||||
if (SuperAdminUtil.isSuperAdmin()) {
|
||||
return false;
|
||||
}
|
||||
boolean isHide = 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() || !AvRoomDataManager.get().mBoxSwitchVo.isOpenBoxSwitch()
|
||||
|| levelVo.getExperLevelSeq() < switchLevelNo || AvRoomDataManager.get().isOpenPureMode();
|
||||
}
|
||||
|
||||
return !isHide;
|
||||
}
|
||||
|
||||
|
||||
public static void handleBoxClick(Context context) {
|
||||
String openTime = GoldBoxHelper.getBoxOpenTime();
|
||||
if (openTime == null || openTime.isEmpty()) {
|
||||
@@ -92,14 +106,5 @@ public class GoldBoxHelper {
|
||||
return userInfo.getUserLevelVo().getExperLevelSeq() >= initInfo.getLinearlyPoolOpenLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* 房间改版之后不再需要整合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static boolean needIntegrateBoxEntrance() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -60,6 +60,8 @@ public class DemoCache {
|
||||
private static final String KEY_SPEED_MSG_COUNT = "key_speed_msg_count";
|
||||
private static final String KEY_COLLECTION_ROOM_INDEX = "key_collection_room_index";
|
||||
private static final String KEY_PM_MODE = "key_pm_mode";
|
||||
private static final String KEY_SHOW_BOX_TIP = "key_show_box_tip";
|
||||
private static final String KEY_SHOW_RADISH_TIP = "key_show_radish_tip";
|
||||
|
||||
private static StatusBarNotificationConfig notificationConfig;
|
||||
|
||||
@@ -357,4 +359,20 @@ public class DemoCache {
|
||||
return SettingsPref.instance().getBoolean(KEY_PM_MODE + AuthModel.get().getCurrentUid(), false);
|
||||
}
|
||||
|
||||
public static void saveShowBoxTip(boolean value) {
|
||||
SettingsPref.instance().putBoolean(KEY_SHOW_BOX_TIP + AuthModel.get().getCurrentUid(), value);
|
||||
}
|
||||
|
||||
public static boolean readShowBoxTip() {
|
||||
return SettingsPref.instance().getBoolean(KEY_SHOW_BOX_TIP + AuthModel.get().getCurrentUid(), true);
|
||||
}
|
||||
|
||||
public static void saveShowRadishTip(boolean value) {
|
||||
SettingsPref.instance().putBoolean(KEY_SHOW_RADISH_TIP + AuthModel.get().getCurrentUid(), value);
|
||||
}
|
||||
|
||||
public static boolean readShowRadishTip() {
|
||||
return SettingsPref.instance().getBoolean(KEY_SHOW_RADISH_TIP + AuthModel.get().getCurrentUid(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user