1.动态只留一个发现
2.去掉真爱榜 3.隐藏第三方登录 4.一键登录 5.登陆
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -40,6 +41,7 @@ import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 音域--我的
|
||||
*/
|
||||
@@ -260,31 +262,51 @@ public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVoc
|
||||
SpUtil.setRealName(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 使用 ViewBinding 直接操作布局
|
||||
LinearLayout llContainer = mBinding.llImageContainer;
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
llContainer.removeAllViews();
|
||||
|
||||
List<String> images = data.getIcon(); // 获取图片列表
|
||||
if (images != null && !images.isEmpty()) {
|
||||
|
||||
for (String url : images) {
|
||||
if (url.contains("http")) {
|
||||
ImageView imageView = new ImageView(getContext());
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_74),
|
||||
getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_17)
|
||||
);
|
||||
params.setMargins(0, 0, getContext().getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5), 0); // 右边距
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView);
|
||||
|
||||
llContainer.addView(imageView);
|
||||
}
|
||||
}
|
||||
List<String> images = data.getIcon();
|
||||
if (images == null || images.isEmpty()) {
|
||||
return; // 提前返回,减少嵌套层级
|
||||
}
|
||||
|
||||
// 获取尺寸资源,避免重复调用
|
||||
Resources res = getContext().getResources();
|
||||
int imageWidth = res.getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_42);
|
||||
int imageHeight = res.getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_15);
|
||||
int rightMargin = res.getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_5);
|
||||
|
||||
for (String url : images) {
|
||||
if (!url.contains("http")) {
|
||||
continue; // 跳过非HTTP链接
|
||||
}
|
||||
|
||||
ImageView imageView = createImageView(url, imageWidth, imageHeight, rightMargin);
|
||||
llContainer.addView(imageView);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* 创建ImageView并设置相关参数
|
||||
*/
|
||||
|
||||
private ImageView createImageView(String url, int width, int height, int rightMargin) {
|
||||
ImageView imageView = new ImageView(getContext());
|
||||
|
||||
// 设置布局参数
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(width, height);
|
||||
params.setMargins(0, 0, rightMargin, 0);
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView);
|
||||
|
||||
return imageView;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user