我的房间

This commit is contained in:
2025-11-03 15:30:57 +08:00
parent 331b33fdd7
commit 10f24b4b69
13 changed files with 189 additions and 270 deletions

View File

@@ -721,7 +721,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
).show()
}
fun isAuctionTopBtVisible(isShow: Boolean) {
fun isInAuctionTopBtVisible(isShow: Boolean) {
mBinding!!.roomTop.rl.visibility = View.GONE
mBinding!!.roomTop.stubButtons2.visibility = if (isShow) View.VISIBLE else View.GONE
}

View File

@@ -6,7 +6,6 @@ import android.os.CountDownTimer;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
@@ -266,14 +265,14 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
RoomType roomType = RoomType.Companion.fromTypeId(typeId);
mRoomActivity.isAuctionTopBtVisible(false);
mRoomActivity.isInAuctionTopBtVisible(false);
if (roomType == RoomType.MUTUAL_ENTERTAINMENT) {
if (friendshipRoomFragment != null && friendshipRoomFragment.isAdded()) {
friendshipRoomFragment.roomInfoUpdate(mRoomInfoResp);
}
} else if (roomType == RoomType.AUCTION) {
mRoomActivity.isAuctionTopBtVisible(true);
mRoomActivity.isInAuctionTopBtVisible(true);
if (roomAuctionFragment != null && roomAuctionFragment.isAdded()) {
roomAuctionFragment.roomInfoUpdate(mRoomInfoResp);
}
@@ -368,7 +367,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
Fragment newFragment = null;
mRoomActivity.isAuctionTopBtVisible(false);
mRoomActivity.isInAuctionTopBtVisible(false);
RoomType roomType = RoomType.Companion.fromTypeId(typeId);
if (roomType == RoomType.MUTUAL_ENTERTAINMENT) {
if (friendshipRoomFragment == null) {
@@ -378,7 +377,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
newFragment = friendshipRoomFragment;
} else if (roomType == RoomType.AUCTION) {
mRoomActivity.isAuctionTopBtVisible(true);
mRoomActivity.isInAuctionTopBtVisible(true);
if (roomAuctionFragment == null)
roomAuctionFragment = RoomAuctionFragment.newInstance(mRoomInfoResp);
else {

View File

@@ -1,20 +1,24 @@
package com.xscm.modulemain.activity.user.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.main.activity.MainActivity;
import com.xscm.modulemain.databinding.ActivityCreatedRoomBinding;
import com.example.zhouwei.library.CustomPopWindow;
import com.hjq.toast.ToastUtils;
@@ -78,6 +82,34 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
}
};
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
// 拦截返回键,显示退出对话框而不是直接退出
singleTaskToActivity(MyRoomActivity.class);
finish();
return true;
}
return false;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 添加返回键拦截处理
if (getOnBackPressedDispatcher() != null) {
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
@Override
public void handleOnBackPressed() {
// 拦截返回键,导航到个人中心页面而不是直接退出
singleTaskToActivity(MyRoomActivity.class);
finish();
}
});
}
}
@Override
protected CreatedRoomPresenter bindPresenter() {
return new CreatedRoomPresenter(this, this);
@@ -115,6 +147,16 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
mBinding.tvSave.setOnClickListener(this::onClick);
mBinding.ivTrendContent.setOnClickListener(this::onClick);
mBinding.tvSz.setText("0/" + maxNum);
mBinding.topBar.getIvBack().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
singleTaskToActivity(MyRoomActivity.class);
finish();
}
});
mBinding.etG.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@@ -254,13 +296,16 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
@Override
public void checkTxtSuccess(String result) {
ARouter.getInstance().build(ARouteConstants.MY_ROOM).withFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT).navigation();
// 拦截返回键,显示退出对话框而不是直接退出
singleTaskToActivity(MyRoomActivity.class);
finish();
}
@Override
public void addUserRoomSuccess(String roomId) {
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "创建房间").withString("roomId", roomId).navigation();
// 拦截返回键,显示退出对话框而不是直接退出
singleTaskToActivity(MyRoomActivity.class);
finish();
}
@@ -280,7 +325,8 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
@Override
public void editRoom() {
ARouter.getInstance().build(ARouteConstants.MY_ROOM).withFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT).navigation();
// 拦截返回键,显示退出对话框而不是直接退出
singleTaskToActivity(MyRoomActivity.class);
finish();
}

View File

@@ -8,6 +8,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.Nullable;
@@ -56,6 +57,17 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
public String from;
public int auth_status;
public String roomId;
// 1. 定义样式常量(颜色需在初始化时获取,避免提前调用资源)
private int colorSelected;
private int colorUnselected;
private static final float TEXT_SIZE_SELECTED = 16f;
private static final float TEXT_SIZE_UNSELECTED = 14f;
private static final Typeface TYPEFACE_BOLD = Typeface.DEFAULT_BOLD;
private static final Typeface TYPEFACE_NORMAL = Typeface.DEFAULT;
// 2. 建立索引与视图的映射关系(两个数组分别对应:文本视图、下划线视图,顺序对应 index 0-3
private TextView[] textViews;
private View[] lineViews;
@Override
protected MyRoomPresenter bindPresenter() {
@@ -74,9 +86,6 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
return false;
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -91,12 +100,16 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
}
});
}
initViewStyles();
updateSelectedState(0);
}
@Override
protected void initData() {
mBinding.viewPager.setAdapter(new MyFragmentAdapter(getSupportFragmentManager()));
mBinding.viewPager.setOffscreenPageLimit(0);
mBinding.viewPager.setOffscreenPageLimit(3);
mBinding.tvCharm.setOnClickListener(v -> {
resetTab(0);
});
@@ -116,104 +129,7 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
resetTab(position); // 同步更新 Tab 样式
}
});
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextSize(16);
mBinding.tvWealth.setTextSize(14);
mBinding.tvManage.setTextSize(14);
mBinding.tvInterest.setTextSize(14);
mBinding.tvCharm.setTypeface(null, Typeface.BOLD);
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
mBinding.vLine.setVisibility(View.VISIBLE);
mBinding.vLine2.setVisibility(View.GONE);
mBinding.vLine3.setVisibility(View.GONE);
mBinding.vLine4.setVisibility(View.GONE);
}
private void resetTab(int index) {
if (mBinding.viewPager.getCurrentItem() == index) {
return; // 已处于目标页面,无需重复操作
}
if (index == 0) {
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextSize(16);
mBinding.tvWealth.setTextSize(14);
mBinding.tvManage.setTextSize(14);
mBinding.tvInterest.setTextSize(14);
mBinding.tvCharm.setTypeface(null, Typeface.BOLD);
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
mBinding.vLine.setVisibility(View.VISIBLE);
mBinding.vLine2.setVisibility(View.GONE);
mBinding.vLine3.setVisibility(View.GONE);
mBinding.vLine4.setVisibility(View.GONE);
} else if (index == 1) {
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextSize(14);
mBinding.tvWealth.setTextSize(16);
mBinding.tvManage.setTextSize(14);
mBinding.tvInterest.setTextSize(14);
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
mBinding.tvWealth.setTypeface(null, Typeface.BOLD);
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
mBinding.vLine.setVisibility(View.GONE);
mBinding.vLine2.setVisibility(View.VISIBLE);
mBinding.vLine3.setVisibility(View.GONE);
mBinding.vLine4.setVisibility(View.GONE);
} else if (index == 2) {
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextSize(14);
mBinding.tvWealth.setTextSize(14);
mBinding.tvManage.setTextSize(16);
mBinding.tvInterest.setTextSize(14);
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
mBinding.tvManage.setTypeface(null, Typeface.BOLD);
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
mBinding.vLine.setVisibility(View.GONE);
mBinding.vLine2.setVisibility(View.GONE);
mBinding.vLine3.setVisibility(View.VISIBLE);
mBinding.vLine4.setVisibility(View.GONE);
} else if (index == 3) {
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
mBinding.tvCharm.setTextSize(14);
mBinding.tvWealth.setTextSize(14);
mBinding.tvManage.setTextSize(14);
mBinding.tvInterest.setTextSize(16);
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
mBinding.tvInterest.setTypeface(null, Typeface.BOLD);
mBinding.vLine.setVisibility(View.GONE);
mBinding.vLine2.setVisibility(View.GONE);
mBinding.vLine3.setVisibility(View.GONE);
mBinding.vLine4.setVisibility(View.VISIBLE);
}
mBinding.viewPager.setCurrentItem(index); // 禁用平滑滚动
}
@Override
protected int getLayoutId() {
return R.layout.room_activity_my_room;
@@ -246,6 +162,63 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
});
initListener();
}
// 在初始化方法中(如 onCreate、onViewCreated初始化常量和映射关系
private void initViewStyles() {
// 初始化颜色(需在上下文可用时调用,如 Activity 的 onCreate 中)
colorSelected = getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85);
colorUnselected = getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45);
// 初始化视图映射(顺序必须与 index 0-3 对应)
textViews = new TextView[]{
mBinding.tvCharm,
mBinding.tvWealth,
mBinding.tvManage,
mBinding.tvInterest
};
lineViews = new View[]{
mBinding.vLine,
mBinding.vLine2,
mBinding.vLine3,
mBinding.vLine4
};
}
// 3. 统一处理选中状态的方法
private void updateSelectedState(int index) {
// 校验索引合法性(避免越界)
if (index < 0 || index >= textViews.length) {
return;
}
// 先重置所有视图为“未选中状态”
for (int i = 0; i < textViews.length; i++) {
TextView textView = textViews[i];
View lineView = lineViews[i];
textView.setTextColor(colorUnselected);
textView.setTextSize(TEXT_SIZE_UNSELECTED);
textView.setTypeface(TYPEFACE_NORMAL);
lineView.setVisibility(View.GONE);
}
// 再激活当前 index 对应的“选中状态”
TextView selectedText = textViews[index];
View selectedLine = lineViews[index];
selectedText.setTextColor(colorSelected);
selectedText.setTextSize(TEXT_SIZE_SELECTED);
selectedText.setTypeface(TYPEFACE_BOLD);
selectedLine.setVisibility(View.VISIBLE);
}
private void resetTab(int index) {
if (mBinding.viewPager.getCurrentItem() == index) {
return; // 已处于目标页面,无需重复操作
}
updateSelectedState(index);
mBinding.viewPager.setCurrentItem(index); // 禁用平滑滚动
}
public void isShowLoading(boolean b) {
if (b) {
@@ -272,11 +245,7 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
} else {
mBinding.ll.setVisibility(View.INVISIBLE);
}
// if (CommonAppContext.getInstance().isPlaying && CommonAppContext.getInstance().isShow) {
// RoomManager.getInstance().fetchRoomDataAndEnter(getApplicationContext(), CommonAppContext.getInstance().playId,"");
//
//// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
// }
}
private final Runnable mRivAnimationTask = () -> {
@@ -288,18 +257,10 @@ public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivit
mBinding.topBar.addIntentListener(new CustomTopBar.OnCallBackRightIcon() {
@Override
public void onIntent() {
// if ("我的界面".equals(from)) {
// if (auth_status == 0) {
// ToastUtils.show("实名认证后才能创建直播间");
// MvpPre.getNameAuthResult(0);
// return;
// }
// startActivity(new Intent(MyRoomActivity.this,CreatedRoomActivity.class));
// }
if (!SpUtil.getRealName()) {
ToastUtils.show("实名认证后才能创建直播间");
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
// startActivity(new Intent(MyRoomActivity.this, RealName1Activity.class));
return;
}
startActivity(new Intent(MyRoomActivity.this, CreatedRoomActivity.class));

View File

@@ -33,14 +33,8 @@ import java.util.List;
*/
public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragmentMyCreateBinding> implements MyRoomListContacts.View {
public static final int TYPE_CREATE = 0;
public static final int TYPE_HOST = 1;
private int type;
private BaseQuickAdapter<MyRoomBean, BaseViewHolder> mAdapter;
private int page = 1;
private ChatRoomMyFootAdapter mChatRoomMyFootAdapter;
private MyCreateAdapter adapter;
private List<ViewItem> viewItems = new ArrayList<>();
public static MyCreateFragment newInstance(int type) {
@@ -56,25 +50,14 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
return new MyRoomPresenter(this, getContext());
}
@Override
public void initArgs(Bundle arguments) {
super.initArgs(arguments);
type = arguments.getInt("type", MyCreateFragment.TYPE_CREATE);
}
@Override
protected void initData() {
}
@Override
public void onResume() {
super.onResume();
viewItems = new ArrayList<>();
MvpPre.getCharmList(0,page+"");//我创建的
}
private void showDelFootDialog() {
if (isAdded() && getActivity() != null) {
CommonDialog commonDialog = new CommonDialog(getActivity());
@@ -96,7 +79,6 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
@Override
protected void initView() {
GridLayoutManager layoutManager = new GridLayoutManager(requireContext(), 2); // 最大支持 4 列
mBinding.rvMyRoomList.setLayoutManager(layoutManager);
mBinding.rvMyRoomList.setAdapter(adapter = new MyCreateAdapter());
@@ -120,17 +102,8 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
}
}
});
// mBinding.rvMyRoomList.setLayoutManager(new LinearLayoutManager(getContext()));
// adapter.bindToRecyclerView(mBinding.rvMyRoomList);
adapter.setOnImageClickListener(new MyCreateAdapter.OnImageClickListener() {
@Override
public void onImageClick(View view, RoomData roomData) {
showDelFootDialog();
}
});
adapter.setOnImageClickListener((view, roomData) -> showDelFootDialog());
}
@Override
@@ -146,16 +119,12 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
@Override
public void setList(List<MyRoomBean> list, int type) {
// TODO: 刷新列表
if (list != null) {
mBinding.rvMyRoomList.setVisibility(View.VISIBLE);
mBinding.tvNoData.setVisibility(View.GONE);
for (MyRoomBean item : list) {
viewItems.add(new ViewItem(ViewItem.TYPE_RELATION, item));
}
// adapter.submitList(viewItems);
}
MvpPre.myCpRoom();
adapter.submitList(viewItems);
@@ -164,7 +133,6 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
@Override
public void delfootSuccess() {
page = 1;
// MvpPre.getMyFoot(page);
viewItems = new ArrayList<>();
MvpPre.getCharmList(0,page+"");//我创建的
ToastUtils.show("清空足迹成功");
@@ -173,15 +141,6 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
@Override
public void setMyFootData(List<MyFootResp> data, int page) {
// if (page == 1) {
// mChatRoomMyFootAdapter.setNewData(data);
// } else {
// if (data == null || data.size() == 0) {
// mBinding.smartRefreshLayout.finishLoadMoreWithNoMoreData();
// } else {
// mChatRoomMyFootAdapter.addData(data);
// }
// }
if (data != null) {
RoomData roomData = new RoomData("历史足迹", com.xscm.moduleutil.R.mipmap.footprint, com.xscm.moduleutil.R.mipmap.dele_foot);
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, roomData));
@@ -220,32 +179,4 @@ public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
MvpPre.getMyFoot(1);
adapter.submitList(viewItems);
}
// private void upList(){
// if (roomAuctionABean != null) {
// // 添加文本项
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, ""));
//
// // 添加关系列表
// for (RoomRelationBean bean : roomAuctionABean.getRoomRelationBeanList()) {
// viewItems.add(new ViewItem(ViewItem.TYPE_RELATION, bean));
// }
//
// if (type.equals("2")){
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择时长"));
// for (RoomAutionTimeBean bean : getDefaultTimeOptions()) {
// viewItems.add(new ViewItem(ViewItem.TYPE_IMAGE_SELECTION, bean));
// }
// }
//
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择礼物"));
// // 添加礼物列表
// for (RoonGiftModel bean : roomAuctionABean.getRoomGiftBeanList()) {
// viewItems.add(new ViewItem(ViewItem.TYPE_GIFT, bean));
// }
//
// adapter.submitList(viewItems);
// }
// }
}

View File

@@ -80,10 +80,6 @@ public class MyFollowFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragm
((MyRoomActivity)getActivity()).isShowLoading( true);
}
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), item.getRoom_id() +"","",null);
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "历史记录列表").withString("roomId", item.getRoom_id()).navigation();
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
}
}
});

View File

@@ -24,7 +24,6 @@ public class ChatRoomMyFollowAdapter extends BaseQuickAdapter<MyRoomBean, BaseVi
ImageUtils.loadHeadCC(item.getLabel_icon(), helper.getView(R.id.iv_type));
helper.setText(R.id.tv_name, item.getRoom_name());
helper.setText(R.id.tv_id, "ID: " + item.getRoom_id());
// helper.setText(R.id.tv_num, item.get());
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, helper.getView(R.id.iv_play));
}

View File

@@ -19,6 +19,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.xscm.modulemain.R;
import com.xscm.modulemain.activity.room.activity.RoomActivity;
import com.xscm.modulemain.activity.user.activity.MyRoomActivity;
import com.makeramen.roundedimageview.RoundedImageView;
import com.xscm.modulemain.manager.RoomManager;
@@ -49,11 +50,6 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
private MyRoomActivity myRoomActivity;
// public void submitList(List<ViewItem> items) {
// viewItems.clear();
// viewItems.addAll(items);
// notifyDataSetChanged();
// }
public void setMyRoomActivity(MyRoomActivity myRoomActivity) {
this.myRoomActivity = myRoomActivity;
}
@@ -122,9 +118,9 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
case ViewItem.TYPE_RELATION:
return new RelationViewHolder(inflater.inflate(R.layout.room_fragment_my_room_list, parent, false));
case ViewItem.TYPE_GIFT:
return new RelationViewTimHolder(inflater.inflate(R.layout.room_fragment_my_room_cp_list, parent, false));
return new RelationViewTimHolder(myRoomActivity,inflater.inflate(R.layout.room_fragment_my_room_cp_list, parent, false));
case ViewItem.TYPE_IMAGE_SELECTION:
return new GiftViewHolder(inflater.inflate(R.layout.room_index_item_chatroom_my_foot, parent, false));
return new GiftViewHolder(myRoomActivity,inflater.inflate(R.layout.room_index_item_chatroom_my_foot, parent, false));
default:
throw new IllegalArgumentException("Unknown view type");
}
@@ -313,7 +309,8 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
queren(itemView.getContext());
return;
}
if (myRoomActivity != null)
myRoomActivity.isShowLoading(true);
// startActivity(new Intent(getContext(), RoomDetailsActivity.class));
ARouter.getInstance().build(ARouteConstants.MY_ROOM_DETAILS).withString("roomId", item.getRoom_id() + "").navigation();
}
@@ -381,9 +378,10 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
GifAvatarOvalView user_avatar1, user_avatar2;
TextView tv_gx, tv_name, tv_sy, tv_user_id, room_head_top2, room_head_top3, rl_mx, tv_time;
ImageView iv_play;
RelationViewTimHolder(View itemView) {
private MyRoomActivity myRoomActivity;
RelationViewTimHolder(MyRoomActivity myRoomActivity ,View itemView) {
super(itemView);
this.myRoomActivity = myRoomActivity;
cl_my_room_list = itemView.findViewById(R.id.cl_my_room_list);
user_avatar1 = itemView.findViewById(R.id.user_avatar1);
user_avatar2 = itemView.findViewById(R.id.user_avatar2);
@@ -410,6 +408,11 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
rl_mx.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (myRoomActivity != null){
myRoomActivity.isShowLoading(true);
}
// TODO: 跳转到房间详情页面
RoomManager.getInstance().fetchRoomDataAndEnter(itemView.getContext(), item.getRoom_id() + "", "",null);
@@ -420,6 +423,10 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
cl_my_room_list.setOnClickListener(new View.OnClickListener() {//跳转房间
@Override
public void onClick(View v) {
if (myRoomActivity != null){
myRoomActivity.isShowLoading(true);
}
RoomManager.getInstance().fetchRoomDataAndEnter(itemView.getContext(), item.getRoom_id() + "", "",null);
// TODO: 跳转到房间
@@ -453,8 +460,10 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
TextView tv_name, tv_num;
ConstraintLayout rl_root;
GiftViewHolder(View itemView) {
private MyRoomActivity roomActivity;
GiftViewHolder(MyRoomActivity roomActivity, View itemView) {
super(itemView);
this.roomActivity = roomActivity;
iv_follow_bg = itemView.findViewById(R.id.iv_follow_bg);
iv_type = itemView.findViewById(R.id.iv_type);
tv_name = itemView.findViewById(R.id.tv_name);
@@ -465,27 +474,17 @@ public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
void bind(MyFootResp item) {
ImageUtils.loadHeadCC(item.getRoom_cover(), iv_follow_bg);
// if (item.getLabel_id().equals("23")){
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.diang_c);
// }else if (item.getLabel_id().equals("108")){
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.youxi);
// }else if (item.getLabel_id().equals("101")){
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.youxi);
// } else if (item.getLabel_id().equals("120")){//女神
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nvshen);
// }else if (item.getLabel_id().equals("121")){//男神
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nans);
// }
ImageUtils.loadHeadCC(item.getLabel_icon(), iv_type);
tv_name.setText(item.getRoom_name());
tv_num.setText(item.getHot_value());
// ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv_play);
rl_root.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (roomActivity != null){
roomActivity.isShowLoading(true);
}
RoomManager.getInstance().fetchRoomDataAndEnter(itemView.getContext(), item.getRoom_id() + "", "",null);
// ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();

View File

@@ -41,11 +41,6 @@
app:tl_textUnselectColor="@color/colorBlack45"
app:tl_textsize="@dimen/sp_16" />
<!-- <androidx.viewpager.widget.ViewPager-->
<!-- android:id="@+id/viewpager"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginTop="@dimen/dp_20" />-->
<RelativeLayout
android:layout_width="match_parent"
@@ -83,12 +78,12 @@
android:textColor="#333333 "
android:textSize="@dimen/sp_14" />
<View
<ImageView
android:id="@+id/v_line"
android:layout_width="40dp"
android:layout_height="4dp"
android:layout_marginTop="-3dp"
android:background="@mipmap/tab_x" />
android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/tab_x" />
</LinearLayout>
<LinearLayout
@@ -109,12 +104,12 @@
android:textColor="#999999"
android:textSize="@dimen/sp_14" />
<View
<ImageView
android:id="@+id/v_line2"
android:layout_width="40dp"
android:layout_height="4dp"
android:layout_marginTop="-3dp"
android:background="@mipmap/tab_x"
android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content"
android:src="@mipmap/tab_x"
android:scaleType="fitXY"
android:visibility="gone" />
</LinearLayout>
@@ -136,12 +131,12 @@
android:textColor="#999999"
android:textSize="@dimen/sp_14" />
<View
<ImageView
android:id="@+id/v_line3"
android:layout_width="40dp"
android:layout_height="4dp"
android:layout_marginTop="-3dp"
android:background="@mipmap/tab_x"
android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/tab_x"
android:visibility="gone" />
</LinearLayout>
@@ -163,12 +158,12 @@
android:textColor="#999999"
android:textSize="@dimen/sp_14" />
<View
<ImageView
android:id="@+id/v_line4"
android:layout_width="40dp"
android:layout_height="4dp"
android:layout_marginTop="-3dp"
android:background="@mipmap/tab_x"
android:layout_width="@dimen/dp_40"
android:layout_height="wrap_content"
android:src="@mipmap/tab_x"
android:scaleType="fitXY"
android:visibility="gone" />
</LinearLayout>
@@ -198,7 +193,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
<com.xscm.moduleutil.widget.DropView
android:id="@+id/ll"

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
xmlns:tools="http://schemas.android.com/tools">
<data>
@@ -17,7 +16,6 @@
android:id="@+id/rv_my_room_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_10"
tools:ignore="MissingConstraints"
tools:listitem="@layout/room_fragment_my_room_list"
@@ -35,8 +33,8 @@
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintTop_toBottomOf="@+id/rv_my_room_list"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="UselessParent"
tools:visibility="visible" />
@@ -44,39 +42,38 @@
android:id="@+id/smart_refresh_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/rv_my_room_list"
app:srlEnableLoadMore="true"
app:srlEnableRefresh="false"
android:visibility="gone"
>
app:srlEnableRefresh="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/dp_6"
>
android:paddingStart="@dimen/dp_6">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_25"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center">
<ImageView
android:id="@+id/iv_footprint"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:scaleType="fitXY"
android:src="@mipmap/footprint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_24"
android:layout_centerVertical="true"
android:layout_alignLeft="@+id/iv_footprint"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_21"
android:text="历史足迹"
android:textColor="@color/color_FF333333"
@@ -98,13 +95,10 @@
android:id="@+id/recycle_view_foot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dp_9"
android:nestedScrollingEnabled="false" />
android:nestedScrollingEnabled="false"
android:paddingStart="@dimen/dp_9" />
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_143"
android:layout_marginTop="@dimen/dp_5"
android:layout_marginBottom="@dimen/dp_5"
>
<com.lihang.ShadowLayout

View File

@@ -24,7 +24,6 @@
android:id="@+id/rv_my_room_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_10"
tools:listitem="@layout/room_fragment_my_room_list" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

View File

@@ -6,7 +6,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_150"
android:layout_marginLeft="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginBottom="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15">
<RelativeLayout