1:添加快速点击出现的打开多次
This commit is contained in:
@@ -30,7 +30,7 @@ isBuildModule=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.0.0
|
||||
APP_VERSION_CODE=119
|
||||
APP_VERSION_CODE=120
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 魅力详情列表
|
||||
*/
|
||||
@Data
|
||||
public class RoomUserCharmListBean {
|
||||
private int user_id;
|
||||
private String total_price;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private String user_code;
|
||||
private int charm;
|
||||
private List<String> icon ;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.xscm.moduleutil.utils;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 防止重复点击的工具类
|
||||
*/
|
||||
public class ClickUtils {
|
||||
private static final long CLICK_INTERVAL = 500; // 500ms内不允许重复点击
|
||||
private static long lastClickTime = 0;
|
||||
|
||||
public static boolean isFastDoubleClick() {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime - lastClickTime < CLICK_INTERVAL) {
|
||||
return true;
|
||||
}
|
||||
lastClickTime = currentTime;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/room_charm_b.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/room_charm_b.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
@@ -0,0 +1,60 @@
|
||||
package com.example.moduleroom.adapter;
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.moduleroom.R;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 魅力详情适配器
|
||||
*/
|
||||
public class RoomCharmAdapter extends BaseQuickAdapter<RoomUserCharmListBean, BaseViewHolder> {
|
||||
public RoomCharmAdapter() {
|
||||
super(R.layout.item_charm_dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RoomUserCharmListBean item) {
|
||||
helper.setText(R.id.tv_nick_name, item.getNickname());
|
||||
helper.setText(R.id.tv_charm, item.getCharm()+"");
|
||||
helper.setText(R.id.tv_user_id,"ID:"+item.getUser_code());
|
||||
MeHeadView headView = helper.getView(R.id.im_user);
|
||||
headView.setData(item.getAvatar(), "", "");
|
||||
|
||||
LinearLayout llContainer =helper.getView(R.id.ll_in);
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
if (item.getIcon() == null){
|
||||
return;
|
||||
}
|
||||
List<String> images = item.getIcon(); // 获取图片列表
|
||||
|
||||
for (String url : images) {
|
||||
if (url.contains("http")) {
|
||||
ImageView imageView1 = new ImageView(getContext());
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_37),
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15)
|
||||
);
|
||||
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
|
||||
imageView1.setLayoutParams(params);
|
||||
imageView1.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView1);
|
||||
|
||||
llContainer.addView(imageView1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.example.moduleroom.contacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomCharmDialogContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void roomUserCharmList(List<RoomUserCharmListBean> roomUserCharmListBeans);
|
||||
}
|
||||
|
||||
public interface IRoomPre extends IPresenter {
|
||||
|
||||
void roomUserCharmList(String room_id, String user_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.example.moduleroom.dialog;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.adapter.RoomCharmAdapter;
|
||||
import com.example.moduleroom.contacts.RoomCharmDialogContacts;
|
||||
import com.example.moduleroom.databinding.DialogCharmFragmentBinding;
|
||||
import com.example.moduleroom.presenter.RoomCharmDialogPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/10
|
||||
*@description: 魅力弹框
|
||||
*/
|
||||
public class RoomCharmDialog extends BaseMvpDialogFragment<RoomCharmDialogPresenter, DialogCharmFragmentBinding> implements RoomCharmDialogContacts.View{
|
||||
|
||||
private String mRoomId;
|
||||
private String mUserId;
|
||||
private RoomCharmAdapter mAdapter;
|
||||
public static RoomCharmDialog newInstance(String roomId,String userId) {
|
||||
RoomCharmDialog fragment = new RoomCharmDialog();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("roomId", roomId);
|
||||
bundle.putString("userId", userId);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
mRoomId = arguments.getString("roomId");
|
||||
mUserId = arguments.getString("userId");
|
||||
}
|
||||
@Override
|
||||
protected RoomCharmDialogPresenter bindPresenter() {
|
||||
return new RoomCharmDialogPresenter(this, getActivity());
|
||||
}
|
||||
@Override
|
||||
protected void initDialogStyle(Window window) {
|
||||
super.initDialogStyle(window);
|
||||
window.setGravity(Gravity.BOTTOM);
|
||||
WindowManager.LayoutParams lp = window.getAttributes();
|
||||
lp.dimAmount = 0.5f;
|
||||
// 固定对话框的宽度和高度
|
||||
lp.width = WindowManager.LayoutParams.MATCH_PARENT; // 宽度设置为屏幕宽度
|
||||
lp.height = WindowManager.LayoutParams.WRAP_CONTENT; // 高度设置为内容高度
|
||||
|
||||
window.setAttributes(lp);
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.roomUserCharmList(mRoomId, mUserId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.rvCharmList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
mAdapter = new RoomCharmAdapter();
|
||||
mBinding.rvCharmList.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_charm_fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomUserCharmList(List<RoomUserCharmListBean> roomUserCharmListBeans) {
|
||||
if (roomUserCharmListBeans!=null){
|
||||
mAdapter.setNewData(roomUserCharmListBeans);
|
||||
}else {
|
||||
mAdapter.setNewData(new ArrayList<>());
|
||||
ToastUtils.show("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.example.moduleroom.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.moduleroom.contacts.BidListContacts;
|
||||
import com.example.moduleroom.contacts.RoomCharmDialogContacts;
|
||||
import com.xscm.moduleutil.bean.RoomUserCharmListBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomCharmDialogPresenter extends BasePresenter<RoomCharmDialogContacts.View> implements RoomCharmDialogContacts.IRoomPre {
|
||||
|
||||
RoomCharmDialogContacts.View mView;
|
||||
|
||||
public RoomCharmDialogPresenter(RoomCharmDialogContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void roomUserCharmList(String room_id, String user_id) {
|
||||
api.roomUserCharmList(room_id, user_id,new BaseObserver<List<RoomUserCharmListBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<RoomUserCharmListBean> roomUserCharmListBeans) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().roomUserCharmList(roomUserCharmListBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
15
moduleroom/src/main/res/layout/custom_tab_layou_giftt.xml
Normal file
15
moduleroom/src/main/res/layout/custom_tab_layou_giftt.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tab_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
36
moduleroom/src/main/res/layout/dialog_charm_fragment.xml
Normal file
36
moduleroom/src/main/res/layout/dialog_charm_fragment.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_tb_ffffff"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="魅力值详情"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_charm_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_300"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
tools:listitem="@layout/item_charm_dialog" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
82
moduleroom/src/main/res/layout/item_charm_dialog.xml
Normal file
82
moduleroom/src/main/res/layout/item_charm_dialog.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ll_szmm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_62"
|
||||
android:layout_margin="15dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
>
|
||||
|
||||
<com.xscm.moduleutil.utils.MeHeadView
|
||||
android:id="@+id/im_user"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:src="@mipmap/default_avatar" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:layout_constraintStart_toEndOf="@+id/im_user"
|
||||
app:layout_constraintTop_toTopOf="@+id/im_user"
|
||||
android:gravity="left"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:id="@+id/tv_nick_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/color_FF333333"
|
||||
tools:text="名称" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_in"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_user_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical"
|
||||
app:layout_constraintStart_toStartOf="@+id/ll_user"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_user"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_user"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_gravity="center"
|
||||
android:drawableStart="@mipmap/room_charm_b"
|
||||
app:layout_constraintTop_toTopOf="@+id/im_user"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/im_user"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:gravity="center"
|
||||
/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
@@ -30,10 +30,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_weight="1"
|
||||
tools:text="开始日期"
|
||||
android:hint="开始日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
tools:text="开始日期" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv1"
|
||||
@@ -51,10 +51,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_weight="1"
|
||||
tools:text="结束日期"
|
||||
android:hint="结束日期"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
tools:text="结束日期" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv2"
|
||||
@@ -66,43 +66,44 @@
|
||||
android:src="@mipmap/data2" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <androidx.core.widget.NestedScrollView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent">-->
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/smart_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/revenue_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_30"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@color/color_FFF5F5F5"
|
||||
android:orientation="vertical"
|
||||
tools:listitem="@layout/item_revenue" />
|
||||
|
||||
<View
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_45"/>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/revenue_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@color/color_FFF5F5F5"
|
||||
android:orientation="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="0dp"
|
||||
tools:listitem="@layout/item_revenue" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_45" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
<!-- </androidx.core.widget.NestedScrollView>-->
|
||||
</LinearLayout>
|
||||
|
||||
</layout>
|
||||
Reference in New Issue
Block a user