1.修改BUG
2.礼物添加一键全送功能 3.转盘修改底部按钮展示、音效和特效功能
This commit is contained in:
@@ -159,6 +159,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -212,7 +213,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
private PublicScreenEaseChatFragment publicScreenFragment; // 添加成员变量
|
||||
// 添加成员变量
|
||||
private boolean isLayoutAdjusted = false;
|
||||
private ViewStub stub;
|
||||
// private ViewStub stub;
|
||||
private static WeakReference<RoomActivity> sActivityRef;
|
||||
// 存储当前显示的弹框引用
|
||||
private List<DialogInterface> activeDialogs = new ArrayList<>();
|
||||
@@ -457,7 +458,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.roomTop.btnFollow, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.roomTop.btnFollow.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
initPublicScreenFragment();
|
||||
stub = mBinding.roomTop.stubButtons.getViewStub();
|
||||
// stub = mBinding.roomTop.stubButtons.getViewStub();
|
||||
|
||||
// 为透明 View 设置触摸监听
|
||||
mBinding.roomTop.rlTop.setOnTouchListener(new View.OnTouchListener() {
|
||||
@@ -473,10 +474,10 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
layoutParams.height = SystemUtils.getWidth(74); // 示例高度
|
||||
mBinding.roomTop.getRoot().setLayoutParams(layoutParams);
|
||||
|
||||
ViewGroup.LayoutParams layoutParams2 = mBinding.vpRoomPager.getLayoutParams();
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; // 使用你定义的getWidth方法
|
||||
layoutParams.height = SystemUtils.getWidth(74); // 示例高度
|
||||
mBinding.roomTop.getRoot().setLayoutParams(layoutParams);
|
||||
// ViewGroup.LayoutParams layoutParams2 = mBinding.vpRoomPager.getLayoutParams();
|
||||
// layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; // 使用你定义的getWidth方法
|
||||
// layoutParams.height = SystemUtils.getWidth(74); // 示例高度
|
||||
// mBinding.roomTop.getRoot().setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
private void onGiftGiveProgressClcik() {
|
||||
@@ -919,6 +920,18 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
});
|
||||
|
||||
mRoomInfoResp.getRoom_info().setPit_list(pitList);
|
||||
|
||||
// 更新当前用户的 pit_number(如果当前用户参与了换麦)
|
||||
if (mRoomInfoResp.getUser_info() != null) {
|
||||
String currentUserId = String.valueOf(SpUtil.getUserId());
|
||||
if (fromBean.getUser_id().equals(currentUserId)) {
|
||||
// 当前用户原来在 fromBean 位置,现在换到了 toBean 位置
|
||||
mRoomInfoResp.getUser_info().setPit_number(Integer.parseInt(toBean.getPit_number()));
|
||||
} else if (toBean.getUser_id().equals(currentUserId)) {
|
||||
// 当前用户原来在 toBean 位置,现在换到了 fromBean 位置
|
||||
mRoomInfoResp.getUser_info().setPit_number(Integer.parseInt(fromBean.getPit_number()));
|
||||
}
|
||||
}
|
||||
roomFragment.updateSeatViewExchangedWithPitArray(mRoomInfoResp);
|
||||
}
|
||||
|
||||
@@ -1023,7 +1036,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
customMusicFloatingView.destroy();
|
||||
}
|
||||
AgoraManager.getInstance(RoomActivity.this).desMusic();
|
||||
stub.setVisibility(View.GONE);
|
||||
// stub.setVisibility(View.GONE);
|
||||
MvpPre.postRoomInfo(roomId);
|
||||
}
|
||||
|
||||
@@ -1673,6 +1686,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
if (event.isEffectOn()) {//特效开启
|
||||
mBinding.svgaGift.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
// mBinding.svgaGift.closeEffect();
|
||||
mBinding.svgaGift.closeEffect();
|
||||
mBinding.svgaGift.setVisibility(View.GONE);
|
||||
}
|
||||
@@ -1712,7 +1726,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
addActiveDialog(roomNoticeDialogFragment);
|
||||
} else if (id == R.id.btn_ranking) {//排行榜
|
||||
// RoomChartsFragment.newInstance(roomId).show(getSupportFragmentManager(), "RoomChartsFragment");
|
||||
RoomChartsFragment fragment = RoomChartsFragment.newInstance(roomId);
|
||||
RoomChartsFragment fragment = RoomChartsFragment.newInstance(roomId,mRoomInfoResp);
|
||||
fragment.show(getSupportFragmentManager(), "RoomChartsFragment");
|
||||
addActiveDialogFragment(fragment);
|
||||
} else if (id == R.id.btn_close_live) {
|
||||
@@ -1942,34 +1956,54 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
|
||||
public void setRoleType(int roleType, int pit_number) {
|
||||
RelativeLayout rl_voive = mBinding.rlVoive;
|
||||
RelativeLayout rl_voice = mBinding.rlVoive; // 注意:原拼写错误已修正
|
||||
RelativeLayout rl_mic = mBinding.rlMic;
|
||||
RelativeLayout rl_more = mBinding.rlMore;
|
||||
RelativeLayout rl_misc = mBinding.rlMisc;
|
||||
|
||||
// 默认隐藏所有按钮
|
||||
rl_voive.setVisibility(View.GONE);
|
||||
rl_voice.setVisibility(View.GONE);
|
||||
rl_more.setVisibility(View.GONE);
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
rl_mic.setVisibility(View.GONE);
|
||||
|
||||
// 空指针保护
|
||||
if (mRoomInfoResp == null || mRoomInfoResp.getRoom_info() == null || mRoomInfoResp.getUser_info() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String typeId = mRoomInfoResp.getRoom_info().getType_id();
|
||||
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
|
||||
int userPitNumber = mRoomInfoResp.getUser_info().getPit_number();
|
||||
|
||||
// 特殊房间类型处理(优先级最高)
|
||||
if ("6".equals(typeId)) {
|
||||
mBinding.rlMessage.setVisibility(View.GONE);
|
||||
return; // 全部隐藏,无需继续处理
|
||||
}
|
||||
|
||||
if ("7".equals(typeId)) {
|
||||
rl_more.setVisibility(View.GONE);
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 根据角色类型显示按钮
|
||||
switch (roleType) {
|
||||
case 2: // 主持人
|
||||
case 1: // 房主
|
||||
case 2: // 主持人
|
||||
case 3: // 麦上用户
|
||||
rl_voive.setVisibility(View.VISIBLE);
|
||||
rl_voice.setVisibility(View.VISIBLE);
|
||||
rl_mic.setVisibility(pit_number != 0 ? View.VISIBLE : View.GONE);
|
||||
rl_more.setVisibility(pit_number == 9 ? View.VISIBLE : View.GONE);
|
||||
rl_misc.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 0: // 观众
|
||||
rl_voive.setVisibility(View.VISIBLE);
|
||||
rl_voice.setVisibility(View.VISIBLE);
|
||||
rl_mic.setVisibility(pit_number != 0 ? View.VISIBLE : View.GONE);
|
||||
rl_misc.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case 5: // 房间管理员
|
||||
rl_voive.setVisibility(View.VISIBLE);
|
||||
rl_voice.setVisibility(View.VISIBLE);
|
||||
rl_more.setVisibility(View.GONE);
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
break;
|
||||
@@ -1977,51 +2011,41 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
break;
|
||||
}
|
||||
|
||||
if ("2".equals(mRoomInfoResp.getRoom_info().getType_id())) {
|
||||
// 类型房间规则覆盖
|
||||
if ("2".equals(typeId)) {
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
rl_more.setVisibility(View.GONE);
|
||||
} else if (roleType != 5) {
|
||||
rl_misc.setVisibility(View.VISIBLE);
|
||||
if (mRoomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
if (userPitNumber == 9) {
|
||||
rl_more.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (("1".equals(mRoomInfoResp.getRoom_info().getType_id()) ||
|
||||
"4".equals(mRoomInfoResp.getRoom_info().getType_id()) ||
|
||||
"3".equals(mRoomInfoResp.getRoom_info().getType_id())) &&
|
||||
"2".equals(mRoomInfoResp.getRoom_info().getLabel_id())) {
|
||||
// label_id 和 type_id 联合判断
|
||||
if (Arrays.asList("1", "3", "4").contains(typeId) && "2".equals(labelId)) {
|
||||
rl_more.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (mRoomInfoResp.getUser_info().getPit_number() > 0) {
|
||||
// mic 显示逻辑
|
||||
if (userPitNumber > 0) {
|
||||
rl_mic.setVisibility(View.VISIBLE);
|
||||
switchMic(2);
|
||||
} else {
|
||||
if (pit_number == 888) {
|
||||
rl_mic.setVisibility(View.VISIBLE);
|
||||
switchMic(2);
|
||||
} else if (pit_number== -1) {
|
||||
} else if (pit_number == -1) {
|
||||
rl_mic.setVisibility(View.VISIBLE); // 原代码此处缺少 View. 前缀,已补全
|
||||
switchMic(1);
|
||||
rl_mic.setVisibility(VISIBLE);
|
||||
}else {
|
||||
switchMic(2);
|
||||
} else {
|
||||
rl_mic.setVisibility(View.GONE);
|
||||
switchMic(2);
|
||||
}
|
||||
}
|
||||
|
||||
if ("6".equals(mRoomInfoResp.getRoom_info().getType_id())) {
|
||||
rl_voive.setVisibility(View.GONE);
|
||||
rl_more.setVisibility(View.GONE);
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
rl_mic.setVisibility(View.GONE);
|
||||
mBinding.rlMessage.setVisibility(View.GONE);
|
||||
} else if ("7".equals(mRoomInfoResp.getRoom_info().getType_id())) {
|
||||
rl_more.setVisibility(View.GONE);
|
||||
rl_misc.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void isMute(int is_mute) {
|
||||
RoomMessageEvent.text text = new RoomMessageEvent.text();
|
||||
text.setIs_mute(is_mute);
|
||||
@@ -2748,6 +2772,14 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
AgoraManager.getInstance(this).stopMuisc();
|
||||
initializeAudio();
|
||||
|
||||
if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2") || mRoomInfoResp.getRoom_info().getType_id().equals("7")){
|
||||
mBinding.rlMore.setVisibility(GONE);
|
||||
mBinding.rlMisc.setVisibility(GONE);
|
||||
}else if (mRoomInfoResp.getRoom_info().getLabel_id().equals("1") || mRoomInfoResp.getRoom_info().getType_id().equals("3") || mRoomInfoResp.getRoom_info().getType_id().equals("4")){
|
||||
mBinding.rlMore.setVisibility(VISIBLE);
|
||||
mBinding.rlMisc.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2760,7 +2792,7 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
|
||||
}
|
||||
|
||||
}else if (mRoomInfoResp.getRoom_info().getType_id().equals("2")){
|
||||
maxHeightDp=287;
|
||||
maxHeightDp=297;
|
||||
} if (mRoomInfoResp.getRoom_info().getType_id().equals("6")){
|
||||
maxHeightDp=333;
|
||||
}else if (mRoomInfoResp.getRoom_info().getType_id().equals("7")){
|
||||
|
||||
@@ -44,9 +44,9 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
} else {
|
||||
helper.setVisible(R.id.tv_pit, true);
|
||||
int pitNumber = Integer.parseInt(item.getPit_number());
|
||||
if (pitNumber>10){
|
||||
if (pitNumber > 10) {
|
||||
helper.setText(R.id.tv_pit, item.getNickname());
|
||||
}else {
|
||||
} else {
|
||||
helper.setText(R.id.tv_pit, String.format("%s号麦", item.getPit_number()));
|
||||
}
|
||||
if (item.getPit_number().equals("10")) {
|
||||
@@ -92,12 +92,29 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
int count = 1;
|
||||
List<RewardUserBean> data = getData();
|
||||
for (RewardUserBean item : data) {
|
||||
if (item.isSelect()) {
|
||||
count++;
|
||||
if (!item.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
if (item.isSelect()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
///获取当前选中的人数
|
||||
public int getUserIdCount(){
|
||||
int count = 0;
|
||||
List<RewardUserBean> data = getData();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (!data.get(i).getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
if (data.get(i).isSelect()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
public List<RewardUserBean> getSelectRoomPitUserModel() {
|
||||
List<RewardUserBean> selects = getData();
|
||||
@@ -114,7 +131,7 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
List<RewardUserBean> data = getData();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
if (!data.get(i).getUser_id().equals(SpUtil.getUserId()+"")) {
|
||||
if (!data.get(i).getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
if (data.get(i).isSelect()) {
|
||||
if (sb.length() > 0) {//该步即不会第一位有逗号,也防止最后一位拼接逗号!
|
||||
sb.append(",");
|
||||
@@ -134,9 +151,9 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
if (sb.length() > 0) {//该步即不会第一位有逗号,也防止最后一位拼接逗号!
|
||||
sb.append(",");
|
||||
}
|
||||
if (data!=null && data.get(i)!=null && data.get(i).getPit_number()!=null) {
|
||||
if (data != null && data.get(i) != null && data.get(i).getPit_number() != null) {
|
||||
sb.append(data.get(i).getPit_number());
|
||||
}else {
|
||||
} else {
|
||||
sb.append("");
|
||||
}
|
||||
}
|
||||
@@ -183,7 +200,7 @@ public class GiftUserAdapter extends BaseQuickAdapter<RewardUserBean, BaseViewHo
|
||||
for (RewardUserBean item : data) {
|
||||
if (item.isSelect()) {
|
||||
|
||||
ids.add(item.getUser_id());
|
||||
ids.add(item.getUser_id());
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -35,6 +36,7 @@ import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.adapter.GiftTwoDetailsFragment;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftNumBean;
|
||||
@@ -58,6 +60,7 @@ import com.xscm.moduleutil.presenter.RewardGiftPresenter;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.SystemUtils;
|
||||
import com.xscm.moduleutil.widget.dialog.KeyboardPopupWindow;
|
||||
import com.xscm.moduleutil.widget.dialog.SelectGiftNumPopupWindow;
|
||||
|
||||
@@ -245,7 +248,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
for (RoomPitBean bean : pitList) {
|
||||
if (bean.getPit_number().equals(targetPit) &&
|
||||
!bean.getUser_id().equals("0") && !bean.getUser_id().equals("") &&
|
||||
!bean.getUser_id().equals(SpUtil.getUserId())) {
|
||||
!bean.getUser_id().equals(SpUtil.getUserId()+"")) {
|
||||
|
||||
RewardUserBean rewardUserBean = new RewardUserBean();
|
||||
rewardUserBean.setUser_id(bean.getUser_id());
|
||||
@@ -299,6 +302,18 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
mBinding.tvGive.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.cz.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
|
||||
ViewGroup.LayoutParams layoutParams = mBinding.llGiftRule.getLayoutParams();
|
||||
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; // 使用你定义的getWidth方法
|
||||
layoutParams.height = SystemUtils.getWidth(74); // 示例高度
|
||||
mBinding.llGiftRule.setLayoutParams(layoutParams);
|
||||
|
||||
|
||||
float[] corners2 = {56f, 56f, 56f, 56f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvBbQs, ColorManager.getInstance().getPrimaryColorInt(), corners2);
|
||||
mBinding.tvBbQs.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
mBinding.tvBbQs.setOnClickListener(this::onClisk);
|
||||
}
|
||||
|
||||
private void onClisk(View view1) {
|
||||
@@ -334,9 +349,9 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
giftNumber = mGiftNumList.get(i).getNumber();
|
||||
}
|
||||
}
|
||||
if (packType==1) {
|
||||
if (packType == 1) {
|
||||
giveGift(giftNumber);
|
||||
}else {
|
||||
} else {
|
||||
giveGift(giftNumber);
|
||||
}
|
||||
} else if (view1.getId() == R.id.cz) {
|
||||
@@ -352,6 +367,17 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
all = !all;
|
||||
oldSelectedIds.clear();
|
||||
oldSelectedIds.addAll(gifyuseradapter.getAllSelectedIds());
|
||||
}else if (view1.getId() == R.id.tv_bb_qs){
|
||||
int count =gifyuseradapter.getSelectCount();
|
||||
if (count<0){
|
||||
ToastUtils.show("请选择打赏的用户");
|
||||
return;
|
||||
}
|
||||
if (gifyuseradapter.getUserIdCount()>1){
|
||||
ToastUtils.show("一键全送只能选择一个用户");
|
||||
return;
|
||||
}
|
||||
MvpPre.getGiftPack(roomId,gifyuseradapter.getUserIdToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +389,7 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftDoubleClickEvent(GiftDoubleClickEvent event) {
|
||||
getSelectedGift();
|
||||
packType=1;
|
||||
packType = 1;
|
||||
|
||||
}
|
||||
|
||||
@@ -486,24 +512,24 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
// return;
|
||||
// }
|
||||
// } else {
|
||||
if (roonGiftModel == null) {
|
||||
ToastUtils.show("请选择礼物");
|
||||
return;
|
||||
}
|
||||
int count = gifyuseradapter.getSelectCount();
|
||||
if (count <= 0) {
|
||||
ToastUtils.show("请选择打赏对象");
|
||||
return;
|
||||
}
|
||||
if (roonGiftModel == null) {
|
||||
ToastUtils.show("请选择礼物");
|
||||
return;
|
||||
}
|
||||
int count = gifyuseradapter.getSelectCount();
|
||||
if (count <= 0) {
|
||||
ToastUtils.show("请选择打赏对象");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(num)) {
|
||||
ToastUtils.show("请选择打赏礼物数量");
|
||||
return;
|
||||
}
|
||||
if (Integer.valueOf(num) <= 0) {
|
||||
ToastUtils.show("请选择打赏礼物数量");
|
||||
return;
|
||||
}
|
||||
if (TextUtils.isEmpty(num)) {
|
||||
ToastUtils.show("请选择打赏礼物数量");
|
||||
return;
|
||||
}
|
||||
if (Integer.valueOf(num) <= 0) {
|
||||
ToastUtils.show("请选择打赏礼物数量");
|
||||
return;
|
||||
}
|
||||
// }
|
||||
if (roonGiftModel != null && roonGiftModel.getGift_id() != null) {
|
||||
if (currentItem != 0) {
|
||||
@@ -541,7 +567,9 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
}
|
||||
} else if (currentItem == 0) {
|
||||
giftNumber = num;
|
||||
beibaoId = roonGiftModel.getGift_id();
|
||||
MvpPre.roomGift(roomId, roonGiftModel.getGift_id(), giftNumber, userId, "2", pit, heart_id);
|
||||
|
||||
} else {
|
||||
//背包礼物打赏
|
||||
// giftNumber = num;
|
||||
@@ -555,6 +583,8 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
}
|
||||
}
|
||||
|
||||
private String beibaoId;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_gift_dialog;
|
||||
@@ -572,10 +602,12 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
mBinding.rvGiftUser.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
private List<GiftLabelBean> giftLabelBeanList;
|
||||
|
||||
private List<GiftLabelBean> giftLabelBeanList;
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
giftLabelBeanList=new ArrayList<>();
|
||||
giftLabelBeanList = new ArrayList<>();
|
||||
giftLabelBeanList.addAll(giftLabelBeans);
|
||||
GiftLabelBean giftLabelBean = new GiftLabelBean();
|
||||
giftLabelBean.setId("0");
|
||||
@@ -585,25 +617,43 @@ private List<GiftLabelBean> giftLabelBeanList;
|
||||
mBinding.viewPager.setOffscreenPageLimit(0);
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(1);
|
||||
mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
// // 在 initView() 方法中添加
|
||||
// mBinding.viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
// @Override
|
||||
// public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onPageSelected(int position) {
|
||||
// // 页面切换时更新选中状态
|
||||
// updateGiftSelection(position);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onPageScrollStateChanged(int state) {
|
||||
// }
|
||||
// });
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
// 当页面切换时,控制 tv_bb_qs 按钮的显示
|
||||
updateTvBbQsVisibility(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
// 初始化时设置按钮可见性
|
||||
updateTvBbQsVisibility(1);
|
||||
}
|
||||
|
||||
// 控制 tv_bb_qs 按钮显示的方法
|
||||
private void updateTvBbQsVisibility(int currentPosition) {
|
||||
// 假设你希望在特定位置(例如位置1)显示按钮
|
||||
if (currentPosition == 0) { // 根据你的需求调整位置
|
||||
// 显示按钮
|
||||
if (mBinding.tvBbQs != null) {
|
||||
mBinding.tvBbQs.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
// 隐藏按钮
|
||||
if (mBinding.tvBbQs != null) {
|
||||
mBinding.tvBbQs.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGiftList(List<RoonGiftModel> roonGiftModels, int type) {
|
||||
|
||||
@@ -612,6 +662,13 @@ private List<GiftLabelBean> giftLabelBeanList;
|
||||
@Override
|
||||
public void giveGift() {
|
||||
// dismiss();
|
||||
|
||||
if (mBinding.viewPager.getCurrentItem() == 0) {
|
||||
MvpPre.wallet();
|
||||
EventBus.getDefault().post(beibaoId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (roomGiftGiveEvent != null) {
|
||||
EventBus.getDefault().post(roomGiftGiveEvent);
|
||||
roomGiftGiveEvent = null;
|
||||
@@ -649,7 +706,17 @@ private List<GiftLabelBean> giftLabelBeanList;
|
||||
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
@Override
|
||||
public void getGiftPack(String s) {
|
||||
if (s!=null){
|
||||
com.hjq.toast.ToastUtils.show( s);
|
||||
dismiss();
|
||||
}else {
|
||||
com.hjq.toast.ToastUtils.show("一键全清背包礼物失败");
|
||||
}
|
||||
}
|
||||
|
||||
private class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<GiftLabelBean> list;
|
||||
private List<Fragment> fragmentList;
|
||||
@@ -678,11 +745,9 @@ private List<GiftLabelBean> giftLabelBeanList;
|
||||
if (position < fragmentList.size() && fragmentList.get(position) != null) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
// 创建新的 Fragment
|
||||
GiftLabelBean model = list.get(position);
|
||||
Fragment fragment = GiftTwoDetailsFragment.newInstance(model.getId(), 1, roomId);
|
||||
|
||||
// 确保 fragmentList 有足够的空间
|
||||
while (fragmentList.size() <= position) {
|
||||
fragmentList.add(null);
|
||||
|
||||
@@ -126,16 +126,12 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
|
||||
|
||||
mBinding.ivAvatar.setOnClickListener(this::onClick);
|
||||
mBinding.roomMCz.setOnClickListener(this::onClick);
|
||||
mBinding.roomDian.setOnClickListener(this::onClick);
|
||||
@@ -151,6 +147,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.textView1.setOnClickListener(this::onClick);
|
||||
mBinding.textView2.setOnClickListener(this::onClick);
|
||||
mBinding.moreButton.setOnClickListener(this::onClick);
|
||||
mBinding.imQml.setOnClickListener(this::onClick);
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.roomMCz, ColorManager.getInstance().getPrimaryColorInt(), 65);
|
||||
mBinding.roomMCz.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
@@ -224,6 +221,8 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
dianj(1);
|
||||
}else if (id==R.id.textView2){
|
||||
dianj(2);
|
||||
}else if (id==R.id.im_qml){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +215,11 @@ public class RoomWheatGiftSettingFragment extends BaseMvpDialogFragment<RewardGi
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getGiftPack(String s) {
|
||||
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
@@ -11,14 +11,18 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RankingCharmListAdapter;
|
||||
import com.example.moduleroom.contacts.DataListContacts;
|
||||
import com.example.moduleroom.databinding.RoomRankingChildBinding;
|
||||
import com.example.moduleroom.dialog.RoomUserInfoFragment;
|
||||
import com.example.moduleroom.presenter.DataListPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CharmRankingResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView;
|
||||
|
||||
@@ -43,18 +47,20 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
private RankingCharmListAdapter wAdapter;//财富适配器
|
||||
// private RankingWealthListAdapter wAdapter;//财富适配器
|
||||
private CommonEmptyView commonEmptyView;
|
||||
private RoomInfoResp roomInfoResp;
|
||||
|
||||
/**
|
||||
* newInstance 初始化fragment
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static RankingChildFragment newInstance(String roomId, int dataType, int rankType) {
|
||||
public static RankingChildFragment newInstance(String roomId, int dataType, int rankType, RoomInfoResp roomInfoResp) {
|
||||
RankingChildFragment rankingChildFragment = new RankingChildFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("roomId", roomId);
|
||||
bundle.putInt("dataType", dataType);
|
||||
bundle.putInt("rankType", rankType);
|
||||
bundle.putSerializable("roomInfoResp", roomInfoResp);
|
||||
rankingChildFragment.setArguments(bundle);
|
||||
return rankingChildFragment;
|
||||
}
|
||||
@@ -70,6 +76,7 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
roomId = getArguments().getString("roomId");
|
||||
dataType = getArguments().getInt("dataType");
|
||||
rankType = getArguments().getInt("rankType");
|
||||
roomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,7 +121,10 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
if (view.getId() == R.id.room_item_head) {
|
||||
CharmRankingResp item = cAdapter.getItem(position);
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", item.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
|
||||
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -123,6 +133,9 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
if (view.getId() == R.id.room_item_head) {
|
||||
CharmRankingResp item = wAdapter.getItem(position);
|
||||
|
||||
RoomUserInfoFragment.show(roomId,item.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
|
||||
// WealthRankingResp.ListsBean item = wAdapter.getItem(position);
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", item.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
}
|
||||
@@ -130,7 +143,38 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 这是判断当前用户是否是麦上房主、管理员、主持,不在主持麦的都是不同用户
|
||||
* 2025-7-31 10:42:37,新添加的要求:根据角色不同,显示不同的按钮
|
||||
* 房主不论麦上麦下,有全部权限 管理员、主持:不论麦上麦下,有部分权限 用户:只有举报拉黑权限
|
||||
* 所有的是从下往上看数据的时候,只有举报和拉黑
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private int getHostUser() {
|
||||
if (roomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1) {
|
||||
return 1;
|
||||
} else if (roomInfoResp.getUser_info().getIs_management() == 1) {
|
||||
return 2;
|
||||
} else if (roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||
return 3;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
} else {
|
||||
if (roomInfoResp.getUser_info().getIs_room_owner() == 1) {
|
||||
return 1;
|
||||
}
|
||||
if (roomInfoResp.getUser_info().getIs_management() == 1) {
|
||||
return 2;
|
||||
}
|
||||
if (roomInfoResp.getUser_info().getIs_host() == 1) {
|
||||
return 3;
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -148,6 +192,8 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
mBinding.roomRankTop1HeadIcon.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
}
|
||||
});
|
||||
@@ -162,6 +208,8 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
mBinding.roomRankTop2HeadIcon.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
}
|
||||
});
|
||||
@@ -198,6 +246,8 @@ public class RankingChildFragment extends BaseMvpFragment<DataListPresenter, Roo
|
||||
mBinding.roomRankTop3HeadIcon.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
RoomUserInfoFragment.show(roomId,listsBean.getUser_id(), "", getHostUser(), true, 3, 0, getChildFragmentManager());
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", listsBean.getUser_id()).withBoolean("returnRoom", true).navigation();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.example.moduleroom.databinding.RoomRankingParentBinding;
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -28,12 +29,13 @@ public class RankingParentFragment extends BaseMvpFragment<IPresenter, RoomRanki
|
||||
private static String mRoomId;//房间ID
|
||||
private static int rankType = 1;//统计类型(魅力 / 财富)
|
||||
// private static int dataType = 1;//统计周期(日/周/月)
|
||||
private RoomInfoResp roomInfoResp;
|
||||
|
||||
|
||||
public static RankingParentFragment newInstance(String roomId,int rankType) {
|
||||
public static RankingParentFragment newInstance(String roomId,int rankType,RoomInfoResp roomInfoResp) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("roomId", roomId);
|
||||
args.putInt("rankType", rankType);
|
||||
args.putSerializable("roomInfoResp", roomInfoResp);
|
||||
RankingParentFragment fragment = new RankingParentFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
@@ -44,6 +46,7 @@ public class RankingParentFragment extends BaseMvpFragment<IPresenter, RoomRanki
|
||||
super.initArgs(arguments);
|
||||
mRoomId = arguments.getString("roomId");
|
||||
rankType = arguments.getInt("rankType");
|
||||
roomInfoResp = (RoomInfoResp) arguments.getSerializable("roomInfoResp");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,9 +57,9 @@ public class RankingParentFragment extends BaseMvpFragment<IPresenter, RoomRanki
|
||||
@Override
|
||||
protected void initData() {
|
||||
List<Fragment> fragments = new ArrayList<>();
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_DATA, rankType));
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_WEEK, rankType));
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_MON, rankType));
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_DATA, rankType, roomInfoResp));
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_WEEK, rankType, roomInfoResp));
|
||||
fragments.add(RankingChildFragment.newInstance(mRoomId, TYPE_MON, rankType, roomInfoResp));
|
||||
MyFragmentPagerAdapter myFragmentPagerAdapter = new MyFragmentPagerAdapter(fragments, getChildFragmentManager());
|
||||
mBinding.vpRankChild.setAdapter(myFragmentPagerAdapter);
|
||||
String[] title = new String[]{"日榜", "周榜", "月榜"};
|
||||
|
||||
@@ -132,6 +132,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
if (roomPitBean.getUser_id() != null && !roomPitBean.getUser_id().isEmpty() && !roomPitBean.getUser_id().equals("0")) {
|
||||
roomPitBean.setIs_pm(1);
|
||||
wheatView.setData(roomPitBean);
|
||||
|
||||
if (imActionJs != null)
|
||||
imActionJs.setVisibility(VISIBLE);
|
||||
} else {
|
||||
@@ -143,12 +144,13 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
pitBean.setSex("");
|
||||
pitBean.setCharm("");
|
||||
wheatView.setData(pitBean);
|
||||
|
||||
}
|
||||
parentFragment = (RoomFragment) getParentFragment();
|
||||
|
||||
roomAuction = roomInfoResp.getRoom_auction();
|
||||
if (roomAuction != null) {
|
||||
if (roomAuction.getAuction_user() != null && roomAuction.getAuction_user().getAuction_id() != null) {
|
||||
if (roomAuction.getAuction_user() != null ) {
|
||||
auctionUserBean = roomAuction.getAuction_user();
|
||||
RoomPitBean roomPitBean1 = new RoomPitBean();
|
||||
roomPitBean1.setUser_id(auctionUserBean.getUser_id());
|
||||
@@ -184,9 +186,17 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
}
|
||||
mBinding.ivJp.setVisibility(VISIBLE);
|
||||
}
|
||||
gengv();
|
||||
auctionId = auctionUserBean.getAuction_id();
|
||||
SpUtil.setAuctionId(auctionId);
|
||||
|
||||
if (auctionUserBean.getAuction_id()!=null) {
|
||||
mBinding.ivJp.setVisibility(VISIBLE);
|
||||
gengv();
|
||||
auctionId = auctionUserBean.getAuction_id();
|
||||
SpUtil.setAuctionId(auctionId);
|
||||
}else {
|
||||
SpUtil.setAuctionId("");
|
||||
mBinding.ivJp.setVisibility(INVISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
if (roomAuction.getAuction_list() != null && roomAuction.getAuction_list().size() > 0) {
|
||||
auctionList = roomAuction.getAuction_list();
|
||||
@@ -207,7 +217,7 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
auctionId = "";
|
||||
SpUtil.setAuctionId("");
|
||||
}
|
||||
tzblChanged();
|
||||
tzblChanged();//获取在线列表数据
|
||||
RoomPitBean roomPitBean2 = wheatView.pitBean;
|
||||
if (roomPitBean2 != null && roomPitBean2.getUser_id() != null && !roomPitBean2.getUser_id().equals("0")) {
|
||||
if (roomPitBean2.getUser_id().equals(SpUtil.getUserId() + "")) {
|
||||
@@ -359,10 +369,10 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
RoomOnlineDialogFragment.show(roomInfoResp.getRoom_info().getRoom_id(), 888 + "", roomInfoResp.getUser_info(), roomInfoResp, getChildFragmentManager());
|
||||
}
|
||||
} else {
|
||||
if (roomInfoResp.getRoom_auction().getAuction_user() != null) {
|
||||
// if (roomInfoResp.getRoom_auction().getAuction_user() != null) {
|
||||
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), wheatView2.getUserId(), wheatView2.pitNumber, getHostUser(), false, 1, Integer.parseInt(roomInfoResp.getRoom_auction().getAuction_user().getAuction_id() != null ? roomInfoResp.getRoom_auction().getAuction_user().getAuction_id() : "0"), getChildFragmentManager());
|
||||
}
|
||||
// }
|
||||
}
|
||||
} else if (id == R.id.im_action_js) {//延时
|
||||
MvpPre.auctionDelay(SpUtil.getauctionId());
|
||||
@@ -1299,6 +1309,10 @@ public class RoomAuctionFragment extends BaseMvpFragment<RoomAuctionPresenterTow
|
||||
if (EventBus.getDefault().isRegistered(this)) {
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
if (stub!=null) {
|
||||
stub.setVisibility(GONE);
|
||||
stub = null;
|
||||
}
|
||||
isButtonsInflated = false;
|
||||
releaseCountDownTimer();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.example.moduleroom.presenter.RoomChartsPresenter;
|
||||
import com.example.moduletablayout.listener.CustomTabEntity;
|
||||
import com.example.moduletablayout.listener.OnTabSelectListener;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -32,11 +33,13 @@ public class RoomChartsFragment extends BaseMvpDialogFragment<RoomChartsPresente
|
||||
public static final int TYPE_WEALTH = 2;//魅力榜
|
||||
private int type = TYPE_CHARM;
|
||||
private int childType = RankingChildFragment.TYPE_DATA;
|
||||
private RoomInfoResp mRoomInfoResp;
|
||||
|
||||
public static RoomChartsFragment newInstance(String roomId) {
|
||||
public static RoomChartsFragment newInstance(String roomId,RoomInfoResp roomInfoResp) {
|
||||
RoomChartsFragment roomRankingFragment = new RoomChartsFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("roomId", roomId);
|
||||
bundle.putSerializable("roomInfoResp", roomInfoResp);
|
||||
roomRankingFragment.setArguments(bundle);
|
||||
return roomRankingFragment;
|
||||
}
|
||||
@@ -63,12 +66,13 @@ public class RoomChartsFragment extends BaseMvpDialogFragment<RoomChartsPresente
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
mRoomId = getArguments().getString("roomId");
|
||||
mRoomInfoResp = (RoomInfoResp) getArguments().getSerializable("roomInfoResp");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
FragmentUtils.add(getChildFragmentManager(), RankingChildFragment.newInstance(mRoomId, childType, type), R.id.fl_content);
|
||||
FragmentUtils.add(getChildFragmentManager(), RankingChildFragment.newInstance(mRoomId, childType, type, mRoomInfoResp), R.id.fl_content);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -106,7 +110,7 @@ public class RoomChartsFragment extends BaseMvpDialogFragment<RoomChartsPresente
|
||||
mBinding.tvWealth.setOnClickListener(this::onViewClicked);
|
||||
}
|
||||
private void refresh() {
|
||||
FragmentUtils.replace(getChildFragmentManager(), RankingChildFragment.newInstance(mRoomId, childType, type), R.id.fl_content);
|
||||
FragmentUtils.replace(getChildFragmentManager(), RankingChildFragment.newInstance(mRoomId, childType, type, mRoomInfoResp), R.id.fl_content);
|
||||
}
|
||||
|
||||
public static class TabItem implements CustomTabEntity {
|
||||
|
||||
@@ -451,7 +451,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
pitNumber = pitBean.getPit_number();
|
||||
roomPitBean = pitBean;
|
||||
showPopupMenu(view); // v 是点击的按钮视图
|
||||
} else if (pitNumber1 == 10 && roomInfoResp.getUser_info().getPit_number() == 9) {
|
||||
} else if (pitNumber1 == 10 && isUserHostOfRoom() ) {
|
||||
RoomOnlineDialogFragment.show(roomId, pitNumber1 + "", roomInfoResp.getUser_info(), roomInfoResp, getChildFragmentManager());
|
||||
} else if (pitNumber1 != 10) {
|
||||
MvpPre.applyPit(roomId, pitNumber1 + "");
|
||||
@@ -504,6 +504,28 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
mBinding.imMkf.setOnClickListener(this::onClick);
|
||||
|
||||
}
|
||||
/**
|
||||
* 检查当前用户是否是房间的主持人
|
||||
* @return true表示是主持人,false表示不是主持人或数据不完整
|
||||
*/
|
||||
private boolean isUserHostOfRoom() {
|
||||
// 先检查列表是否为空或大小不足
|
||||
if (ObjectUtils.isEmpty(roomInfoResp.getRoom_info().getPit_list()) ||
|
||||
roomInfoResp.getRoom_info().getPit_list().size() < 10) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查第9个麦位(索引为8)的用户ID是否存在且与当前用户ID匹配
|
||||
RoomPitBean hostPitBean = roomInfoResp.getRoom_info().getPit_list().get(8);
|
||||
if (hostPitBean == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String hostUserId = hostPitBean.getUser_id();
|
||||
return hostUserId != null &&
|
||||
!hostUserId.isEmpty() &&
|
||||
hostUserId.equals(SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
public void onWheatClicked(View ii) {
|
||||
RoomDefaultWheatView view = (RoomDefaultWheatView) ii;
|
||||
|
||||
@@ -120,8 +120,8 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
@@ -111,6 +111,17 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_qml"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_22"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:src="@mipmap/qgrml"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kb" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_gs"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
@@ -120,7 +131,24 @@
|
||||
android:src="@mipmap/gsui"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kb" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_qml"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_qing"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_22"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:src="@mipmap/gsui"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/kb"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_m_cz"
|
||||
|
||||
@@ -179,6 +179,20 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bb_qs"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/ll_gift_num"
|
||||
android:background="@drawable/bg_r53_0dffb9"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:gravity="center"
|
||||
android:text="一键全送"
|
||||
android:textColor="#0DFFB9"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_gift_num"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/stub_buttons"
|
||||
android:id="@+id/stub_buttons2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
|
||||
Reference in New Issue
Block a user