1:修改金币钻石收支接口
2:修改进入房间添加字段 3:修改所有的图片展示,使用url作为key
This commit is contained in:
@@ -4,7 +4,7 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RevenueBean {
|
||||
private String id;
|
||||
private int id;
|
||||
private String user_id;
|
||||
private String change_type;
|
||||
private String change_type_name;
|
||||
|
||||
@@ -89,6 +89,7 @@ public class RoomBean implements Serializable {
|
||||
private int queue_number;//排麦队列人数
|
||||
private HeadlineBean head_line;
|
||||
|
||||
private String sexy_coin;//酒吧房撩的金币
|
||||
|
||||
private String room_code;
|
||||
private String popularity;
|
||||
|
||||
@@ -50,7 +50,6 @@ public class RoomPitBean implements Serializable ,Cloneable{
|
||||
private String dress;//麦位用户头像装扮
|
||||
private String charm;//麦位上用户在当前房间的魅力值
|
||||
|
||||
|
||||
private String room_id;
|
||||
private String voice;
|
||||
private String shutup;
|
||||
@@ -77,9 +76,10 @@ public class RoomPitBean implements Serializable ,Cloneable{
|
||||
private String nickname_color;//昵称颜色
|
||||
private String mic_cycle;//麦圈
|
||||
|
||||
|
||||
private boolean occupied;
|
||||
private boolean imageType;//是否是演唱者
|
||||
private String end_time;//倒计时结束时间 酒吧房
|
||||
private int had_custom_gift;//是否显示设置了自定义礼物 0:没有 1:有
|
||||
|
||||
public RoomPitBean clone(){
|
||||
try {
|
||||
|
||||
@@ -115,7 +115,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_LOG_LIST)
|
||||
Call<BaseModel<List<RevenueBean>>> getRevenueData(@Field("page") String page, @Field("page_limit") String page_limit, @Field("in_out_type") String in_out_type, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("gift_type") String gift_type);
|
||||
Call<BaseModel<List<RevenueBean>>> getRevenueData(@Field("last_id") int page, @Field("page_limit") String page_limit, @Field("in_out_type") String in_out_type, @Field("start_time") String start_time, @Field("end_time") String end_time, @Field("gift_type") String gift_type);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_WEALTH_RANKING)
|
||||
|
||||
@@ -1438,8 +1438,9 @@ public class RetrofitClient {
|
||||
|
||||
}
|
||||
|
||||
public void getRevenueData(String page, String page_limit, String in_out_type, String start_time, String end_time, String gift_type, BaseObserver<List<RevenueBean>> observer) {
|
||||
sApiServer.getRevenueData(page, page_limit, in_out_type, start_time, end_time, gift_type).enqueue(new Callback<BaseModel<List<RevenueBean>>>() {
|
||||
// TODO: 2026/1/7 修改当前接口,传递上一次的id
|
||||
public void getRevenueData(int id, String page_limit, String in_out_type, String start_time, String end_time, String gift_type, BaseObserver<List<RevenueBean>> observer) {
|
||||
sApiServer.getRevenueData(id, page_limit, in_out_type, start_time, end_time, gift_type).enqueue(new Callback<BaseModel<List<RevenueBean>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RevenueBean>>> call, Response<BaseModel<List<RevenueBean>>> response) {
|
||||
if (response.code() == 200) {
|
||||
@@ -4233,6 +4234,21 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2026/1/7
|
||||
public void applyPubPit(String roomId, String pitNumber, BaseObserver<String> observer) {
|
||||
sApiServer.applyPit(roomId, pitNumber).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
onNextRetu(response, observer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
LogUtils.e("applyPit", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void startFriend(String roomId, BaseObserver<String> observer) {
|
||||
sApiServer.startFriend(roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,11 @@ import androidx.annotation.NonNull;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.signature.ObjectKey;
|
||||
import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.widget.GrayscaleTransformation;
|
||||
|
||||
@@ -33,25 +36,32 @@ import java.security.MessageDigest;
|
||||
*/
|
||||
|
||||
public class ImageLoader {
|
||||
|
||||
private static RequestOptions createUrlOnlyOptions(String url) {
|
||||
String urls = String.valueOf(new GlideUrl(url));
|
||||
return new RequestOptions().signature(new ObjectKey(urls)).diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.skipMemoryCache(false)
|
||||
// 禁止尺寸影响缓存
|
||||
.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL);
|
||||
}
|
||||
|
||||
public static void loadHead(Context context, ImageView view, String url) {
|
||||
RequestOptions options = RequestOptions.circleCropTransform();
|
||||
Glide.with(context).load(url).apply(options).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
Glide.with(context).load(url).apply(createUrlOnlyOptions(url)).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadHead(ImageView view, String url) {
|
||||
RequestOptions options = RequestOptions.circleCropTransform();
|
||||
Glide.with(view).load(url).apply(options).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadImage(ImageView view, String url) {
|
||||
Glide.with(view).load(url).error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
RequestOptions options = RequestOptions.circleCropTransform();
|
||||
Glide.with(view).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_image).placeholder(R.mipmap.default_image).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadImage(Context context, ImageView view, String url) {
|
||||
Glide.with(context).load(url).error(R.mipmap.default_image).placeholder(R.mipmap.default_image)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
Glide.with(context).load(url).apply(createUrlOnlyOptions(url)).error(R.mipmap.default_image).placeholder(R.mipmap.default_image)
|
||||
.thumbnail(0.1f).into(view);
|
||||
}
|
||||
/**
|
||||
* 加载图片并灰度
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.Transformation;
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.load.model.GlideUrl;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterInside;
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
||||
import com.bumptech.glide.request.FutureTarget;
|
||||
@@ -75,11 +76,18 @@ public class ImageUtils {
|
||||
|
||||
public static final int ANIM = -1;
|
||||
|
||||
private static RequestOptions createUrlOnlyOptions(String url) {
|
||||
return new RequestOptions().signature(new ObjectKey(url!=null ? url :"")).diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.skipMemoryCache(false)
|
||||
// 禁止尺寸影响缓存
|
||||
.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认加载
|
||||
*/
|
||||
public static void loadImageView(String path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +95,7 @@ public class ImageUtils {
|
||||
*/
|
||||
public static void loadIcon(String path, ImageView mImageView) {
|
||||
mImageView.setVisibility(TextUtils.isEmpty(path) ? GONE : View.VISIBLE);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,7 +149,9 @@ public class ImageUtils {
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<Integer, SVGAVideoEntity> svgaCache = new HashMap<>();
|
||||
|
||||
// TODO: 2025/8/22 播放svga
|
||||
public static void loadDecorationAvatar2(int resourceId, SVGAImageView mImageView) {
|
||||
// 从资源文件夹加载SVGA文件
|
||||
@@ -160,7 +170,7 @@ public class ImageUtils {
|
||||
// 没有缓存,正常加载
|
||||
SVGAParser parser = SVGAParser.Companion.shareParser();
|
||||
InputStream inputStream = mImageView.getContext().getResources().openRawResource(resourceId);
|
||||
parser.decodeFromAssets("heart_line_31.svga", new SVGAParser.ParseCompletion() {
|
||||
parser.decodeFromAssets("heart_line_31.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
|
||||
if (mImageView != null) {
|
||||
@@ -184,7 +194,8 @@ public class ImageUtils {
|
||||
Logger.e("Resource ID is 0 or invalid");
|
||||
}
|
||||
}
|
||||
public static void loadSetErrorImg(String path, ImageView mImageView,int errorRes) {
|
||||
|
||||
public static void loadSetErrorImg(String path, ImageView mImageView, int errorRes) {
|
||||
if (mImageView == null) {
|
||||
return;
|
||||
}
|
||||
@@ -196,7 +207,8 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).error(errorRes).placeholder(errorRes).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).error(errorRes).
|
||||
placeholder(errorRes).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).thumbnail(0.1f).into(mImageView);
|
||||
|
||||
}
|
||||
|
||||
@@ -212,7 +224,8 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path))
|
||||
.placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView) {
|
||||
@@ -226,7 +239,9 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).asBitmap().load(path)
|
||||
.apply(createUrlOnlyOptions(path))
|
||||
.error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHead(String path, ImageView mImageView) {
|
||||
@@ -240,7 +255,8 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path))
|
||||
.thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView, LinearLayout.LayoutParams params) {
|
||||
@@ -254,8 +270,9 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
Glide.with(mImageView).asBitmap().load(path)
|
||||
.apply(createUrlOnlyOptions(path))
|
||||
.error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar)
|
||||
// 添加加载监听
|
||||
.listener(new RequestListener<Bitmap>() {
|
||||
@Override
|
||||
@@ -270,7 +287,7 @@ public class ImageUtils {
|
||||
// 加载成功!resource 就是最终的 Bitmap 对象
|
||||
int imageWidth = resource.getWidth(); // 图片原始宽度
|
||||
int imageHeight = resource.getHeight(); // 图片原始高度
|
||||
params.width = (int)(imageWidth * 1.3);
|
||||
params.width = (int) (imageWidth * 1.3);
|
||||
// 这里可以使用宽高(如打印、适配布局等)
|
||||
Log.d("GlideImageSize", "宽度:" + imageWidth + ",高度:" + imageHeight);
|
||||
return false; // 返回 false,Glide 会继续执行默认的图片设置(显示到 mImageView)
|
||||
@@ -288,7 +305,7 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
public static void loadCenterCrop(String path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).centerCrop().diskCacheStrategy(DiskCacheStrategy.RESOURCE).into(mImageView);
|
||||
Glide.with(mImageView).load(path).apply(createUrlOnlyOptions(path)).centerCrop().into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadRes(int path, ImageView mImageView) {
|
||||
@@ -299,8 +316,8 @@ public class ImageUtils {
|
||||
/**
|
||||
* 加载图片(优先使用本地缓存,无缓存则下载)
|
||||
*
|
||||
* @param context 上下文
|
||||
* @param url 图片 URL
|
||||
* @param context 上下文
|
||||
* @param url 图片 URL
|
||||
* @param imageView 目标 ImageView
|
||||
*/
|
||||
public static void loadImageWithCache(Context context, String url, ImageView imageView) {
|
||||
@@ -432,7 +449,7 @@ public class ImageUtils {
|
||||
* @param listener 回调
|
||||
*/
|
||||
public static void loadBitmap(String path, final onLoadBitmap listener) {
|
||||
Glide.with(Utils.getApp()).asBitmap().load(path).into(new SimpleTarget<Bitmap>() {
|
||||
Glide.with(Utils.getApp()).asBitmap().load(path).apply(createUrlOnlyOptions(path)).into(new SimpleTarget<Bitmap>() {
|
||||
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {
|
||||
@@ -471,7 +488,8 @@ public class ImageUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void loadIconByHeight1(String path, ImageView mImageView,int height) {
|
||||
|
||||
public static void loadIconByHeight1(String path, ImageView mImageView, int height) {
|
||||
mImageView.setVisibility(TextUtils.isEmpty(path) ? GONE : View.VISIBLE);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
@@ -495,6 +513,7 @@ public class ImageUtils {
|
||||
Glide.with(imageView.getContext())
|
||||
.asBitmap()
|
||||
.load(url)
|
||||
.apply(createUrlOnlyOptions(url))
|
||||
.error(defaultResId) // 加载失败时显示默认图片
|
||||
.into(new SimpleTarget<Bitmap>() {
|
||||
@Override
|
||||
@@ -524,8 +543,6 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 加载bitmap回调
|
||||
*/
|
||||
@@ -603,12 +620,13 @@ public class ImageUtils {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 assets 中的文件复制到指定路径
|
||||
*
|
||||
* @param assetName assets 中的文件名,例如:"my_file.txt"
|
||||
* @param savePath 要保存的目录路径,例如:"/data/data/your.package/files/"
|
||||
* @param saveName 保存后的文件名
|
||||
* @param assetName assets 中的文件名,例如:"my_file.txt"
|
||||
* @param savePath 要保存的目录路径,例如:"/data/data/your.package/files/"
|
||||
* @param saveName 保存后的文件名
|
||||
*/
|
||||
public static void copyAssetToFile(String assetName, String savePath, String saveName) {
|
||||
InputStream myInput = null;
|
||||
@@ -661,12 +679,12 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
|
||||
public static void loadWebpOneStart(int webp_anim, ImageView mAnimView){
|
||||
public static void loadWebpOneStart(int webp_anim, ImageView mAnimView) {
|
||||
|
||||
if (mAnimView == null) {
|
||||
return;
|
||||
}
|
||||
// 1. 本地资源专属优化配置
|
||||
// 1. 本地资源专属优化配置
|
||||
RequestOptions options = new RequestOptions()
|
||||
// 强制限制解码尺寸为ImageView显示尺寸(核心优化)
|
||||
.override(800, 800); // 本地图用原尺寸,或指定固定尺寸
|
||||
@@ -708,7 +726,7 @@ public class ImageUtils {
|
||||
.into(mAnimView);
|
||||
}
|
||||
|
||||
public static void clearDiskCache(Context context){
|
||||
public static void clearDiskCache(Context context) {
|
||||
Glide.get(context).clearDiskCache();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xscm.modulemain.activity.user.activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.xscm.modulemain.R;
|
||||
import com.xscm.modulemain.adapter.BlackAdapter;
|
||||
import com.xscm.modulemain.databinding.ActivityBlacklistBinding;
|
||||
@@ -25,6 +28,7 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
BlackAdapter blackAdapter;
|
||||
private String[] mTitles = new String[]{"关注", "黑名单", "粉丝","访客"};
|
||||
List<BlackUserBean> blackUserBeans;
|
||||
private int page=1;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
@@ -74,6 +78,20 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.srlBlacklist.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getUserFollowList(String.valueOf(type), page+"", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.getUserFollowList(String.valueOf(type), page+"", "10");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +102,8 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
|
||||
@Override
|
||||
public void getUserFollowList(List<BlackUserBean> list, String type) {
|
||||
mBinding.srlBlacklist.finishRefresh();
|
||||
mBinding.srlBlacklist.finishLoadMore();
|
||||
if (type.equals("0")){
|
||||
if (list!=null){
|
||||
List<BlackUserBean> blackUserBeans = new ArrayList<>();
|
||||
@@ -91,7 +111,11 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
item.setType(0);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
if (page==1) {
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}else {
|
||||
blackAdapter.addData(blackUserBeans);
|
||||
}
|
||||
}
|
||||
}else if (type.equals("1")){
|
||||
if (list!=null){
|
||||
@@ -100,7 +124,11 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
item.setType(1);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
if (page==1) {
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}else {
|
||||
blackAdapter.addData(blackUserBeans);
|
||||
}
|
||||
}
|
||||
}else if (type.equals("2")){
|
||||
if (list!=null){
|
||||
@@ -109,7 +137,11 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
item.setType(2);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
if (page==1) {
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}else {
|
||||
blackAdapter.addData(blackUserBeans);
|
||||
}
|
||||
}
|
||||
}else if (type.equals("3")){
|
||||
if (list!=null){
|
||||
@@ -118,7 +150,11 @@ public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,Activi
|
||||
item.setType(3);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
if (page==1) {
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}else {
|
||||
blackAdapter.addData(blackUserBeans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class RevenueConacts {
|
||||
}
|
||||
public interface IMePre extends IPresenter {
|
||||
|
||||
void getRevenueData(String page,String page_limit,String in_out_type,String start_time,String end_time,String gift_type);
|
||||
void getRevenueData(int id,String page_limit,String in_out_type,String start_time,String end_time,String gift_type);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,24 +23,25 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 收支展示的页面,根据type展示收入和支出,根据revenueType展示钻石还是金币
|
||||
* @author qx
|
||||
* @data 2025/5/27
|
||||
* @description: 收支展示的页面,根据type展示收入和支出,根据revenueType展示钻石还是金币
|
||||
*/
|
||||
public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentRevenueBinding> implements RevenueConacts.View{
|
||||
public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentRevenueBinding> implements RevenueConacts.View {
|
||||
|
||||
private String type;
|
||||
private String revenueType;
|
||||
|
||||
private RevenueAdapter adapter;
|
||||
private boolean isLoaded = false;
|
||||
private int page = 1;
|
||||
private int id = 0;
|
||||
|
||||
@Override
|
||||
protected RevenuePresenter bindPresenter() {
|
||||
return new RevenuePresenter(this,getActivity());
|
||||
return new RevenuePresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static RevenueFragment newInstance(String type, String revenueType) {
|
||||
public static RevenueFragment newInstance(String type, String revenueType) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("type", type);
|
||||
args.putString("revenueType", revenueType);
|
||||
@@ -68,13 +69,13 @@ public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentR
|
||||
|
||||
public void refreshData(int type, String direction) {
|
||||
isLoaded = false;
|
||||
this.type= String.valueOf(type);
|
||||
this.revenueType=direction;
|
||||
this.type = String.valueOf(type);
|
||||
this.revenueType = direction;
|
||||
loadData();
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
MvpPre.getRevenueData(0, "", revenueType, "", "", type);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,8 +91,8 @@ public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentR
|
||||
mBinding.tv2.setText(sdf.format(startDate));
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate));
|
||||
mBinding.tv22.setText(sdf.format(endDate));
|
||||
page=1;
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,mBinding.tv2.getText().toString(),mBinding.tv22.getText().toString(),type);
|
||||
id = 0;
|
||||
MvpPre.getRevenueData(id, "", revenueType, mBinding.tv2.getText().toString(), mBinding.tv22.getText().toString(), type);
|
||||
});
|
||||
dialog.show(getParentFragmentManager(), "DoubleTimePicker");
|
||||
});
|
||||
@@ -103,20 +104,20 @@ public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentR
|
||||
adapter = new RevenueAdapter();
|
||||
mBinding.revenueView.setAdapter(adapter);
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
|
||||
String startDate = mBinding.tv2.getText().toString();
|
||||
String endDate = mBinding.tv22.getText().toString();
|
||||
if ( startDate!=null && !startDate.equals("") ){
|
||||
if ( endDate!=null && !endDate.equals("") ){
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,startDate,endDate,type);
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"",endDate,type);
|
||||
if (startDate != null && !startDate.equals("")) {
|
||||
if (endDate != null && !endDate.equals("")) {
|
||||
MvpPre.getRevenueData(id, "", revenueType, startDate, endDate, type);
|
||||
} else {
|
||||
MvpPre.getRevenueData(id, "", revenueType, "", endDate, type);
|
||||
}
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
} else {
|
||||
MvpPre.getRevenueData(id, "", revenueType, "", "", type);
|
||||
}
|
||||
|
||||
// MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
@@ -125,18 +126,18 @@ public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentR
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
// MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
id = 0;
|
||||
String startDate = mBinding.tv2.getText().toString();
|
||||
String endDate = mBinding.tv22.getText().toString();
|
||||
if ( startDate!=null && !startDate.equals("") ){
|
||||
if ( endDate!=null && !endDate.equals("") ){
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,startDate,endDate,type);
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"",endDate,type);
|
||||
if (startDate != null && !startDate.equals("")) {
|
||||
if (endDate != null && !endDate.equals("")) {
|
||||
MvpPre.getRevenueData(id, "", revenueType, startDate, endDate, type);
|
||||
} else {
|
||||
MvpPre.getRevenueData(id, "", revenueType, "", endDate, type);
|
||||
}
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
} else {
|
||||
MvpPre.getRevenueData(id, "", revenueType, "", "", type);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -150,17 +151,22 @@ public class RevenueFragment extends BaseMvpFragment<RevenuePresenter, FragmentR
|
||||
|
||||
@Override
|
||||
public void saveRevenueData(List<RevenueBean> bean) {
|
||||
if (bean !=null && bean.size() > 0) {
|
||||
if (bean != null && bean.size() > 0) {
|
||||
List<RevenueBean> list = new ArrayList<>();
|
||||
for (RevenueBean revenueBean : bean) {
|
||||
revenueBean.setType(Integer.parseInt(type));
|
||||
list.add(revenueBean);
|
||||
}
|
||||
if (page == 1) {
|
||||
if(id == 0){
|
||||
adapter.setNewData(list);
|
||||
}else {
|
||||
adapter.addData(list);
|
||||
}
|
||||
id = bean.get(bean.size() - 1).getId();
|
||||
|
||||
// }else {
|
||||
// adapter.addData(list);
|
||||
// }
|
||||
}
|
||||
// else {
|
||||
// adapter.setNewData(new ArrayList<>());
|
||||
|
||||
@@ -19,10 +19,10 @@ public class RevenuePresenter extends BasePresenter<RevenueConacts.View> impleme
|
||||
mView = view;
|
||||
}
|
||||
|
||||
|
||||
// TODO: 2026/1/7 修改接口,传递的是列表中的最后一个id,初始的时候是0
|
||||
@Override
|
||||
public void getRevenueData(String page, String page_limit, String in_out_type, String start_time, String end_time, String gift_type) {
|
||||
api.getRevenueData(page, page_limit, in_out_type, start_time, end_time, gift_type, new BaseObserver<List<RevenueBean>>() {
|
||||
public void getRevenueData(int id, String page_limit, String in_out_type, String start_time, String end_time, String gift_type) {
|
||||
api.getRevenueData(id, page_limit, in_out_type, start_time, end_time, gift_type, new BaseObserver<List<RevenueBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.AvatarFrameView
|
||||
import com.xscm.moduleutil.widget.BaseWheatView
|
||||
import com.xscm.moduleutil.widget.WheatGiftAnim
|
||||
|
||||
class RoomPubWheatView : BaseWheatView {
|
||||
constructor(context: Context?) : super(context)
|
||||
@@ -33,7 +34,7 @@ class RoomPubWheatView : BaseWheatView {
|
||||
private var hostTv: TextView? = null
|
||||
private var tv_time: TextView? = null
|
||||
private var ll_bottom: LinearLayout? = null
|
||||
private var iv_gift: AvatarFrameView? = null
|
||||
private var iv_gift: ImageView? = null
|
||||
var ivYueT: ImageView? = null
|
||||
var ivLiaoT: ImageView? = null
|
||||
|
||||
@@ -120,8 +121,8 @@ class RoomPubWheatView : BaseWheatView {
|
||||
mCharmView.setSex("", "", value, format)
|
||||
}
|
||||
fun setPitGift(giftPlayString: String){
|
||||
iv_gift?.visibility=VISIBLE
|
||||
iv_gift?.setSource(giftPlayString, 2)
|
||||
mIvGift?.visibility=VISIBLE
|
||||
WheatGiftAnim.addGift(mIvGift, giftPlayString);
|
||||
}
|
||||
|
||||
private fun handleOnState(bean: RoomPitBean) {
|
||||
|
||||
@@ -12,20 +12,29 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.xscm.moduleutil.widget.CustomTopBar
|
||||
android:id="@+id/top_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_blacklist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/rv_blacklist"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp"/>
|
||||
android:layout_height="match_parent"
|
||||
app:srlEnableLoadMore="true"
|
||||
app:srlEnableRefresh="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_blacklist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipToPadding="false"
|
||||
android:overScrollMode="never"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -60,7 +60,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.6" />
|
||||
|
||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
|
||||
Reference in New Issue
Block a user