diff --git a/modulemain/src/main/java/com/xscm/modulemain/activity/room/activity/RoomActivity.kt b/modulemain/src/main/java/com/xscm/modulemain/activity/room/activity/RoomActivity.kt index c97621cd..083c2a3e 100644 --- a/modulemain/src/main/java/com/xscm/modulemain/activity/room/activity/RoomActivity.kt +++ b/modulemain/src/main/java/com/xscm/modulemain/activity/room/activity/RoomActivity.kt @@ -721,7 +721,7 @@ class RoomActivity : BaseMvpActivity(), ).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 } diff --git a/modulemain/src/main/java/com/xscm/modulemain/activity/room/fragment/RoomFragment.java b/modulemain/src/main/java/com/xscm/modulemain/activity/room/fragment/RoomFragment.java index b44425d9..3f2afebf 100644 --- a/modulemain/src/main/java/com/xscm/modulemain/activity/room/fragment/RoomFragment.java +++ b/modulemain/src/main/java/com/xscm/modulemain/activity/room/fragment/RoomFragment.java @@ -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 { resetTab(0); }); @@ -116,104 +129,7 @@ public class MyRoomActivity extends BaseMvpActivity= 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 { @@ -288,18 +257,10 @@ public class MyRoomActivity extends BaseMvpActivity implements MyRoomListContacts.View { public static final int TYPE_CREATE = 0; - public static final int TYPE_HOST = 1; - private int type; - private BaseQuickAdapter mAdapter; private int page = 1; - private ChatRoomMyFootAdapter mChatRoomMyFootAdapter; - private MyCreateAdapter adapter; - private List viewItems = new ArrayList<>(); public static MyCreateFragment newInstance(int type) { @@ -56,25 +50,14 @@ public class MyCreateFragment extends BaseMvpFragment(); 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 showDelFootDialog()); } @Override @@ -146,16 +119,12 @@ public class MyCreateFragment extends BaseMvpFragment 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(); MvpPre.getCharmList(0,page+"");//我创建的 ToastUtils.show("清空足迹成功"); @@ -173,15 +141,6 @@ public class MyCreateFragment extends BaseMvpFragment 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 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 - - - - - - + android:layout_width="@dimen/dp_40" + android:layout_height="wrap_content" + android:scaleType="fitXY" + android:src="@mipmap/tab_x" /> - @@ -136,12 +131,12 @@ android:textColor="#999999" android:textSize="@dimen/sp_14" /> - @@ -163,12 +158,12 @@ android:textColor="#999999" android:textSize="@dimen/sp_14" /> - @@ -198,7 +193,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - + xmlns:tools="http://schemas.android.com/tools"> - + - + @@ -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"> + android:paddingStart="@dimen/dp_6"> + android:nestedScrollingEnabled="false" + android:paddingStart="@dimen/dp_9" /> - - - \ No newline at end of file diff --git a/modulemain/src/main/res/layout/room_fragment_my_room_list.xml b/modulemain/src/main/res/layout/room_fragment_my_room_list.xml index 277dca8f..eeaa609a 100644 --- a/modulemain/src/main/res/layout/room_fragment_my_room_list.xml +++ b/modulemain/src/main/res/layout/room_fragment_my_room_list.xml @@ -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" > diff --git a/modulemain/src/main/res/layout/room_index_item_chatroom_my_foot.xml b/modulemain/src/main/res/layout/room_index_item_chatroom_my_foot.xml index 844720ec..23ffe3fa 100644 --- a/modulemain/src/main/res/layout/room_index_item_chatroom_my_foot.xml +++ b/modulemain/src/main/res/layout/room_index_item_chatroom_my_foot.xml @@ -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">