1、修改包的图片
2、修改房间的所有进出方式
This commit is contained in:
@@ -35,42 +35,38 @@ public class CarouselBannerAdapter extends BaseBannerAdapter<TopRoom> {
|
||||
textView.setText(data.getUser_list().size()+"人");
|
||||
textView2.setText(data.getRoom_name());
|
||||
ImageView iv = holder.itemView.findViewById(R.id.iv_play);
|
||||
// if (item.getOn_line().equals("1")){
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv);
|
||||
// }
|
||||
List<TopRoom.UserList> user_list = data.getUser_list();
|
||||
if (user_list!= null && user_list.size() > 0) {
|
||||
RecyclerView recyclerView = holder.itemView.findViewById(R.id.rv_tags);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
|
||||
// 设置item之间的间隔为负值,实现重叠效果
|
||||
if (recyclerView.getItemDecorationCount() == 0) {
|
||||
recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
@Override
|
||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
|
||||
@NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
super.getItemOffsets(outRect, view, parent, state);
|
||||
// 设置负间距实现重叠效果,根据需要调整数值
|
||||
outRect.left = -dpToPx(holder.itemView.getContext(), 8); // 重叠8dp
|
||||
}
|
||||
|
||||
private int dpToPx(Context context, int dp) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
context.getResources().getDisplayMetrics());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
CarouselImgAdapter adapter = new CarouselImgAdapter();
|
||||
|
||||
// 创建最多包含3个元素的子列表
|
||||
int endIndex = Math.min(user_list.size(), 3);
|
||||
adapter.setNewData(user_list.subList(0, endIndex));
|
||||
recyclerView.setAdapter(adapter);
|
||||
// adapter.setNewData(user_list);
|
||||
// List<TopRoom.UserList> user_list = data.getUser_list();
|
||||
// if (user_list!= null && user_list.size() > 0) {
|
||||
// RecyclerView recyclerView = holder.itemView.findViewById(R.id.rv_tags);
|
||||
// recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
//
|
||||
// // 设置item之间的间隔为负值,实现重叠效果
|
||||
// if (recyclerView.getItemDecorationCount() == 0) {
|
||||
// recyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
|
||||
// @Override
|
||||
// public void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
|
||||
// @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
// super.getItemOffsets(outRect, view, parent, state);
|
||||
// // 设置负间距实现重叠效果,根据需要调整数值
|
||||
// outRect.left = -dpToPx(holder.itemView.getContext(), 8); // 重叠8dp
|
||||
// }
|
||||
//
|
||||
// private int dpToPx(Context context, int dp) {
|
||||
// return (int) TypedValue.applyDimension(
|
||||
// TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||
// context.getResources().getDisplayMetrics());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// CarouselImgAdapter adapter = new CarouselImgAdapter();
|
||||
//
|
||||
// // 创建最多包含3个元素的子列表
|
||||
// int endIndex = Math.min(user_list.size(), 3);
|
||||
// adapter.setNewData(user_list.subList(0, endIndex));
|
||||
// recyclerView.setAdapter(adapter);
|
||||
}
|
||||
// }
|
||||
|
||||
// 设置点击事件
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
|
||||
@@ -4,6 +4,7 @@ import static android.view.View.GONE;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -42,7 +43,13 @@ public class HotAdapter extends BaseMultiItemQuickAdapter<TopRoom, BaseViewHolde
|
||||
// }else if (item.getLabel_id().equals("121")){//男神
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nans);
|
||||
// }
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
|
||||
TextView tv_name = helper.getView(R.id.tv_name);
|
||||
tv_name.setText(item.getRoom_name());
|
||||
tv_name.setSelected(true);
|
||||
|
||||
// helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
|
||||
ImageView iv = helper.getView(R.id.iv_play);
|
||||
if (item.getUser_list()!=null && item.getUser_list().size() > 0) {
|
||||
iv.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -124,22 +124,25 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
* type=1时,该值表示房间id;type=2时,表示文章id
|
||||
*/
|
||||
BannerModel bannerModel = (BannerModel) model;
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", bannerModel.getUrl()).withString("title", "首页横幅").navigation();
|
||||
}
|
||||
});
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
requireActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int screenWidth = displayMetrics.widthPixels;
|
||||
|
||||
int bannerWidth = screenWidth - (20 * 2); // 减去左右边距
|
||||
int bannerHeight = bannerWidth * 9 / 16; // 16:9 比例
|
||||
carouselBannerAdapter = new CarouselBannerAdapter();
|
||||
mBinding.bannerViewPager
|
||||
.setPageMargin(15)
|
||||
.setRevealWidth(250, 250)
|
||||
.setPageStyle(PageStyle.MULTI_PAGE_SCALE, 0.5f)
|
||||
.setAdapter(carouselBannerAdapter)
|
||||
.create();
|
||||
// mBinding.bannerViewPager
|
||||
// .setPageMargin(15)
|
||||
// .setRevealWidth(250, 250)
|
||||
// .setPageStyle(PageStyle.MULTI_PAGE_SCALE, 0.5f)
|
||||
// .setAdapter(carouselBannerAdapter)
|
||||
// .create();
|
||||
|
||||
|
||||
mBinding.bannerViewPager.setIndicatorVisibility(GONE);
|
||||
@@ -236,14 +239,24 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
mqttList.clear();
|
||||
info.clear();
|
||||
// 处理缓存数据
|
||||
for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// 处理每一条 mqttBean 数据
|
||||
mqttList.add(mqttBean.getList());
|
||||
info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
|
||||
// 处理每一条 mqttBean 数据
|
||||
// for (MqttBean mqttBean : cachedMqttBeans) {
|
||||
// mqttList.addAll(mqttBean.getList());
|
||||
// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
//// info.add(mqttBean.getList().getFromUserName() + "送给" + mqttBean.getList().getToUserName() + "\n" + mqttBean.getList().getGiftName());
|
||||
// }
|
||||
|
||||
for (int i=0;i<cachedMqttBeans.size();i++){
|
||||
mqttList.addAll(cachedMqttBeans.get(i).getList());
|
||||
}
|
||||
for (int i=0;i<mqttList.size();i++){
|
||||
info.add(mqttList.get(i).getFromUserName() + "送给" + mqttList.get(i).getToUserName() + "\n" + mqttList.get(i).getGiftName());
|
||||
}
|
||||
|
||||
|
||||
mBinding.marqueeView.startWithList(info);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
DataLogger.LogUtil.d("onEvent1");
|
||||
}
|
||||
|
||||
@@ -264,13 +277,13 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
@Override
|
||||
public void setCategories(List<RoomTypeModel> list) {
|
||||
// // 数据有效性检查
|
||||
if (list == null || list.isEmpty() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
if (list == null || list.isEmpty() || getActivity() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建适配器
|
||||
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getActivity(), list);
|
||||
mBinding.viewPager.setAdapter(adapter);
|
||||
// 创建适配器
|
||||
MyFragmentPagerAdapter adapter = new MyFragmentPagerAdapter(getActivity(), list);
|
||||
mBinding.viewPager.setAdapter(adapter);
|
||||
|
||||
// 设置 TabLayout 与 ViewPager2 的关联
|
||||
new TabLayoutMediator(mBinding.slidingTabLayout, mBinding.viewPager,
|
||||
@@ -345,6 +358,7 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
mBinding.slidingTabLayout.selectTab(mBinding.slidingTabLayout.getTabAt(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBanners(List<BannerModel> bannerModels) {
|
||||
mBinding.banner.setBannerData(R.layout.index_image_banner, bannerModels);
|
||||
@@ -378,7 +392,7 @@ public class VoiceCategoryFragment extends BaseMvpFragment<VoiceCategoryPresente
|
||||
private List<RoomTypeModel> list;
|
||||
|
||||
|
||||
// public MyFragmentPagerAdapter(FragmentManager fm, List<RoomTypeModel> list) {
|
||||
// public MyFragmentPagerAdapter(FragmentManager fm, List<RoomTypeModel> list) {
|
||||
// super(fm);
|
||||
// this.list = list;
|
||||
// }
|
||||
|
||||
@@ -27,13 +27,9 @@
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/banner_view_pager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/rl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:bvp_indicator_visibility="gone"
|
||||
app:layout_constraintDimensionRatio="H,16:9"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -20,14 +20,15 @@
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:riv_corner_radius="@dimen/dp_11" />
|
||||
app:riv_corner_radius="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_r11_with"
|
||||
android:scaleType="fitCenter"
|
||||
app:riv_corner_radius="@dimen/dp_11" />
|
||||
<!-- <com.makeramen.roundedimageview.RoundedImageView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:background="@drawable/bg_r11_with"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- app:riv_corner_radius="@dimen/dp_11" />-->
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -40,16 +41,6 @@
|
||||
android:src="@drawable/phonetic"
|
||||
app:layout_constraintStart_toStartOf="@id/ll"
|
||||
app:layout_constraintTop_toTopOf="@id/ll" />
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="@dimen/dp_92"-->
|
||||
<!-- android:layout_height="@dimen/dp_21"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="@+id/ll"-->
|
||||
<!-- android:background="@drawable/group"-->
|
||||
<!-- android:layout_marginStart="@dimen/dp_8"-->
|
||||
<!-- android:gravity="center"-->
|
||||
<!-- >-->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_tags"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -36,21 +36,29 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_type"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:src="@mipmap/jiaoyou"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ll"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
android:text="烟花易冷"
|
||||
tools:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_num_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_num_bg"
|
||||
|
||||
Reference in New Issue
Block a user