修改交友布局
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevocal;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.example.modulevocal", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
148
modulevocal/src/main/AndroidManifest.xml
Normal file
148
modulevocal/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/BaseAppTheme">
|
||||
<activity
|
||||
android:name=".activity.AboutUsActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.WithdrawalListActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.GiftBoxRecordActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.BindCardDetailsActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.BindCardActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.AlbumDetailActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.SettingActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.CreateAlbumActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RealName1Activity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.RevenueActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.DailyTasksActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.UserHomepageActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.MyBagActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.BriefIntroductionActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.ChangeNicknameActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.CurrencyExchangeActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.WithdrawalActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RechargeActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.MyMoneyActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.EditUserInfoActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.EditUserActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.ChangPassActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.PersonalityActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RealDetailActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RoomAllowanceDetailActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RoomAllowanceActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.RoomDetailsActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.CreatedRoomActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.MyRoomActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.PhoneReplacementActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.ChangePasswordActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.BlacklistActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.MessageReminderActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.NotificationActivity"
|
||||
android:exported="false"
|
||||
android:launchMode="singleTask" />
|
||||
<activity
|
||||
android:name=".activity.UnderageActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityAboutUsBinding;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
|
||||
public class AboutUsActivity extends BaseAppCompatActivity<ActivityAboutUsBinding> {
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.tvAppVersion.setText("Version " + CommonAppConfig.getInstance().getVersion());
|
||||
|
||||
mBinding.llYonghu.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_yongh.html").withString("title", "用户协议").navigation();
|
||||
});
|
||||
|
||||
mBinding.llYins.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url", "file:///android_asset/page_show.html").withString("title", "隐私协议").navigation();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle("关于我们");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_about_us;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,384 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.AlbumPhotoAdapter;
|
||||
import com.example.modulevocal.adapter.SingleChoiceAdapter;
|
||||
import com.example.modulevocal.conacts.AlbumDetailConacts;
|
||||
import com.example.modulevocal.databinding.ActivityAlbumDetailBinding;
|
||||
import com.example.modulevocal.presenter.AlbumDetailPresenter;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.xscm.moduleutil.widget.dialog.ShareDialog;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/6
|
||||
*@description: 相册详情
|
||||
*/
|
||||
@Route(path = ARouteConstants.USER_ALBUM_DETAIL)
|
||||
public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, ActivityAlbumDetailBinding> implements AlbumDetailConacts.View {
|
||||
@Autowired
|
||||
public String albumId;
|
||||
@Autowired
|
||||
public String pwd;
|
||||
|
||||
@Autowired
|
||||
public String target_fragment;
|
||||
|
||||
private boolean isSelectMode = true; // 默认是 "选择" 状态
|
||||
private int page;
|
||||
private List<String> uploadedUrls = new ArrayList<>();//真实图片地址
|
||||
AlbumPhotoAdapter adapter;
|
||||
private String userId;
|
||||
AlbumBean albumBean1;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getAlbumDetail(albumId, pwd, page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
MvpPre.getAlbumDetail(albumId, pwd, page + "", "10");
|
||||
}
|
||||
});
|
||||
mBinding.imCrAlbum.setOnClickListener(this::onClick);
|
||||
mBinding.tvBj.setOnClickListener(this::onClick);
|
||||
mBinding.zan.setOnClickListener(this::onClick);
|
||||
mBinding.lock.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.topBar.setRightText("选择");
|
||||
mBinding.topBar.setRightColor(Color.parseColor("#FF8ACC"));
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
if (isSelectMode) {
|
||||
mBinding.topBar.setRightText("取消");
|
||||
// 进入取消逻辑,比如显示删除按钮、多选模式等
|
||||
showControlInRecyclerView(); // 显示控件
|
||||
} else {
|
||||
mBinding.topBar.setRightText("选择");
|
||||
// 返回选择逻辑,关闭多选或删除模式
|
||||
hideControlInRecyclerView(); // 隐藏控件
|
||||
}
|
||||
isSelectMode = !isSelectMode; // 切换状态
|
||||
});
|
||||
adapter = new AlbumPhotoAdapter(null);
|
||||
mBinding.recycleView.setAdapter(adapter);
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);
|
||||
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
int type = adapter.getItemViewType(position);
|
||||
if (type == 1) {
|
||||
return 3; // 占满整行
|
||||
} else {
|
||||
return 1; // 每个图片占一列
|
||||
}
|
||||
}
|
||||
});
|
||||
mBinding.recycleView.setLayoutManager(gridLayoutManager);
|
||||
|
||||
mBinding.rlShare.setOnClickListener(this::onClick);
|
||||
mBinding.rlTransfer.setOnClickListener(this::onClick);
|
||||
mBinding.rlDelete.setOnClickListener(this::onClick);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void showControlInRecyclerView() {
|
||||
if (adapter != null) {
|
||||
adapter.showControl(); // 调用适配器方法来显示控件
|
||||
}
|
||||
mBinding.bottomPanel.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
private void hideControlInRecyclerView() {
|
||||
if (adapter != null) {
|
||||
adapter.hideControl(); // 调用适配器方法来隐藏控件
|
||||
adapter.clearSelections(); // 清空选中状态
|
||||
|
||||
}
|
||||
mBinding.bottomPanel.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
hideControlInRecyclerView();
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.im_cr_album) {
|
||||
startChoosePhoto(1, PictureConfig.REQUEST_CAMERA, false, 9);
|
||||
} else if (view.getId() == R.id.tv_bj) {
|
||||
ARouter.getInstance().build(ARouteConstants.CREATE_ALBUM).withSerializable("albumBean", albumBean1).navigation();
|
||||
finish();
|
||||
} else if (view.getId() == R.id.zan) {
|
||||
if (albumBean1.getIs_like().equals("1")) {
|
||||
albumBean1.setIs_like("0");
|
||||
} else {
|
||||
albumBean1.setIs_like("1");
|
||||
}
|
||||
MvpPre.likeAlbum(albumId);
|
||||
} else if (view.getId() == R.id.lock) {
|
||||
|
||||
} else if (view.getId() == R.id.rl_share) {
|
||||
if (adapter.getSelectedItems().size() > 2) {
|
||||
hideControlInRecyclerView();
|
||||
ToastUtils.showShort("只能选择一张照片");
|
||||
} else if (adapter.getSelectedItems().isEmpty()) {
|
||||
ToastUtils.showShort("请选择图片");
|
||||
} else {
|
||||
ShareDialog shareDialog = new ShareDialog(this, "", adapter.getSelectedItems().get(0).getImage(), "", 4, userId, null);
|
||||
shareDialog.show();
|
||||
}
|
||||
} else if (view.getId() == R.id.rl_transfer) {
|
||||
MvpPre.getAlbumList("1", "10", userId);
|
||||
} else if (view.getId() == R.id.rl_delete) {
|
||||
MvpPre.deleteAlbumImage(adapter.getSelectedPhotoIdsAsString());
|
||||
}
|
||||
}
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(true)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
switch (requestCode) {
|
||||
|
||||
case PictureConfig.REQUEST_CAMERA:
|
||||
List<LocalMedia> localMediaList = PictureSelector.obtainSelectorList(data);
|
||||
|
||||
if (localMediaList != null && !localMediaList.isEmpty()) {
|
||||
List<File> imageFiles = new ArrayList<>();
|
||||
for (LocalMedia media : localMediaList) {
|
||||
String path = media.isCompressed() ? media.getCompressPath() : media.getRealPath();
|
||||
imageFiles.add(new File(path));
|
||||
}
|
||||
// 开始批量上传
|
||||
MvpPre.batchUploadFiles(imageFiles, 0); // 第二个参数是你原来的 type
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type, int index, int total) {
|
||||
|
||||
if (index >= 0 && index < uploadedUrls.size()) {
|
||||
uploadedUrls.add(index, url); // 插入到对应位置
|
||||
} else {
|
||||
uploadedUrls.add(url); // 添加到最后
|
||||
}
|
||||
|
||||
if (uploadedUrls.size() == total) {
|
||||
updateAdapterData(); // 所有图片上传完成,更新适配器数据
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upAddAlbum() {
|
||||
MvpPre.getAlbumDetail(albumId, pwd, page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAlbumList(List<AlbumBean> data) {
|
||||
BottomSheetDialog dialog = new BottomSheetDialog(this);
|
||||
dialog.setContentView(com.xscm.moduleutil.R.layout.bottom_sheet_recyclerview);
|
||||
|
||||
RecyclerView recyclerView = dialog.findViewById(com.xscm.moduleutil.R.id.rv_options);
|
||||
Button btnCancel = dialog.findViewById(com.xscm.moduleutil.R.id.btn_cancel);
|
||||
Button btnConfirm = dialog.findViewById(com.xscm.moduleutil.R.id.btn_confirm);
|
||||
|
||||
assert recyclerView != null;
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(this,4));
|
||||
SingleChoiceAdapter sadapter = new SingleChoiceAdapter();
|
||||
recyclerView.setAdapter(sadapter);
|
||||
sadapter.setNewData(data);
|
||||
btnCancel.setOnClickListener(v -> dialog.dismiss());
|
||||
|
||||
btnConfirm.setOnClickListener(v -> {
|
||||
AlbumBean selectedItem = sadapter.getSelectedItem();
|
||||
|
||||
if (selectedItem != null) {
|
||||
MvpPre.moveAlbum(adapter.getSelectedPhotoIdsAsString(), selectedItem.getId());
|
||||
}
|
||||
dialog.dismiss();
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveAlbum() {
|
||||
MvpPre.getAlbumDetail(albumId, pwd, "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAlbum() {
|
||||
MvpPre.getAlbumDetail(albumId, pwd, "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void likeAlbum() {
|
||||
updateZanButtonUI(albumBean1);
|
||||
}
|
||||
|
||||
private void updateAdapterData() {
|
||||
String imageUrlsString = TextUtils.join(",", uploadedUrls);
|
||||
MvpPre.upAddAlbum(albumId, imageUrlsString, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getAlbumDetail(albumId, pwd, "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_album_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AlbumDetailPresenter bindPresenter() {
|
||||
return new AlbumDetailPresenter(this, this);
|
||||
}
|
||||
|
||||
private void updateZanButtonUI(AlbumBean albumBean) {
|
||||
if (albumBean.getIs_like().equals("0")) {
|
||||
mBinding.zanImage.setImageResource(com.xscm.moduleutil.R.mipmap.shousz); // 已点赞图标
|
||||
mBinding.dyComment.setText(Integer.parseInt(albumBean.getLike_num()) - 1 + "");
|
||||
} else {
|
||||
mBinding.zanImage.setImageResource(com.xscm.moduleutil.R.mipmap.showszc); // 未点赞图标
|
||||
mBinding.dyComment.setText(Integer.parseInt(albumBean.getLike_num()) + 1 + "");
|
||||
}
|
||||
}
|
||||
|
||||
private List<AlbumBean.ImageList> groupPhotos(List<AlbumBean.ImageList> photoItems) {
|
||||
List<AlbumBean.ImageList> result = new ArrayList<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
||||
|
||||
Map<String, List<AlbumBean.ImageList>> groupedMap = new LinkedHashMap<>();
|
||||
|
||||
// 按日期分组
|
||||
for (AlbumBean.ImageList item : photoItems) {
|
||||
try {
|
||||
long timestamp = Long.parseLong(item.getCreatetime()) * 1000L;
|
||||
String dateKey = sdf.format(new Date(timestamp));
|
||||
groupedMap.computeIfAbsent(dateKey, k -> new ArrayList<>()).add(item);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
// 构建新的列表,插入标题
|
||||
for (Map.Entry<String, List<AlbumBean.ImageList>> entry : groupedMap.entrySet()) {
|
||||
// 添加标题
|
||||
AlbumBean.ImageList header = new AlbumBean.ImageList();
|
||||
header.setItemViewType(1);
|
||||
header.setCreatetime(entry.getKey()); // 存储原始时间字符串用于显示
|
||||
result.add(header);
|
||||
|
||||
// 添加该组所有图片
|
||||
for (AlbumBean.ImageList image : entry.getValue()) {
|
||||
image.setItemViewType(2);
|
||||
result.add(image);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getAlbumDetail(AlbumBean albumBean) {
|
||||
userId = albumBean.getUser_id();
|
||||
albumBean1 = albumBean;
|
||||
ImageUtils.loadHeadCC(albumBean.getImage(), mBinding.ivAlbumDetailBg);
|
||||
mBinding.tvAlbumName.setText(albumBean.getName());
|
||||
mBinding.tvAlbumNum.setText(albumBean.getCount() + "张照片");
|
||||
mBinding.imCrAlbum.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.topBar.setRightTxtVisible(userId.equals(SpUtil.getUserId() + ""));
|
||||
if (albumBean.getPwd() != null && !albumBean.getPwd().isEmpty()) {
|
||||
mBinding.imSuo.setVisibility(VISIBLE);
|
||||
} else {
|
||||
mBinding.imSuo.setVisibility(View.GONE);
|
||||
}
|
||||
mBinding.dyComment.setText(albumBean.getLike_num() != null && !albumBean.getLike_num().isEmpty() ? albumBean.getLike_num() : "0");
|
||||
mBinding.lockComment.setText(albumBean.getRead_num() != null && !albumBean.getRead_num().isEmpty() ? albumBean.getRead_num() : "0");
|
||||
List<AlbumBean.ImageList> allImages = albumBean.getImage_list();
|
||||
List<AlbumBean.ImageList> groupedPhotos = groupPhotos(allImages);
|
||||
adapter.setNewData(groupedPhotos);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.BindCardAdapter;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityBindCardBinding;
|
||||
import com.example.modulevocal.presenter.WithdrawalPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/11
|
||||
*@description: 绑卡管理界面
|
||||
*/
|
||||
public class BindCardActivity extends BaseMvpActivity<WithdrawalPresenter, ActivityBindCardBinding> implements WithdrawalConacts.View {
|
||||
private BindCardAdapter bindTypeAdapter;
|
||||
private BindType.AllData selectedItem;
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
List<BindType.AllData> allData = new ArrayList<>();
|
||||
if (bindType.getAli().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli());
|
||||
}
|
||||
if (bindType.getWx().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx());
|
||||
}
|
||||
if (bindType.getBank().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getBank());
|
||||
}
|
||||
if (bindType.getAli_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli_tl());
|
||||
}
|
||||
if (bindType.getWx_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx_tl());
|
||||
}
|
||||
|
||||
bindTypeAdapter.setNewData(allData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWalletConfig(WalletConfig walletConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawal(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawalList(List<WithdrawalBean> list) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.diamond_to_bangka));
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new BindCardAdapter(R.layout.item_bind_card);
|
||||
mBinding.recycleView.setAdapter(bindTypeAdapter);
|
||||
|
||||
bindTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
// 更新选中项
|
||||
bindTypeAdapter.setSelectedPosition(position);
|
||||
|
||||
// 获取当前选中的数据
|
||||
selectedItem = bindTypeAdapter.getItem(position);
|
||||
// 可以在这里处理选中逻辑,比如保存到变量或触发支付
|
||||
|
||||
Intent intent = new Intent(this, BindCardDetailsActivity.class);
|
||||
intent.putExtra("type", selectedItem.getType());
|
||||
startActivity(intent);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.bindType(SpUtil.getUserId()+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_bind_card;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WithdrawalPresenter bindPresenter() {
|
||||
return new WithdrawalPresenter(this,this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityBindCardDetailsBinding;
|
||||
import com.example.modulevocal.presenter.WithdrawalPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/11
|
||||
*@description:绑卡详情页面
|
||||
*/
|
||||
public class BindCardDetailsActivity extends BaseMvpActivity<WithdrawalPresenter, ActivityBindCardDetailsBinding> implements WithdrawalConacts.View {
|
||||
|
||||
private String type;//1:微信 2:支付宝 3:银行卡
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
type=getIntent().getStringExtra("type");
|
||||
|
||||
if (type.equals("1")){
|
||||
mBinding.topBar.setTitle("微信绑卡");
|
||||
mBinding.cet1.setVisibility(VISIBLE);
|
||||
mBinding.cet2.setVisibility(GONE);
|
||||
mBinding.cet3.setVisibility(GONE);
|
||||
mBinding.cet4.setVisibility(GONE);
|
||||
mBinding.cet1.setHint("微信账户");
|
||||
}else if (type.equals("2")){
|
||||
mBinding.topBar.setTitle("支付宝绑卡");
|
||||
mBinding.cet1.setVisibility(VISIBLE);
|
||||
mBinding.cet2.setVisibility(GONE);
|
||||
mBinding.cet3.setVisibility(GONE);
|
||||
mBinding.cet4.setVisibility(GONE);
|
||||
mBinding.cet1.setHint("支付宝账户");
|
||||
} else if (type.equals("3")) {
|
||||
mBinding.topBar.setTitle("银行卡绑卡");
|
||||
mBinding.cet1.setVisibility(GONE);
|
||||
mBinding.cet2.setVisibility(VISIBLE);
|
||||
mBinding.cet3.setVisibility(VISIBLE);
|
||||
mBinding.cet4.setVisibility(VISIBLE);
|
||||
mBinding.cet2.setHint("银行卡号");
|
||||
mBinding.cet3.setHint("所属银行");
|
||||
mBinding.cet4.setHint("银行卡开户行");
|
||||
}
|
||||
|
||||
|
||||
mBinding.tvSend.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (type.equals("1")){
|
||||
if (mBinding.cet1.getText().toString().isEmpty()){
|
||||
ToastUtils.show("请输入微信账户");
|
||||
return;
|
||||
}
|
||||
MvpPre.bind(SpUtil.getUserId()+"",type,mBinding.cet1.getText().toString(),"","","");
|
||||
}else if (type.equals("2")){
|
||||
if (mBinding.cet1.getText().toString().isEmpty()){
|
||||
ToastUtils.show("请输入支付宝账户");
|
||||
return;
|
||||
}
|
||||
MvpPre.bind(SpUtil.getUserId()+"",type,mBinding.cet1.getText().toString(),"","","");
|
||||
}else if (type.equals("3")){
|
||||
if (mBinding.cet2.getText().toString().isEmpty()){
|
||||
ToastUtils.show("请输入银行卡号");
|
||||
return;
|
||||
}
|
||||
if (mBinding.cet3.getText().toString().isEmpty()){
|
||||
ToastUtils.show("请输入所属银行");
|
||||
return;
|
||||
}
|
||||
if (mBinding.cet4.getText().toString().isEmpty()){
|
||||
ToastUtils.show("请输入银行卡开户行");
|
||||
return;
|
||||
}
|
||||
MvpPre.bind(SpUtil.getUserId()+"",type,"",mBinding.cet2.getText().toString(),mBinding.cet3.getText().toString(),mBinding.cet4.getText().toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_bind_card_details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWalletConfig(WalletConfig walletConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawal(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawalList(List<WithdrawalBean> list) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected WithdrawalPresenter bindPresenter() {
|
||||
return new WithdrawalPresenter(this, this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.BlackAdapter;
|
||||
import com.example.modulevocal.conacts.BlacklistConacts;
|
||||
import com.example.modulevocal.databinding.ActivityBlacklistBinding;
|
||||
import com.example.modulevocal.presenter.BlacklistPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BlackUserBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author
|
||||
*@data
|
||||
*@description: 黑名单
|
||||
*/
|
||||
public class BlacklistActivity extends BaseMvpActivity<BlacklistPresenter,ActivityBlacklistBinding> implements BlacklistConacts.View{
|
||||
|
||||
private static final String TAG = "BlacklistActivity";
|
||||
private int type;//关注--黑名单--粉丝
|
||||
BlackAdapter blackAdapter;
|
||||
private String[] mTitles = new String[]{"关注", "黑名单", "粉丝","访客"};
|
||||
List<BlackUserBean> blackUserBeans;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (MvpPre==null){
|
||||
MvpPre=new BlacklistPresenter(this,this);
|
||||
}
|
||||
MvpPre.getUserFollowList(String.valueOf(type), "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlacklistPresenter bindPresenter() {
|
||||
return new BlacklistPresenter(this,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
type=getIntent().getIntExtra("type", 0);
|
||||
mBinding.topBar.setTitle(mTitles[type]);
|
||||
|
||||
blackAdapter = new BlackAdapter();
|
||||
mBinding.rvBlacklist.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
mBinding.rvBlacklist.setAdapter(blackAdapter);
|
||||
blackAdapter.setOnItemClickListener(item -> {
|
||||
int position = blackAdapter.getData().indexOf(item);
|
||||
if (position == -1) return;
|
||||
|
||||
if (item.getType() == 0 || item.getType() == 2) {
|
||||
// 类型为 关注 或 粉丝:切换 status
|
||||
if (item.getIs_follow()==1){
|
||||
item.setIs_follow(0);
|
||||
}else {
|
||||
item.setIs_follow(1);
|
||||
}
|
||||
// item.setStatus(item.getIs_follow() == 1? 1 : 0);
|
||||
blackAdapter.notifyItemChanged(position);
|
||||
// updateStatusOnServer(item); // 调用网络请求更新服务器
|
||||
MvpPre.userGuanz(String.valueOf(item.getUser_id()),"1");
|
||||
} else if (item.getType() == 1) {
|
||||
// 类型为 黑名单:移除当前项
|
||||
blackAdapter.getData().remove(position);
|
||||
blackAdapter.notifyItemRemoved(position);
|
||||
blackAdapter.notifyItemRangeChanged(position, blackAdapter.getItemCount());
|
||||
// removeItemFromServer(item); // 调用网络请求删除
|
||||
MvpPre.removeBlackList(String.valueOf(item.getUser_id()));
|
||||
}else if (item.getType() == 3){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_blacklist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getUserFollowList(List<BlackUserBean> list, String type) {
|
||||
if (type.equals("0")){
|
||||
if (list!=null){
|
||||
List<BlackUserBean> blackUserBeans = new ArrayList<>();
|
||||
for (BlackUserBean item:list){
|
||||
item.setType(0);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}
|
||||
}else if (type.equals("1")){
|
||||
if (list!=null){
|
||||
List<BlackUserBean> blackUserBeans = new ArrayList<>();
|
||||
for (BlackUserBean item:list){
|
||||
item.setType(1);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}
|
||||
}else if (type.equals("2")){
|
||||
if (list!=null){
|
||||
List<BlackUserBean> blackUserBeans = new ArrayList<>();
|
||||
for (BlackUserBean item:list){
|
||||
item.setType(2);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}
|
||||
}else if (type.equals("3")){
|
||||
if (list!=null){
|
||||
List<BlackUserBean> blackUserBeans = new ArrayList<>();
|
||||
for (BlackUserBean item:list){
|
||||
item.setType(3);
|
||||
blackUserBeans.add(item);
|
||||
}
|
||||
blackAdapter.setNewData(blackUserBeans);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userGuanzSuccess(String s) {
|
||||
// MvpPre.getUserFollowList(String.valueOf(type), "1", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeBlackList() {
|
||||
MvpPre.getUserFollowList(String.valueOf(type), "1", "10");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.BriefIntroductionConacts;
|
||||
import com.example.modulevocal.databinding.ActivityBriefIntroductionBinding;
|
||||
import com.example.modulevocal.presenter.BriefIntroductionPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/22
|
||||
*@description: 简介
|
||||
*/
|
||||
public class BriefIntroductionActivity extends BaseMvpActivity<BriefIntroductionPresenter, ActivityBriefIntroductionBinding> implements BriefIntroductionConacts.View{
|
||||
|
||||
private BaseQuickAdapter<UserTagBean, BaseViewHolder> adapter;
|
||||
private List<UserTagBean> userTagBeans = new ArrayList<>();
|
||||
private Set<UserTagBean> selectedItems = new HashSet<>();
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("修改简介");
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightText("保存");
|
||||
mBinding.topBar.setRightColor(Color.parseColor("#FF8ACC"));
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
if (!TextUtils.isEmpty(mBinding.etG.getText().toString())){
|
||||
MvpPre.editUserInfo("","","","","",mBinding.etG.getText().toString(),getSelectedIds());
|
||||
}
|
||||
});
|
||||
|
||||
MvpPre.getUserTagList();
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new GridLayoutManager(this, 4));
|
||||
|
||||
adapter = new BaseQuickAdapter<UserTagBean, BaseViewHolder>(R.layout.item_brief_introduction, userTagBeans) {
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, UserTagBean item) {
|
||||
helper.setText(R.id.tv, item.getTag_name());
|
||||
if (selectedItems.contains(item)) {
|
||||
helper.itemView.setBackgroundColor(Color.parseColor("#FF8ACC"));
|
||||
} else {
|
||||
helper.itemView.setBackgroundColor(Color.WHITE);
|
||||
}
|
||||
|
||||
helper.itemView.setOnClickListener(v -> {
|
||||
if (selectedItems.contains(item)) {
|
||||
selectedItems.remove(item);
|
||||
} else {
|
||||
selectedItems.add(item);
|
||||
}
|
||||
notifyItemChanged(helper.getAdapterPosition());
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
mBinding.recycleView.setAdapter(adapter);
|
||||
|
||||
}
|
||||
private String getSelectedIds() {
|
||||
return selectedItems.stream()
|
||||
.map(UserTagBean::getId)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_brief_introduction;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BriefIntroductionPresenter bindPresenter() {
|
||||
return new BriefIntroductionPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getUserTagListSuccess(List<UserTagBean> data) {
|
||||
adapter.setNewData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editUserInfoSuccess(String s) {
|
||||
ToastUtils.showShort(s);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.ChangePasswordConactos;
|
||||
import com.example.modulevocal.databinding.ActivityChangePasswordBinding;
|
||||
import com.example.modulevocal.presenter.ChangePasswordPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/8/15
|
||||
*@description: 设置密码
|
||||
*/
|
||||
public class ChangPassActivity extends BaseMvpActivity<ChangePasswordPresenter, ActivityChangePasswordBinding> implements ChangePasswordConactos.View {
|
||||
private UserBean userBean;
|
||||
private CountDownTimer mTimer;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.set_password));
|
||||
userBean = SpUtil.getUserBean();
|
||||
mBinding.tvPhoin.setText(userBean.getMobile());
|
||||
mBinding.tvSendCode.setOnClickListener(this::onClick);
|
||||
mBinding.btnSubmit.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.tvSendCode.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.btnSubmit, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.btnSubmit.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_send_code) {
|
||||
sendCodeSuccess2(userBean.getMobile());
|
||||
if (MvpPre != null) {
|
||||
MvpPre.sendCode(userBean.getMobile(), "4");
|
||||
}
|
||||
}else if (view.getId() == R.id.btnSubmit) {
|
||||
|
||||
if (mBinding.editTextNewPassword.getText().toString().isEmpty()) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入新密码");
|
||||
return;
|
||||
}
|
||||
if (mBinding.editTextConfirmPassword.getText().toString().isEmpty()) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入确认密码");
|
||||
return;
|
||||
}
|
||||
if (!mBinding.editTextNewPassword.getText().toString().equals(mBinding.editTextConfirmPassword.getText().toString())) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("两次密码不一致");
|
||||
return;
|
||||
}
|
||||
if (mBinding.edPassword.getText().toString().isEmpty()) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入验证码");
|
||||
return;
|
||||
}
|
||||
if (MvpPre != null) {
|
||||
MvpPre.changePassword(mBinding.editTextNewPassword.getText().toString(), userBean.getMobile(), mBinding.edPassword.getText().toString(),String.valueOf(userBean.getUser_id()));
|
||||
}
|
||||
}
|
||||
}
|
||||
public void sendCodeSuccess2(String phoneNumber) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("短信验证码发送成功请注意查收");
|
||||
mBinding.tvSendCode.setEnabled(false);
|
||||
mBinding.tvSendCode.setAlpha(0.5f);
|
||||
releaseTimer();
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
}
|
||||
mTimer = new CountDownTimer(60000L, 1000L) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
if (mBinding.tvSendCode != null) {
|
||||
mBinding.tvSendCode.setText(String.format("重新发送(%s)", millisUntilFinished / 1000));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
mBinding.tvSendCode.setAlpha(1f);
|
||||
mBinding.tvSendCode.setEnabled(true);
|
||||
mBinding.tvSendCode.setText("重新发送");
|
||||
}
|
||||
};
|
||||
mTimer.start();
|
||||
}
|
||||
|
||||
private void releaseTimer() {
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
mTimer = null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_change_password;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ChangePasswordPresenter bindPresenter() {
|
||||
return new ChangePasswordPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess1(String phoneNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess(String s) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.ChangeNicknameConacts;
|
||||
import com.example.modulevocal.databinding.ActivityChangeNicknameBinding;
|
||||
import com.example.modulevocal.presenter.ChangeNicknamePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/21
|
||||
*@description: 修改昵称
|
||||
*/
|
||||
public class ChangeNicknameActivity extends BaseMvpActivity<ChangeNicknamePresenter, ActivityChangeNicknameBinding> implements ChangeNicknameConacts.View {
|
||||
|
||||
private UserInfo userInfo;
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
mBinding.topBar.setTitle("修改昵称");
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightText("保存");
|
||||
mBinding.topBar.setRightColor(Color.parseColor("#FF8ACC"));
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
if (!TextUtils.isEmpty(mBinding.edNickName.getText().toString())){
|
||||
MvpPre.editUserInfo(mBinding.edNickName.getText().toString(),"","","","","","");
|
||||
}
|
||||
});
|
||||
userInfo= SpUtil.getUserInfo();
|
||||
if (userInfo!=null){
|
||||
mBinding.edNickName.setText(userInfo.getNickname());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_change_nickname;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ChangeNicknamePresenter bindPresenter() {
|
||||
return new ChangeNicknamePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editUserInfoSuccess(String s) {
|
||||
ToastUtils.showShort(s);
|
||||
userInfo.setNickname(mBinding.edNickName.getText().toString());
|
||||
UserBean userBean =SpUtil.getUserBean();
|
||||
userBean.setNickname(mBinding.edNickName.getText().toString());
|
||||
EventBus.getDefault().post(userBean);
|
||||
EventBus.getDefault().post(userInfo);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyAlbumConacts;
|
||||
import com.example.modulevocal.databinding.ActivityCreateAlbumBinding;
|
||||
import com.example.modulevocal.presenter.MyAlbumPresenter;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
import com.zcw.togglebutton.ToggleButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/6
|
||||
* @description: 新建相册
|
||||
*/
|
||||
@Route(path = ARouteConstants.CREATE_ALBUM)
|
||||
public class CreateAlbumActivity extends BaseMvpActivity<MyAlbumPresenter, ActivityCreateAlbumBinding> implements MyAlbumConacts.View {
|
||||
|
||||
@Autowired
|
||||
public AlbumBean albumBean;
|
||||
private String imageUrl = "";
|
||||
boolean aBoolean = false;
|
||||
boolean albumBeanBoolean = false;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (albumBean != null) {
|
||||
mBinding.topBar.setTitle("修改相册");
|
||||
albumBeanBoolean = true;
|
||||
mBinding.tvDele.setVisibility(View.VISIBLE);
|
||||
ImageUtils.loadHeadCC(albumBean.getImage(), mBinding.rivAlbum);
|
||||
imageUrl = albumBean.getImage();
|
||||
mBinding.edAlbumName.setText(albumBean.getName());
|
||||
if (albumBean.getPwd() != null && !albumBean.getPwd().isEmpty()) {
|
||||
mBinding.btnRadio.setToggleOn(true);
|
||||
mBinding.edAlbumPassword.setText(albumBean.getPwd());
|
||||
mBinding.edAlbumPassword.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.btnRadio.setToggleOn(false);
|
||||
mBinding.edAlbumPassword.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
mBinding.topBar.setTitle("新建相册");
|
||||
albumBeanBoolean = false;
|
||||
mBinding.tvDele.setVisibility(View.GONE);
|
||||
}
|
||||
mBinding.tvDele.setOnClickListener(this::onClick);
|
||||
mBinding.rivAlbum.setOnClickListener(this::onClick);
|
||||
mBinding.tvConfirm.setOnClickListener(this::onClick);
|
||||
mBinding.btnRadio.setOnToggleChanged(new ToggleButton.OnToggleChanged() {
|
||||
@Override
|
||||
public void onToggle(boolean on) {
|
||||
if (on) {
|
||||
aBoolean = true;
|
||||
mBinding.edAlbumPassword.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.edAlbumPassword.setVisibility(View.GONE);
|
||||
aBoolean = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( mBinding.tvConfirm, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvConfirm.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.riv_album) {
|
||||
startChoosePhoto(1, PictureConfig.CHOOSE_REQUEST, false, 1);
|
||||
} else if (view.getId() == R.id.tv_confirm) {
|
||||
if (!Objects.requireNonNull(mBinding.edAlbumName.getText()).toString().trim().isEmpty() || !imageUrl.equals("")) {
|
||||
if (mBinding.edAlbumName.getText().toString().length() > 6) {
|
||||
ToastUtils.showShort("相册名称不能多于6个字");
|
||||
return;
|
||||
} else if (aBoolean) {
|
||||
if (mBinding.edAlbumPassword.getText().toString().length() < 4) {
|
||||
ToastUtils.showShort("密码不能少于4个字");
|
||||
return;
|
||||
} else {
|
||||
if (albumBeanBoolean){
|
||||
MvpPre.editAlbum(albumBean.getId(), mBinding.edAlbumName.getText().toString().trim(), mBinding.edAlbumPassword.getText().toString(), imageUrl);
|
||||
}else {
|
||||
MvpPre.createAlbum(mBinding.edAlbumName.getText().toString().trim(), mBinding.edAlbumPassword.getText().toString(), imageUrl);
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (albumBeanBoolean){
|
||||
MvpPre.editAlbum(albumBean.getId(), mBinding.edAlbumName.getText().toString().trim(), "", imageUrl);
|
||||
|
||||
}else {
|
||||
MvpPre.createAlbum(mBinding.edAlbumName.getText().toString().trim(), "", imageUrl);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请输入相册名称并选择相册封面");
|
||||
}
|
||||
} else {
|
||||
MvpPre.deleteAlbum(albumBean.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_create_album;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyAlbumPresenter bindPresenter() {
|
||||
return new MyAlbumPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAlbumList(List<AlbumBean> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type) {
|
||||
imageUrl = url;
|
||||
if (type == 1) {
|
||||
ImageUtils.loadHeadCC(url, mBinding.rivAlbum);
|
||||
} else {
|
||||
// list.add(new UserImgList("1", url));
|
||||
// mUserPhotoWallAdapter.setNewData(list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAlbum() {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", albumBean.getUser_id()).navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editAlbum() {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_ALBUM_DETAIL).withString("albumId", albumBean.getId()).withString("pwd", albumBean.getPwd()).navigation();
|
||||
finish();
|
||||
}
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .maxSelectNum(type)
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(true)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
switch (requestCode) {
|
||||
case PictureConfig.CHOOSE_REQUEST:
|
||||
List<LocalMedia> localMedia = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia != null && localMedia.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia.get(0);
|
||||
String url;
|
||||
if (imgMedia.isCompressed()) {
|
||||
url = imgMedia.getCompressPath();
|
||||
} else {
|
||||
url = imgMedia.getRealPath();
|
||||
}
|
||||
MvpPre.uploadFile(new File(url), 1);
|
||||
}
|
||||
break;
|
||||
case PictureConfig.REQUEST_CAMERA:
|
||||
List<LocalMedia> localMedia1 = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia1 != null && localMedia1.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia1.get(0);
|
||||
MvpPre.uploadFile(new File(imgMedia.getRealPath()), 3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.Editable;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.CreatedRoomConactos;
|
||||
import com.example.modulevocal.databinding.ActivityCreatedRoomBinding;
|
||||
import com.example.modulevocal.presenter.CreatedRoomPresenter;
|
||||
import com.example.zhouwei.library.CustomPopWindow;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author
|
||||
* @data 2025/5/15
|
||||
* @description: 创建房间
|
||||
*/
|
||||
@Route(path = ARouteConstants.CREATED_ROOM)
|
||||
public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, ActivityCreatedRoomBinding> implements CreatedRoomConactos.View {
|
||||
@Autowired
|
||||
public RoomInfoResp roomInfoResp;
|
||||
private String roomName;
|
||||
|
||||
public String from;
|
||||
|
||||
private String roomUrl;
|
||||
final int maxNum = 120;
|
||||
CustomPopWindow popupWindow;
|
||||
|
||||
private Handler handler = new Handler(Looper.getMainLooper());
|
||||
private boolean isShowing = false;
|
||||
private Runnable showPopupRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (isShowing) {
|
||||
// 隐藏 PopupWindow
|
||||
if (popupWindow != null) {
|
||||
popupWindow.dissmiss();
|
||||
}
|
||||
isShowing = false;
|
||||
} else {
|
||||
// 显示 PopupWindow
|
||||
if (popupWindow != null) {
|
||||
// 设置动画(可选)
|
||||
// 显示在 ivTrendContent 上方
|
||||
popupWindow.showAtLocation(mBinding.tvSave, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 220);
|
||||
}
|
||||
isShowing = true;
|
||||
}
|
||||
|
||||
// 循环执行
|
||||
handler.postDelayed(this, 2000); // 每隔 3 秒切换一次
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected CreatedRoomPresenter bindPresenter() {
|
||||
return new CreatedRoomPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// List<RoomTypeInfo> roomTypeInfos = new ArrayList<>();
|
||||
// roomTypeInfos.add(new RoomTypeInfo("聊天", 23));
|
||||
// roomTypeInfos.add(new RoomTypeInfo("K歌", 21));
|
||||
// mRoomTypeAdapter.setNewData(roomTypeInfos);
|
||||
|
||||
// MvpPre.roomLabel("create");
|
||||
handler.post(showPopupRunnable);
|
||||
// roomInfoResp = (RoomInfoResp) getIntent().getSerializableExtra("roomInfo");
|
||||
|
||||
if (roomInfoResp!=null){
|
||||
ImageUtils.loadHeadCC(roomInfoResp.getRoom_info().getRoom_cover(), mBinding.ivTrendContent);
|
||||
mBinding.edNickName.setText(roomInfoResp.getRoom_info().getRoom_name());
|
||||
mBinding.etG.setText(roomInfoResp.getRoom_info().getRoom_intro());
|
||||
roomUrl=roomInfoResp.getRoom_info().getRoom_cover();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
mBinding.topBar.setTitle("创建房间");
|
||||
mBinding.tvSave.setOnClickListener(this::onClick);
|
||||
mBinding.ivTrendContent.setOnClickListener(this::onClick);
|
||||
mBinding.tvSz.setText("0/" + maxNum);
|
||||
mBinding.etG.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.length() == maxNum) {
|
||||
mBinding.tvSz.setText("您输入的字数已超过限制");
|
||||
} else {
|
||||
mBinding.tvSz.setText((maxNum - s.length()) + "/" + maxNum);
|
||||
}
|
||||
}
|
||||
});
|
||||
popupWindow = new CustomPopWindow.PopupWindowBuilder(this)
|
||||
.setView(R.layout.pop_layout1)//显示的布局
|
||||
.setFocusable(false) // 关键点:不要抢占焦点
|
||||
.create();//创建PopupWindow
|
||||
mBinding.tvSave.post(() -> {
|
||||
if (!isFinishing() && !isDestroyed()) {
|
||||
popupWindow.showAsDropDown(mBinding.tvSave);
|
||||
}
|
||||
});
|
||||
mBinding.tvSujRoomName.setOnClickListener(this::onClick);
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvSave, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvSave.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
handler.removeCallbacks(showPopupRunnable);
|
||||
if (popupWindow != null) {
|
||||
popupWindow.dissmiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_created_room;
|
||||
}
|
||||
|
||||
|
||||
private long lastSaveClickTime = 0;
|
||||
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.tv_save) {
|
||||
if (roomUrl == null || roomUrl.isEmpty()) {
|
||||
ToastUtils.show("请选择封面");
|
||||
return;
|
||||
}
|
||||
long l = System.currentTimeMillis();
|
||||
if (l - lastSaveClickTime > 500) {
|
||||
lastSaveClickTime = l;
|
||||
roomName = mBinding.edNickName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(roomName)) {
|
||||
ToastUtils.show("请输入房间名");
|
||||
return;
|
||||
}
|
||||
if (roomInfoResp!=null){
|
||||
MvpPre.editRoom(roomInfoResp.getRoom_info().getRoom_id(), roomName, roomUrl,mBinding.etG.getText().toString(), "");
|
||||
}else {
|
||||
MvpPre.checkTxt(roomName, roomUrl, mBinding.etG.getText().toString());
|
||||
}
|
||||
}
|
||||
} else if (id == R.id.iv_trend_content) {
|
||||
startChoosePhoto(1, PictureConfig.CHOOSE_REQUEST);
|
||||
} else if (id == R.id.tv_suj_room_name) {
|
||||
MvpPre.roomName();
|
||||
}
|
||||
}
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(false)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .maxSelectNum(1)
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setMaxSelectNum(1)
|
||||
.isPreviewImage(true)
|
||||
.isDisplayCamera(true)
|
||||
.setOutputCameraDir(Constants.FILE_PATH)
|
||||
.isOriginalSkipCompress(true)
|
||||
|
||||
.forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
switch (requestCode) {
|
||||
case PictureConfig.CHOOSE_REQUEST:
|
||||
List<LocalMedia> localMedia = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia != null && localMedia.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia.get(0);
|
||||
String url;
|
||||
if (imgMedia.isCompressed()) {
|
||||
url = imgMedia.getCompressPath();
|
||||
} else {
|
||||
url = imgMedia.getRealPath();
|
||||
}
|
||||
MvpPre.uploadFile(new File(url), 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTxtSuccess(String result) {
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM).navigation();
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUserRoomSuccess(String roomId) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "创建房间").withString("roomId", roomId).navigation();
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type) {
|
||||
if (type == 0) {
|
||||
roomUrl = url;
|
||||
ImageUtils.loadHeadCC(url, mBinding.ivTrendContent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suijiRoomName(String s) {
|
||||
mBinding.edNickName.setText(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editRoom() {
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM).navigation();
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.DigitsKeyListener;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.CurrencyExchangeConacts;
|
||||
import com.example.modulevocal.databinding.ActivityCurrencyExchangeBinding;
|
||||
import com.example.modulevocal.presenter.CurrencyExchangePresenter;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/21
|
||||
*@description: 钻石兑换
|
||||
*/
|
||||
@Route(path = ARouteConstants.CURRENCY)
|
||||
public class CurrencyExchangeActivity extends BaseMvpActivity<CurrencyExchangePresenter, ActivityCurrencyExchangeBinding> implements CurrencyExchangeConacts.View{
|
||||
|
||||
WalletBean walletBean;
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("钻石兑换");
|
||||
mBinding.t5.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.tvPayment.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mBinding.etCustomAmount.getText().toString().isEmpty()){
|
||||
ToastUtils.showShort("请输入兑换数量");
|
||||
return;
|
||||
} else {
|
||||
MvpPre.exchangeCoin(mBinding.etCustomAmount.getText().toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.t5.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 获取 earnings 值
|
||||
String earnings = truncateToFirstDecimalPlace(walletBean.getEarnings());
|
||||
mBinding.etCustomAmount.setText(earnings);
|
||||
}
|
||||
});
|
||||
|
||||
TextInputEditText etCustomAmount = mBinding.etCustomAmount;
|
||||
|
||||
// 限制只能输入数字和小数点后一位
|
||||
etCustomAmount.setKeyListener(DigitsKeyListener.getInstance("0123456789."));
|
||||
etCustomAmount.setFilters(new InputFilter[]{ (source, start, end, dest, dstart, dend) -> {
|
||||
// 防止输入负号
|
||||
if (source.toString().contains("-")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String newText = dest.toString().substring(0, dstart) + source.toString() + dest.toString().substring(dend);
|
||||
|
||||
// 检查小数点
|
||||
if (newText.contains(".")) {
|
||||
String[] splitResult = newText.split("\\.");
|
||||
if (splitResult.length > 1 && splitResult[1].length() > 1) {
|
||||
// 小数点后只能有一位
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// 可选:限制最大长度
|
||||
if (newText.length() > 10) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return null;
|
||||
}});
|
||||
|
||||
// 可选:添加 TextWatcher 来监听输入内容变化
|
||||
etCustomAmount.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// 如果以小数点开头,自动补 0
|
||||
if (s.toString().startsWith(".")) {
|
||||
s.insert(0, "0");
|
||||
}
|
||||
// 如果以多个 0 开头,只保留一个
|
||||
if (s.toString().startsWith("0") && s.toString().length() > 1 && s.toString().charAt(1) != '.') {
|
||||
s.delete(0, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
private String truncateToFirstDecimalPlace(String value) {
|
||||
if (TextUtils.isEmpty(value)) return "0.0";
|
||||
|
||||
int dotIndex = value.indexOf('.');
|
||||
if (dotIndex == -1) {
|
||||
return value + ".0"; // 没有小数点,默认加 .0
|
||||
}
|
||||
|
||||
String integerPart = value.substring(0, dotIndex);
|
||||
String decimalPart = value.substring(dotIndex + 1);
|
||||
|
||||
if (decimalPart.length() >= 1) {
|
||||
return integerPart + "." + decimalPart.charAt(0); // 只取小数点后一位
|
||||
} else {
|
||||
return integerPart + ".0"; // 小数点后为空,默认加 0
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_currency_exchange;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CurrencyExchangePresenter bindPresenter() {
|
||||
return new CurrencyExchangePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.wallet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exchangeCoin(String earnings_num) {
|
||||
ToastUtils.showShort("兑换成功");
|
||||
MvpPre.wallet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
this.walletBean = walletBean;
|
||||
mBinding.tvJb.setText(walletBean.getEarnings());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWalletConfig(WalletConfig walletConfig) {
|
||||
mBinding.t3.setText("1钻石="+walletConfig.getCoin_exchange_rate()+"个金币");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.TaskBoxAdapter;
|
||||
import com.example.modulevocal.adapter.TaskDataAdapter;
|
||||
import com.example.modulevocal.adapter.TaskSectionAdapter;
|
||||
import com.example.modulevocal.conacts.DailyTasksConacts;
|
||||
import com.example.modulevocal.databinding.ActivityDailyTasksBinding;
|
||||
import com.example.modulevocal.presenter.DailyTasksPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.bean.GiftName;
|
||||
import com.xscm.moduleutil.bean.TaskItem;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/27
|
||||
* @description: 每日任务
|
||||
*/
|
||||
public class DailyTasksActivity extends BaseMvpActivity<DailyTasksPresenter, ActivityDailyTasksBinding> implements DailyTasksConacts.View {
|
||||
|
||||
private TaskBoxAdapter mTaskBoxAdapter;
|
||||
private TaskSectionAdapter mTaskDataAdapter;
|
||||
|
||||
private TaskDataAdapter taskDataAdapter;
|
||||
|
||||
@Override
|
||||
protected DailyTasksPresenter bindPresenter() {
|
||||
return new DailyTasksPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.tasksLihen();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
mBinding.topBar.setTitle("每日任务");
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightText("礼盒记录");
|
||||
mBinding.topBar.setRightColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
startActivity(new Intent(this, GiftBoxRecordActivity.class));
|
||||
});
|
||||
|
||||
mTaskBoxAdapter = new TaskBoxAdapter();
|
||||
mBinding.rvTask.setLayoutManager(new GridLayoutManager(this, 2, GridLayoutManager.VERTICAL, false));
|
||||
mBinding.rvTask.setAdapter(mTaskBoxAdapter);
|
||||
|
||||
|
||||
mBinding.imGz.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
|
||||
intent.putExtra("title", "规则 ");
|
||||
startActivity(intent);
|
||||
|
||||
// WebViewDialog webViewDialog=new WebViewDialog(this,"https://vespa.qxmier.com/web/index.html#/pages/other/taskDesc");
|
||||
// webViewDialog.show();
|
||||
|
||||
});
|
||||
|
||||
mTaskBoxAdapter.setOnItemClickListener(position -> {
|
||||
GiftBoxBean.GiftBean item = mTaskBoxAdapter.getItem(position);
|
||||
MvpPre.dailyTasksOpenBox(item.getId());
|
||||
});
|
||||
|
||||
// taskDataAdapter = new TaskDataAdapter();
|
||||
// taskDataAdapter.setItemClickLitener(new TaskDataAdapter.ItemClickLitener() {
|
||||
// @Override
|
||||
// public void onItemClick(View view, int position, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
// if (view.getId() == R.id.task_type){
|
||||
// MvpPre.dailyTasksOpenBox(item.getTask_id()+"");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// mTaskBoxAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
||||
// if (view.getId() == R.id.task_type){
|
||||
// TextView tv = (TextView) view;
|
||||
// if (tv.getText().toString().equals("领取金币")){
|
||||
// GiftBoxBean.TaskDataBean taskDataBean = (GiftBoxBean.TaskDataBean) adapter.getItem(position);
|
||||
// MvpPre.dailyTasksOpenBox(taskDataBean.getDaily_tasks().get(position).getTask_id()+"");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_daily_tasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGiftBox(GiftBoxBean giftBoxBean) {
|
||||
mBinding.tvTitle.setText("今日累计充值获得金币:" + (giftBoxBean.getUser_gold() != null ? giftBoxBean.getUser_gold() : "0"));
|
||||
mTaskBoxAdapter.setNewData(giftBoxBean.getGift_box_list());
|
||||
|
||||
mBinding.rvTaskToday.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
|
||||
List<TaskItem> sections = new ArrayList<>();
|
||||
// 每日任务
|
||||
sections.add(new TaskItem("今日任务", giftBoxBean.getTasks().getDaily_tasks()));
|
||||
// 特殊任务
|
||||
sections.add(new TaskItem("特殊任务", giftBoxBean.getTasks().getDaily_tasks_special()));
|
||||
// 平台任务
|
||||
sections.add(new TaskItem("平台任务", giftBoxBean.getTasks().getUsual_tasks()));
|
||||
mTaskDataAdapter = new TaskSectionAdapter(sections);
|
||||
mBinding.rvTaskToday.setAdapter(mTaskDataAdapter);
|
||||
mTaskDataAdapter.setOnItemClickListener(new TaskSectionAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(TaskItem taskItem, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
if (taskItem.getTitle().equals("今日任务") || taskItem.getTitle().equals("平台任务")) {
|
||||
if (item.getTask_status()==2) {
|
||||
MvpPre.dailyTasksReceive(item.getTask_id() + "");
|
||||
}
|
||||
} else {
|
||||
if (item.getTask_status() == 2){
|
||||
MvpPre.dailyTasksReceive(item.getTask_id() + "");
|
||||
}else if (item.getTask_status() == 1) {
|
||||
if (item.getTask_id() == 9) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", item.getFrom_id()).withString("taskId", item.getTask_id() + "").navigation();
|
||||
} else {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", item.getFrom_id()).withString("taskId", item.getTask_id() + "").navigation();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dailyTasksOpenBox(GiftName giftName) {
|
||||
ToastUtils.show(giftName.getGift_name());
|
||||
MvpPre.tasksLihen();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dailyTasksComplete() {
|
||||
ToastUtils.show("任务完成");
|
||||
MvpPre.tasksLihen();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,398 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.UserPhotoWallAdapter;
|
||||
import com.example.modulevocal.conacts.EditUserConactos;
|
||||
import com.example.modulevocal.databinding.ActivityEditUserBinding;
|
||||
import com.example.modulevocal.presenter.EditUserPresenter;
|
||||
import com.luck.picture.lib.basic.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.engine.CropFileEngine;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.bean.UserBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.XBannerData;
|
||||
import com.xscm.moduleutil.utils.DateSelectDialog;
|
||||
import com.xscm.moduleutil.utils.GlideEngine;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
import com.xscm.moduleutil.widget.picker.PictureSelectorUtil;
|
||||
import com.stx.xhb.xbanner.XBanner;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
|
||||
import com.yalantis.ucrop.UCrop;
|
||||
import com.yalantis.ucrop.UCropImageEngine;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/21
|
||||
* @description: 编辑资料
|
||||
*/
|
||||
public class EditUserInfoActivity extends BaseMvpActivity<EditUserPresenter, ActivityEditUserBinding> implements EditUserConactos.View
|
||||
, DateSelectDialog.OnSelectDate {
|
||||
UserPhotoWallAdapter mUserPhotoWallAdapter;
|
||||
List<String> list;
|
||||
private DateSelectDialog mDateSelectDialog;
|
||||
private UserInfo userInfo1;
|
||||
private List<String> uploadedUrls = new ArrayList<>();//真实图片地址
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getUserHome(SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.edit_profile));
|
||||
|
||||
int changeCount = 2; // 每月剩余修改次数
|
||||
int cardCount = 0; // 头像卡数量
|
||||
|
||||
// 获取字符串资源并替换参数
|
||||
String infoText = String.format(getResources().getString(com.xscm.moduleutil.R.string.avatar_change_info), changeCount, cardCount);
|
||||
mBinding.tv1.setText(Html.fromHtml(infoText));
|
||||
|
||||
|
||||
mBinding.rvPhotoWall.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
mBinding.rvPhotoWall.setAdapter(mUserPhotoWallAdapter = new UserPhotoWallAdapter());
|
||||
mUserPhotoWallAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
String item = list.get(position);
|
||||
int id = view.getId();
|
||||
if (id == R.id.iv_close) {
|
||||
uploadedUrls.remove(item);
|
||||
updateAdapterData();
|
||||
} else {
|
||||
if (item.equals(UserPhotoWallAdapter.ADD_PHOTO)) {
|
||||
// 点击的是“+”号,启动图片选择
|
||||
startChoosePhoto(1, PictureConfig.REQUEST_CAMERA, false, 9);
|
||||
} else {
|
||||
// 查看大图或其他操作
|
||||
FullScreenUtil.showFullScreenDialog(EditUserInfoActivity.this, position, list);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
mUserPhotoWallAdapter.setOnItemChildLongClickListener(new BaseQuickAdapter.OnItemChildLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
mUserPhotoWallAdapter.setLongClickPos(position);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
list = new ArrayList<>();
|
||||
// UserImgList userImgList = new UserImgList("0", "");
|
||||
// list.add(userImgList);
|
||||
// mUserPhotoWallAdapter.setNewData(list);
|
||||
mUserPhotoWallAdapter.setDelete(true);
|
||||
|
||||
mBinding.rl1.setOnClickListener(this::onClick);
|
||||
mBinding.rl3.setOnClickListener(this::onClick);
|
||||
mBinding.rl4.setOnClickListener(this::onClick);
|
||||
mBinding.rvUserHead.setOnClickListener(this::onClick);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.rv_user_head) {
|
||||
startChoosePhoto(1, PictureConfig.REQUEST_GO_SETTING, false, 1);
|
||||
} else if (view.getId() == R.id.rl_1) {
|
||||
startActivity(new Intent(this, ChangeNicknameActivity.class));
|
||||
} else if (view.getId() == R.id.rl_3) {
|
||||
if (mDateSelectDialog == null) {
|
||||
mDateSelectDialog = new DateSelectDialog(this);
|
||||
mDateSelectDialog.setmOnSelectDate(this);
|
||||
}
|
||||
mDateSelectDialog.show();
|
||||
} else if (view.getId() == R.id.rl_4) {
|
||||
startActivity(new Intent(this, BriefIntroductionActivity.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_edit_user;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EditUserPresenter bindPresenter() {
|
||||
return new EditUserPresenter(this, this);
|
||||
}
|
||||
|
||||
private void startChoosePhoto(int mimeType, int requestCode, boolean isVideo, int type) {
|
||||
|
||||
// PictureSelector.create(this)
|
||||
// .openGallery(mimeType)
|
||||
// .isGif(isVideo)
|
||||
// .imageEngine(GlideEngine.createGlideEngine())
|
||||
// .maxSelectNum(type)
|
||||
// .isPreviewImage(true)
|
||||
// .isCamera(true)
|
||||
// .setOutputCameraPath(Constants.FILE_PATH)
|
||||
// .isCompress(true)
|
||||
// .setPictureStyle(MyPictureParameterStyle.Companion.selectPicture())
|
||||
// .forResult(requestCode); //结果回调onActivityResult code
|
||||
|
||||
PictureSelectorUtil pictureSelectorUtil = new PictureSelectorUtil();
|
||||
|
||||
PictureSelector.create(this)
|
||||
.openGallery(mimeType)
|
||||
.isGif(isVideo)
|
||||
.setMaxSelectNum(type)
|
||||
.isPreviewImage(false)
|
||||
.setImageEngine(GlideEngine.createGlideEngine())
|
||||
.setImageEngine(GlideEngine.createGlideEngine()) // 选择器展示不出图片则添加
|
||||
.setCropEngine(new CropFileEngine() {
|
||||
@Override
|
||||
public void onStartCrop(Fragment fragment, Uri srcUri, Uri destinationUri, ArrayList<String> dataSource, int requestCode) {
|
||||
UCrop.Options options = pictureSelectorUtil.buildOptions();
|
||||
UCrop uCrop = UCrop.of(srcUri, destinationUri, dataSource);
|
||||
uCrop.withOptions(options);
|
||||
uCrop.setImageEngine(new UCropImageEngine() {
|
||||
@Override
|
||||
public void loadImage(Context context, String url, ImageView imageView) {
|
||||
// if (!ImageLoaderUtils.assertValidRequest(context)) {
|
||||
// return;
|
||||
// }
|
||||
Glide.with(context).load(url).override(180, 180).into(imageView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadImage(Context context, Uri url, int maxWidth, int maxHeight, OnCallbackListener<Bitmap> call) {
|
||||
Glide.with(context).asBitmap().load(url).override(maxWidth, maxHeight).into(new CustomTarget<Bitmap>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Bitmap resource, @org.jetbrains.annotations.Nullable Transition<? super Bitmap> transition) {
|
||||
if (call != null) {
|
||||
call.onCall(resource);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@org.jetbrains.annotations.Nullable Drawable placeholder) {
|
||||
if (call != null) {
|
||||
call.onCall(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
uCrop.start(fragment.requireActivity(), fragment, requestCode);
|
||||
}
|
||||
})
|
||||
.forResult(requestCode);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK && data != null) {
|
||||
switch (requestCode) {
|
||||
case PictureConfig.REQUEST_GO_SETTING:
|
||||
PictureSelector.create(EditUserInfoActivity.this)
|
||||
.openPreview() ;
|
||||
List<LocalMedia> localMedia1 = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia1 != null && localMedia1.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia1.get(0);
|
||||
String url;
|
||||
if (imgMedia.isCompressed()) {
|
||||
url = imgMedia.getCompressPath();
|
||||
} else {
|
||||
url = imgMedia.getRealPath();
|
||||
}
|
||||
MvpPre.uploadFile(new File(url), 1, 1, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case PictureConfig.CHOOSE_REQUEST:
|
||||
PictureSelector.create(EditUserInfoActivity.this)
|
||||
.openPreview() ;
|
||||
|
||||
List<LocalMedia> localMedia = PictureSelector.obtainSelectorList(data);
|
||||
if (localMedia != null && localMedia.size() != 0) {
|
||||
LocalMedia imgMedia = localMedia.get(0);
|
||||
String url;
|
||||
if (imgMedia.isCompressed()) {
|
||||
url = imgMedia.getCompressPath();
|
||||
} else {
|
||||
url = imgMedia.getRealPath();
|
||||
}
|
||||
MvpPre.uploadFile(new File(url), 0, 0, 1);
|
||||
}
|
||||
break;
|
||||
case PictureConfig.REQUEST_CAMERA:
|
||||
PictureSelector.create(EditUserInfoActivity.this)
|
||||
.openPreview() ;
|
||||
List<LocalMedia> localMediaList = PictureSelector.obtainSelectorList(data);
|
||||
|
||||
if (localMediaList != null && !localMediaList.isEmpty()) {
|
||||
List<File> imageFiles = new ArrayList<>();
|
||||
for (LocalMedia media : localMediaList) {
|
||||
String path = media.isCompressed() ? media.getCompressPath() : media.getRealPath();
|
||||
imageFiles.add(new File(path));
|
||||
}
|
||||
|
||||
// 开始批量上传
|
||||
MvpPre.batchUploadFiles(imageFiles, 0); // 第二个参数是你原来的 type
|
||||
|
||||
}
|
||||
|
||||
|
||||
// List<LocalMedia> localMedia2 = PictureSelector.obtainMultipleResult(data);
|
||||
// if (localMedia2 != null && localMedia2.size() != 0) {
|
||||
// LocalMedia imgMedia = localMedia2.get(0);
|
||||
// MvpPre.uploadFile(new File(imgMedia.getRealPath()), 6);
|
||||
// }
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getUserHomeSuccess(UserInfo userInfo) {
|
||||
SpUtil.saveUserInfo(userInfo);
|
||||
ImageUtils.loadHeadCC(userInfo.getAvatar(), mBinding.rvUserHead);
|
||||
mBinding.tvNickName.setText(userInfo.getNickname());
|
||||
mBinding.tvSex.setText(userInfo.getSex() == 1 ? "男" : "女");
|
||||
mBinding.tvSr.setText(userInfo.getBirthday());
|
||||
uploadedUrls.clear();
|
||||
List<String> images = userInfo.getHome_bgimages() != null && !userInfo.getHome_bgimages().isEmpty() ? Arrays.asList(userInfo.getHome_bgimages().split(",")) : new ArrayList<>();
|
||||
for (int i = 0; i < images.size(); i++) {
|
||||
uploadedUrls.add(images.get(i));
|
||||
}
|
||||
list.clear();
|
||||
list.addAll(uploadedUrls);
|
||||
list.add(UserPhotoWallAdapter.ADD_PHOTO); // 最后加上 ADD_PHOTO
|
||||
mUserPhotoWallAdapter.setNewData(list);
|
||||
userInfo1 = userInfo;
|
||||
List<XBannerData> s = new ArrayList<>();
|
||||
if (userInfo.getHome_bgimages() == null || userInfo.getHome_bgimages().isEmpty()) {
|
||||
|
||||
if (userInfo.getAvatar() != null) {
|
||||
s.add(new XBannerData(0, userInfo.getAvatar(), ""));
|
||||
}
|
||||
mBinding.xbanner.setBannerData(s);
|
||||
} else {
|
||||
for (String s1 : uploadedUrls) {
|
||||
s.add(new XBannerData(0, s1, ""));
|
||||
}
|
||||
mBinding.xbanner.setBannerData(s);
|
||||
}
|
||||
mBinding.xbanner.loadImage(new XBanner.XBannerAdapter() {
|
||||
@Override
|
||||
public void loadBanner(XBanner banner, Object model, View view, int position) {
|
||||
|
||||
XBannerData xBannerData = (XBannerData) model;
|
||||
ImageUtils.loadHeadCC(xBannerData.getUrl(), (ImageView) view);
|
||||
}
|
||||
});
|
||||
|
||||
// V2TIMUserFullInfo userFullInfo = new V2TIMUserFullInfo();
|
||||
// userFullInfo.setNickname(userInfo.getNickname());
|
||||
// userFullInfo.setFaceUrl(userInfo.getAvatar());
|
||||
// userFullInfo.setAllowType(userInfo.getSex());
|
||||
// V2TIMManager.getInstance().setSelfInfo(userFullInfo, new V2TIMCallback() {
|
||||
// @Override
|
||||
// public void onSuccess() {
|
||||
// LogUtils.e("@@@", "成功");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(int code, String desc) {
|
||||
// LogUtils.e("@@@", "描述" + desc);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editUserInfoSuccess(String s) {
|
||||
ToastUtils.showShort(s);
|
||||
MvpPre.getUserHome(SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void topicList(List<HeatedBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type, int index, int total) {
|
||||
if (type == 1) {
|
||||
ImageUtils.loadHeadCC(url, mBinding.rvUserHead);
|
||||
userInfo1.setAvatar(url);
|
||||
EventBus.getDefault().post(userInfo1);
|
||||
UserBean userBean = SpUtil.getUserBean();
|
||||
userBean.setAvatar(url);
|
||||
EventBus.getDefault().post(userBean);
|
||||
MvpPre.editUserInfo("", "", "", url, "", "", "");
|
||||
} else {
|
||||
// list.add(new UserImgList("1", url));
|
||||
// mUserPhotoWallAdapter.setNewData(list);
|
||||
|
||||
if (index >= 0 && index < uploadedUrls.size()) {
|
||||
uploadedUrls.add(index, url); // 插入到对应位置
|
||||
} else {
|
||||
uploadedUrls.add(url); // 添加到最后
|
||||
}
|
||||
|
||||
if (uploadedUrls.size() == total) {
|
||||
updateAdapterData(); // 所有图片上传完成,更新适配器数据
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateAdapterData() {
|
||||
list.clear();
|
||||
list.addAll(uploadedUrls); // 添加真实图片
|
||||
list.add(UserPhotoWallAdapter.ADD_PHOTO); // 最后加上 ADD_PHOTO
|
||||
mUserPhotoWallAdapter.setNewData(list);
|
||||
String imageUrlsString = TextUtils.join(",", uploadedUrls);
|
||||
// MvpPre.editUserInfo("", "", "", "", imageUrlsString, "", "");
|
||||
MvpPre.editUserBg(imageUrlsString);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void selectDate(String year, String month, String day) {
|
||||
mBinding.tvSr.setText(year + "-" + month + "-" + day);
|
||||
/* map.put("birthday", year + "-" + month + "-" + day);*/
|
||||
|
||||
MvpPre.editUserInfo("", year + "-" + month + "-" + day, "", "", "", "", "");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.GiftBoxAdapter;
|
||||
import com.example.modulevocal.conacts.GiftBoxRecordConacts;
|
||||
import com.example.modulevocal.databinding.ActivityGiftBoxRecordBinding;
|
||||
import com.example.modulevocal.presenter.GiftBoxRecordPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.GiftBoxRecordBean;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 礼盒记录界面
|
||||
*/
|
||||
public class GiftBoxRecordActivity extends BaseMvpActivity<GiftBoxRecordPresenter, ActivityGiftBoxRecordBinding> implements GiftBoxRecordConacts.View{
|
||||
|
||||
GiftBoxAdapter adapter;
|
||||
@Override
|
||||
public void dailyTasksBoxRecord(List<GiftBoxRecordBean> giftBoxRecordBeans) {
|
||||
RecyclerView recyclerView = findViewById(R.id.rv_gift_box_record);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
// 设置适配器
|
||||
adapter = new GiftBoxAdapter(giftBoxRecordBeans);
|
||||
recyclerView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GiftBoxRecordPresenter bindPresenter() {
|
||||
return new GiftBoxRecordPresenter(this,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.dailyTasksBoxRecord();
|
||||
mBinding.topBar.setTitle("每日任务");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_gift_box_record;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityMessageReminderBinding;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
|
||||
public class MessageReminderActivity extends BaseAppCompatActivity<ActivityMessageReminderBinding> {
|
||||
private Drawable mRadioCheckDrawable;
|
||||
private Drawable mRadioUnCheckDrawable;
|
||||
boolean aBoolean;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle("开播提示");
|
||||
mRadioCheckDrawable = ContextCompat.getDrawable(this, com.xscm.moduleutil.R.drawable.icon_btn_radio_1);
|
||||
mRadioUnCheckDrawable = ContextCompat.getDrawable(this, com.xscm.moduleutil.R.drawable.icon_btn_radio_0);
|
||||
mBinding.btnRadio.setOnClickListener(v -> {
|
||||
if (aBoolean){
|
||||
aBoolean=false;
|
||||
}else {
|
||||
aBoolean=true;
|
||||
}
|
||||
mBinding.btnRadio.setImageDrawable(aBoolean ? mRadioCheckDrawable : mRadioUnCheckDrawable);
|
||||
});
|
||||
mBinding.btnRadio.setImageDrawable(aBoolean ? mRadioCheckDrawable : mRadioUnCheckDrawable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_message_reminder;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyBagConacts;
|
||||
import com.example.modulevocal.databinding.ActivityMyBagBinding;
|
||||
import com.example.modulevocal.fragment.mybag.MyBagFragment;
|
||||
import com.example.modulevocal.fragment.mybag.MyBagListFragment;
|
||||
import com.example.modulevocal.presenter.MyBagPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.MyBagBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/22
|
||||
*@description: 我的背包
|
||||
*/
|
||||
public class MyBagActivity extends BaseMvpActivity<MyBagPresenter, ActivityMyBagBinding> implements MyBagConacts.View {
|
||||
|
||||
private List<MyBagBean> list;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("我的背包");
|
||||
|
||||
list=new ArrayList<>();
|
||||
list.add(new MyBagBean("背包道具", "1"));
|
||||
list.add(new MyBagBean("背包收入", "2"));
|
||||
list.add(new MyBagBean("背包支出", "3"));
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(), list));
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_my_bag;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyBagPresenter bindPresenter() {
|
||||
return new MyBagPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packIncome(List<MyBagDataBean> myBagDataBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packOutcome(List<MyBagDataBean> myBagDataBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<MyBagBean> list;
|
||||
|
||||
|
||||
public MyFragmentPagerAdapter(FragmentManager fm, List<MyBagBean> list) {
|
||||
super(fm);
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
if ("1".equals(model.getMyBagType())){
|
||||
return MyBagFragment.newInstance(model.getMyBagType());
|
||||
}else {
|
||||
return MyBagListFragment.newInstance(model.getMyBagType());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
return model.getMyBagTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyMoneyConactos;
|
||||
import com.example.modulevocal.databinding.ActivityMyMoneyBinding;
|
||||
import com.example.modulevocal.presenter.MyMoneyPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/21
|
||||
*@description: 我的钱包
|
||||
*/
|
||||
public class MyMoneyActivity extends BaseMvpActivity<MyMoneyPresenter, ActivityMyMoneyBinding> implements MyMoneyConactos.View {
|
||||
|
||||
private boolean isBind=false;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.wallet));
|
||||
mBinding.tvCz.setOnClickListener(this::onClick);
|
||||
mBinding.tvTx.setOnClickListener(this::onClick);
|
||||
mBinding.r3.setOnClickListener(this::onClick);
|
||||
mBinding.r1.setOnClickListener(this::onClick);
|
||||
mBinding.r2.setOnClickListener(this::onClick);
|
||||
mBinding.r4.setOnClickListener(this::onClick);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.wallet();
|
||||
MvpPre.bindType(SpUtil.getUserId() + "");
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId()==R.id.tv_cz){
|
||||
startActivity(new Intent(this, RechargeActivity.class));
|
||||
}else if (view.getId()==R.id.tv_tx){//提现
|
||||
if (!SpUtil.getRealName()){
|
||||
ToastUtils.show("实名认证后才能提现");
|
||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||
// startActivity(new Intent(this, RealName1Activity.class));
|
||||
return;
|
||||
}
|
||||
if (SpUtil.getUserBean().getMobile()==null||SpUtil.getUserBean().getMobile().equals("")){
|
||||
ToastUtils.show("请先绑定手机号");
|
||||
startActivity(new Intent(this, PhoneReplacementActivity.class));
|
||||
return;
|
||||
}
|
||||
if (isBind) {
|
||||
startActivity(new Intent(this, WithdrawalActivity.class));
|
||||
}else {
|
||||
ToastUtils.show("请先绑定银行卡");
|
||||
}
|
||||
}else if (view.getId()==R.id.r_3){//钻石换币
|
||||
startActivity(new Intent(this, CurrencyExchangeActivity.class));
|
||||
}else if (view.getId()==R.id.r_1){//金币收支
|
||||
Intent intent=new Intent(this, RevenueActivity.class);
|
||||
intent.putExtra("type","1");
|
||||
startActivity(intent);
|
||||
}else if (view.getId()==R.id.r_2){//钻石收支
|
||||
Intent intent=new Intent(this, RevenueActivity.class);
|
||||
intent.putExtra("type","2");
|
||||
startActivity(intent);
|
||||
}else if (view.getId()==R.id.r_4){//绑定管理
|
||||
startActivity(new Intent(this, BindCardActivity.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_my_money;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyMoneyPresenter bindPresenter() {
|
||||
return new MyMoneyPresenter(this,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
mBinding.tv1.setText(walletBean.getCoin());
|
||||
mBinding.tv2.setText(walletBean.getEarnings());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
List<BindType.AllData> allData = new ArrayList<>();
|
||||
if (bindType.getAli().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli());
|
||||
}
|
||||
if (bindType.getWx().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx());
|
||||
}
|
||||
if (bindType.getBank().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getBank());
|
||||
}
|
||||
if (bindType.getAli_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli_tl());
|
||||
}
|
||||
if (bindType.getWx_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx_tl());
|
||||
}
|
||||
|
||||
for (BindType.AllData data : allData){
|
||||
if (data.getIs_bind().equals("1")){
|
||||
isBind=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.RoomActivityMyRoomBinding;
|
||||
import com.example.modulevocal.fragment.MyCreateFragment;
|
||||
import com.example.modulevocal.fragment.MyFollowFragment;
|
||||
import com.example.modulevocal.fragment.MyManageFragment;
|
||||
import com.example.modulevocal.fragment.MyRoomListFragment;
|
||||
import com.example.modulevocal.presenter.MyRoomPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.CustomTopBar;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author
|
||||
*@data 2025/5/15
|
||||
*@description: 我的房间
|
||||
*/
|
||||
@Route(path = ARouteConstants.MY_ROOM)
|
||||
public class MyRoomActivity extends BaseMvpActivity<MyRoomPresenter, RoomActivityMyRoomBinding> implements MyRoomListContacts.View {
|
||||
public String from;
|
||||
public int auth_status;
|
||||
public String roomId;
|
||||
|
||||
@Override
|
||||
protected MyRoomPresenter bindPresenter() {
|
||||
return new MyRoomPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.viewPager.setAdapter(new MyFragmentAdapter(getSupportFragmentManager()));
|
||||
mBinding.viewPager.setOffscreenPageLimit(0);
|
||||
mBinding.tvCharm.setOnClickListener(v -> {
|
||||
resetTab(0);
|
||||
});
|
||||
mBinding.tvWealth.setOnClickListener(v -> {
|
||||
resetTab(1);
|
||||
});
|
||||
mBinding.tvManage.setOnClickListener(v -> {
|
||||
resetTab(2);
|
||||
});
|
||||
mBinding.tvInterest.setOnClickListener(v -> {
|
||||
resetTab(3);
|
||||
});
|
||||
|
||||
mBinding.viewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
resetTab(position); // 同步更新 Tab 样式
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
|
||||
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextSize(16);
|
||||
mBinding.tvWealth.setTextSize(14);
|
||||
mBinding.tvManage.setTextSize(14);
|
||||
mBinding.tvInterest.setTextSize(14);
|
||||
mBinding.tvCharm.setTypeface(null, Typeface.BOLD);
|
||||
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.vLine.setVisibility(View.VISIBLE);
|
||||
mBinding.vLine2.setVisibility(View.GONE);
|
||||
mBinding.vLine3.setVisibility(View.GONE);
|
||||
mBinding.vLine4.setVisibility(View.GONE);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void resetTab(int index) {
|
||||
if (mBinding.viewPager.getCurrentItem() == index) {
|
||||
return; // 已处于目标页面,无需重复操作
|
||||
}
|
||||
if (index == 0) {
|
||||
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
|
||||
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextSize(16);
|
||||
mBinding.tvWealth.setTextSize(14);
|
||||
mBinding.tvManage.setTextSize(14);
|
||||
mBinding.tvInterest.setTextSize(14);
|
||||
mBinding.tvCharm.setTypeface(null, Typeface.BOLD);
|
||||
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.vLine.setVisibility(View.VISIBLE);
|
||||
mBinding.vLine2.setVisibility(View.GONE);
|
||||
mBinding.vLine3.setVisibility(View.GONE);
|
||||
mBinding.vLine4.setVisibility(View.GONE);
|
||||
} else if (index == 1) {
|
||||
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
|
||||
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextSize(14);
|
||||
mBinding.tvWealth.setTextSize(16);
|
||||
mBinding.tvManage.setTextSize(14);
|
||||
mBinding.tvInterest.setTextSize(14);
|
||||
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvWealth.setTypeface(null, Typeface.BOLD);
|
||||
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.vLine.setVisibility(View.GONE);
|
||||
mBinding.vLine2.setVisibility(View.VISIBLE);
|
||||
mBinding.vLine3.setVisibility(View.GONE);
|
||||
mBinding.vLine4.setVisibility(View.GONE);
|
||||
} else if (index == 2) {
|
||||
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
|
||||
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextSize(14);
|
||||
mBinding.tvWealth.setTextSize(14);
|
||||
mBinding.tvManage.setTextSize(16);
|
||||
mBinding.tvInterest.setTextSize(14);
|
||||
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvManage.setTypeface(null, Typeface.BOLD);
|
||||
mBinding.tvInterest.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.vLine.setVisibility(View.GONE);
|
||||
mBinding.vLine2.setVisibility(View.GONE);
|
||||
mBinding.vLine3.setVisibility(View.VISIBLE);
|
||||
mBinding.vLine4.setVisibility(View.GONE);
|
||||
} else if (index == 3) {
|
||||
mBinding.tvWealth.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvCharm.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvManage.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack45));
|
||||
mBinding.tvInterest.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.colorBlack85));
|
||||
mBinding.tvCharm.setTextSize(14);
|
||||
mBinding.tvWealth.setTextSize(14);
|
||||
mBinding.tvManage.setTextSize(14);
|
||||
mBinding.tvInterest.setTextSize(16);
|
||||
mBinding.tvCharm.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvWealth.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvManage.setTypeface(null, Typeface.NORMAL);
|
||||
mBinding.tvInterest.setTypeface(null, Typeface.BOLD);
|
||||
mBinding.vLine.setVisibility(View.GONE);
|
||||
mBinding.vLine2.setVisibility(View.GONE);
|
||||
mBinding.vLine3.setVisibility(View.GONE);
|
||||
mBinding.vLine4.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mBinding.viewPager.setCurrentItem(index); // 禁用平滑滚动
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_activity_my_room;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
mBinding.topBar.setRightIcon(com.xscm.moduleutil.R.mipmap.trend_icon);
|
||||
mBinding.topBar.setImgPaddingRight(35);
|
||||
mBinding.topBar.setRightImgVIsible(true);
|
||||
initListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
boolean b = CommonAppContext.getInstance().isPlaying;
|
||||
if (b) {
|
||||
ImageLoader.loadHead(MyRoomActivity.this, mBinding.riv, CommonAppContext.getInstance().playCover);
|
||||
mBinding.riv.postDelayed(mRivAnimationTask, 1000);
|
||||
mBinding.ll.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.ll.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (CommonAppContext.getInstance().isPlaying && CommonAppContext.getInstance().isShow) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form", "首页").withString("roomId", CommonAppContext.getInstance().playId).navigation();
|
||||
}
|
||||
}
|
||||
|
||||
private final Runnable mRivAnimationTask = () -> {
|
||||
Animation rivRotateAnimation = AnimationUtils.loadAnimation(MyRoomActivity.this, com.xscm.moduleutil.R.anim.rotate_anim);
|
||||
mBinding.riv.startAnimation(rivRotateAnimation);
|
||||
};
|
||||
|
||||
private void initListener() {
|
||||
mBinding.topBar.addIntentListener(new CustomTopBar.OnCallBackRightIcon() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
// if ("我的界面".equals(from)) {
|
||||
// if (auth_status == 0) {
|
||||
// ToastUtils.show("实名认证后才能创建直播间");
|
||||
// MvpPre.getNameAuthResult(0);
|
||||
// return;
|
||||
// }
|
||||
// startActivity(new Intent(MyRoomActivity.this,CreatedRoomActivity.class));
|
||||
// }
|
||||
if (!SpUtil.getRealName()){
|
||||
ToastUtils.show("实名认证后才能创建直播间");
|
||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||
// startActivity(new Intent(MyRoomActivity.this, RealName1Activity.class));
|
||||
return;
|
||||
}
|
||||
startActivity(new Intent(MyRoomActivity.this,CreatedRoomActivity.class));
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyInfo(MyRoomBean myRoom) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<MyRoomBean> list, int type) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delfootSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyFootData(List<MyFootResp> data, int page) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManageData(List<ManageRoomResp> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttentionListData(List<AttentionResp> attentionResps) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
|
||||
private static class MyFragmentAdapter extends FragmentStatePagerAdapter {
|
||||
private SparseArray<Fragment> fragments = new SparseArray<>();
|
||||
private String[] titles = new String[]{"我创建的", "我主持的", "我管理的", "我关注的"};
|
||||
|
||||
private String roomId;
|
||||
|
||||
public MyFragmentAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
this.roomId = roomId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
Fragment fragment = fragments.get(position);
|
||||
if (fragment == null) {
|
||||
if (position == 0) {
|
||||
fragment = MyCreateFragment.newInstance(MyCreateFragment.TYPE_CREATE);
|
||||
} else if (position == 1) {
|
||||
fragment = MyRoomListFragment.newInstance(MyRoomListFragment.TYPE_HOST);
|
||||
} else if (position == 2) {
|
||||
fragment = MyManageFragment.newInstance(MyManageFragment.TYPE_GL);
|
||||
} else if (position == 3) {
|
||||
fragment = MyFollowFragment.newInstance(MyFollowFragment.TYPE_GZ);
|
||||
}
|
||||
fragments.put(position, fragment);
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return titles.length;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return titles[position];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityNotificationBinding;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
|
||||
public class NotificationActivity extends BaseAppCompatActivity<ActivityNotificationBinding> {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle("消息提醒");
|
||||
mBinding.llNotification.setOnClickListener(this::onClick);
|
||||
mBinding.llYouth.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId()==R.id.ll_youth){//私信
|
||||
startActivity(new Intent(this, UnderageActivity.class));
|
||||
}else if (view.getId()==R.id.ll_notification){//开播
|
||||
startActivity(new Intent(this, MessageReminderActivity.class));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_notification;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.PersonalityConacts;
|
||||
import com.example.modulevocal.databinding.ActivityPersonalityBinding;
|
||||
import com.example.modulevocal.fragment.zhuangb.ZhuangBanShangChengFragment;
|
||||
import com.example.modulevocal.presenter.PersonalityPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.adapter.MyPagerAdapter;
|
||||
import com.xscm.moduleutil.bean.PersonaltyBean;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/16
|
||||
* @description: 个性装扮
|
||||
*/
|
||||
public class PersonalityActivity extends BaseMvpActivity<PersonalityPresenter, ActivityPersonalityBinding> implements PersonalityConacts.View {
|
||||
private List<String> titleList = new ArrayList();
|
||||
private List<Fragment> mFragments = new ArrayList();
|
||||
|
||||
private MyPagerAdapter myAdapter;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (MvpPre==null){
|
||||
MvpPre=bindPresenter();
|
||||
}
|
||||
MvpPre.getPersonaltyList();
|
||||
|
||||
|
||||
// titleList.add("头像框");
|
||||
// titleList.add("座驾");
|
||||
// titleList.add("气泡");
|
||||
// titleList.add("个人靓号");
|
||||
// titleList.add("房间靓号");
|
||||
// titleList.add("工会靓号");
|
||||
//
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(1));
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(2));
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(3));
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(4));
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(5));
|
||||
// mFragments.add(ZhuangBanShangChengFragment.newInstance(6));
|
||||
|
||||
// myAdapter = new MyPagerAdapter(getSupportFragmentManager(), mFragments, titleList);
|
||||
// mBinding.viewPager.setAdapter(myAdapter);
|
||||
// mBinding.viewPager.setOffscreenPageLimit(mFragments.size());
|
||||
// mBinding.tabLayout.setupWithViewPager(mBinding.viewPager);
|
||||
// setCustomViews();
|
||||
|
||||
// mBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
// @Override
|
||||
// public void onTabSelected(TabLayout.Tab tab) {
|
||||
// updateTabView(tab, true);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onTabUnselected(TabLayout.Tab tab) {
|
||||
// updateTabView(tab, false);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onTabReselected(TabLayout.Tab tab) {
|
||||
// // 可选实现
|
||||
// }
|
||||
//
|
||||
// private void updateTabView(TabLayout.Tab tab, boolean isSelected) {
|
||||
// if (tab.getCustomView() == null) return;
|
||||
//
|
||||
// TextView text = tab.getCustomView().findViewById(R.id.tv_zbtab);
|
||||
// ImageView vView = tab.getCustomView().findViewById(R.id.v_view);
|
||||
//
|
||||
// if (text != null) {
|
||||
// if (isSelected) {
|
||||
// text.setTextColor(Color.parseColor("#333333"));
|
||||
// text.setTextSize(16f);
|
||||
// text.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
// } else {
|
||||
// text.setTextColor(Color.parseColor("#5B5B5B"));
|
||||
// text.setTextSize(14f);
|
||||
// text.setTypeface(Typeface.DEFAULT);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (vView != null) {
|
||||
// vView.setVisibility(isSelected ? View.VISIBLE : View.GONE);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PersonalityPresenter bindPresenter() {
|
||||
return new PersonalityPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightText(getResources().getString(com.xscm.moduleutil.R.string.shopping));
|
||||
mBinding.topBar.setRightColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
Intent intent=new Intent(this, WebViewActivity.class);
|
||||
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/prop/propMall?id="+SpUtil.getToken());
|
||||
intent.putExtra("title", "道具商城");
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_personality;
|
||||
}
|
||||
|
||||
// private void setCustomViews() {
|
||||
// int mSelectedTabPosition = mBinding.tabLayout.getSelectedTabPosition();
|
||||
// for (int i = 0; i < titleList.size(); i++) {
|
||||
// Objects.requireNonNull(mBinding.tabLayout.getTabAt(i)).setCustomView(getTabView(i, mSelectedTabPosition));
|
||||
// }
|
||||
// }
|
||||
|
||||
// private View getTabView(int index, int mSelectedTabPosition) {
|
||||
// // 自定义View布局
|
||||
// View view = LayoutInflater.from(this).inflate(R.layout.item_tablayout_headerzb, null);
|
||||
// TextView title = view.findViewById(R.id.tv_zbtab);
|
||||
// ImageView v_view = view.findViewById(R.id.v_view);
|
||||
// title.setText(titleList.get(index));
|
||||
// title.setSelected(index == mSelectedTabPosition);
|
||||
//// v_view.setSelected(index == mSelectedTabPosition);
|
||||
// v_view.setVisibility(index == mSelectedTabPosition ? View.VISIBLE : View.GONE);
|
||||
// if (index == mSelectedTabPosition) {
|
||||
// title.setTextColor(Color.parseColor("#333333"));
|
||||
// title.setTextSize(16f);
|
||||
// title.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
// // title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17f);
|
||||
// // title.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
// } else {
|
||||
// title.setTextColor(Color.parseColor("#5B5B5B"));
|
||||
// title.setTextSize(14f);
|
||||
// // title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15f);
|
||||
// // title.setTypeface(Typeface.DEFAULT);
|
||||
// }
|
||||
//
|
||||
// return view;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void getPersonaltyList(List<PersonaltyBean> personaltyBean) {
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(), personaltyBean));
|
||||
// mBinding.viewPager.setOffscreenPageLimit(mFragments.size());
|
||||
// mBinding.tabLayout.setupWithViewPager(mBinding.viewPager);
|
||||
// setCustomViews();
|
||||
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
}
|
||||
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<PersonaltyBean> list;
|
||||
private String userId;
|
||||
|
||||
|
||||
public MyFragmentPagerAdapter(FragmentManager fm, List<PersonaltyBean> list) {
|
||||
super(fm);
|
||||
this.list = list;
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
PersonaltyBean model = list.get(position);
|
||||
|
||||
return ZhuangBanShangChengFragment.newInstance(Integer.parseInt(model.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
PersonaltyBean model = list.get(position);
|
||||
return model.getName();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.View;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.PhoneReplacementConacts;
|
||||
import com.example.modulevocal.databinding.ActivityPhoneReplacementBinding;
|
||||
import com.example.modulevocal.presenter.PhoneReplacementPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseAppCompatActivity;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
/**
|
||||
*@author
|
||||
*@data
|
||||
*@description: 手机换绑
|
||||
*/
|
||||
public class PhoneReplacementActivity extends BaseMvpActivity<PhoneReplacementPresenter, ActivityPhoneReplacementBinding> implements PhoneReplacementConacts.View {
|
||||
private CountDownTimer mTimer;
|
||||
private String mobile;
|
||||
private String type;//1:更换手机 2:绑定手机
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (SpUtil.getUserBean().getMobile() == null || SpUtil.getUserBean().getMobile().equals("")) {
|
||||
type = "2";
|
||||
mBinding.topBar.setTitle("手机绑定");
|
||||
} else {
|
||||
type = "1";
|
||||
mBinding.topBar.setTitle("手机换绑");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PhoneReplacementPresenter bindPresenter() {
|
||||
return new PhoneReplacementPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mBinding.tvSendCode.setOnClickListener(this::onClick);
|
||||
mBinding.btnSubmit.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.tvSendCode.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.btnSubmit, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.btnSubmit.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_phone_replacement;
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_send_code) {
|
||||
if (mBinding.edPhone.getText().toString().isEmpty()) {
|
||||
ToastUtils.show("请输入手机号");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MvpPre == null) {
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
MvpPre.sendCode(mBinding.edPhone.getText().toString(), type);
|
||||
sendCodeSuccess2(mBinding.edPhone.getText().toString());
|
||||
} else if (view.getId() == R.id.btnSubmit) {
|
||||
|
||||
if (mBinding.edPhone.getText().toString().isEmpty()) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入手机号");
|
||||
return;
|
||||
}
|
||||
if (mBinding.edPassword.getText().toString().isEmpty()) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("请输入验证码");
|
||||
return;
|
||||
}
|
||||
if (MvpPre != null) {
|
||||
if (SpUtil.getUserBean().getMobile() == null || SpUtil.getUserBean().getMobile().equals("")) {
|
||||
MvpPre.mobileView(mBinding.edPhone.getText().toString(), mBinding.edPhone.getText().toString(), mBinding.edPassword.getText().toString(), type);
|
||||
} else {
|
||||
MvpPre.mobileView(SpUtil.getUserBean().getMobile(), mBinding.edPhone.getText().toString(), mBinding.edPassword.getText().toString(), type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendCodeSuccess2(String phoneNumber) {
|
||||
com.blankj.utilcode.util.ToastUtils.showShort("短信验证码发送成功请注意查收");
|
||||
mBinding.tvSendCode.setEnabled(false);
|
||||
mBinding.tvSendCode.setAlpha(0.5f);
|
||||
releaseTimer();
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
}
|
||||
mTimer = new CountDownTimer(60000L, 1000L) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
if (mBinding.tvSendCode != null) {
|
||||
mBinding.tvSendCode.setText(String.format("重新发送(%s)", millisUntilFinished / 1000));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
mBinding.tvSendCode.setAlpha(1f);
|
||||
mBinding.tvSendCode.setEnabled(true);
|
||||
mBinding.tvSendCode.setText("重新发送");
|
||||
}
|
||||
};
|
||||
mTimer.start();
|
||||
}
|
||||
|
||||
private void releaseTimer() {
|
||||
if (mTimer != null) {
|
||||
mTimer.cancel();
|
||||
mTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess1(String phoneNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess(String s) {
|
||||
if (s.contains("失败")) {
|
||||
ToastUtils.show(s);
|
||||
} else {
|
||||
ToastUtils.show(s);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.RealDetailConacts;
|
||||
import com.example.modulevocal.databinding.ActivityRealDeatilBinding;
|
||||
import com.example.modulevocal.presenter.RealDetailPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
|
||||
/**
|
||||
*@author
|
||||
*@data
|
||||
*@description: 已经实名认证后展示的页面
|
||||
*/
|
||||
public class RealDetailActivity extends BaseMvpActivity<RealDetailPresenter,ActivityRealDeatilBinding> implements RealDetailConacts.View{
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (MvpPre== null){
|
||||
MvpPre = new RealDetailPresenter(this, this);
|
||||
}
|
||||
MvpPre.realNameInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RealDetailPresenter bindPresenter() {
|
||||
return new RealDetailPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.real_name_authentication));
|
||||
mBinding.ll1.setOnClickListener(this::onClick);
|
||||
mBinding.ll2.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId()==R.id.ll_1||view.getId()==R.id.ll_2){
|
||||
// startActivity(new Intent(this, RealName1Activity.class));
|
||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_real_deatil;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void realNameInfo(RealNameBean realNameBean) {
|
||||
mBinding.tvName.setText(realNameBean.getReal_name());
|
||||
mBinding.tvIdNumber.setText(realNameBean.getCard_id());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import static com.xscm.moduleutil.utils.permission.PermissionUtils.TAG;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.adapter.PayMethodAdapter;
|
||||
import com.xscm.moduleutil.adapter.BalanceRechargeAdapter;
|
||||
import com.example.modulevocal.conacts.RechargeConactos;
|
||||
import com.example.modulevocal.databinding.ActivityRechargeBinding;
|
||||
import com.example.modulevocal.presenter.RechargePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.AppPay;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.widget.PaymentUtil;
|
||||
import com.tencent.liteav.base.Log;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/21
|
||||
* @description: 充值
|
||||
*/
|
||||
@Route(path = ARouteConstants.RECHARGE_ACTIVITY)
|
||||
public class RechargeActivity extends BaseMvpActivity<RechargePresenter, ActivityRechargeBinding> implements RechargeConactos.View {
|
||||
|
||||
private BalanceRechargeAdapter rechargeAdapter;
|
||||
private String money = "0";
|
||||
private String coin;
|
||||
private PayMethodAdapter bindTypeAdapter;
|
||||
private BindType.AllData selectedItem;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle(getResources().getString(com.xscm.moduleutil.R.string.recharge));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
// mBinding.ivWeixin.setImageLevel(1);
|
||||
mBinding.tvPayment.setOnClickListener(this::onClick);
|
||||
// mBinding.rlWeixinPay.setOnClickListener(this::onClick);
|
||||
|
||||
// mBinding.rlThreePay.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.recycleView1.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new PayMethodAdapter(com.xscm.moduleutil.R.layout.item_bind_type);
|
||||
mBinding.recycleView1.setAdapter(bindTypeAdapter);
|
||||
|
||||
bindTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
// 更新选中项
|
||||
bindTypeAdapter.setSelectedPosition(position);
|
||||
|
||||
// 获取当前选中的数据
|
||||
selectedItem = bindTypeAdapter.getItem(position);
|
||||
// 可以在这里处理选中逻辑,比如保存到变量或触发支付
|
||||
});
|
||||
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_payment) {
|
||||
if (money.equals("0")) {
|
||||
money=mBinding.etCustomAmount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(money)) {
|
||||
ToastUtils.showShort("请选择充值金额");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if (Double.valueOf(money) < 6) {
|
||||
// ToastUtils.showShort("最低充值6元以上");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (selectedItem == null) {
|
||||
ToastUtils.showShort("请选择支付方式");
|
||||
return;
|
||||
}
|
||||
MvpPre.appPay(SpUtil.getUserId() + "", money, coin, selectedItem.getType());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_recharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RechargePresenter bindPresenter() {
|
||||
return new RechargePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRechargeData(List<RechargeBean> rechargeData) {
|
||||
// 在数据源最后添加一个自定义项
|
||||
RechargeBean customItem = new RechargeBean();
|
||||
customItem.setCoins("自定义");
|
||||
customItem.setMoney("");
|
||||
customItem.setItemViewType(1);
|
||||
rechargeData.add(customItem);
|
||||
rechargeAdapter = new BalanceRechargeAdapter(rechargeData);
|
||||
rechargeAdapter.setNewData(rechargeData);
|
||||
rechargeAdapter.setListener(new BalanceRechargeAdapter.OnRechargeItemClickListener() {
|
||||
@Override
|
||||
public void onClick(RechargeBean rechargeBean) {
|
||||
money = rechargeBean.getMoney();
|
||||
coin = rechargeBean.getCoins();
|
||||
// mBinding.tvPayment.setText(String.format("立即支付(%s元)", money));
|
||||
}
|
||||
});
|
||||
rechargeAdapter.setInputBoxVisibilityListener(new BalanceRechargeAdapter.InputBoxVisibilityListener() {
|
||||
@Override
|
||||
public void onInputBoxVisibilityChanged(boolean isVisible) {
|
||||
// 根据 isVisible 的值来显示或隐藏输入框
|
||||
mBinding.r4.setVisibility(isVisible ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
mBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
|
||||
mBinding.recyclerView.setAdapter(rechargeAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.wallet();
|
||||
MvpPre.recharge();
|
||||
MvpPre.bindType(SpUtil.getUserId() + "");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
mBinding.tvJb.setText(walletBean.getCoin());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appPay(AppPay appPay) {
|
||||
if (appPay.getAli()!=null) {
|
||||
PaymentUtil.payAlipay(this, appPay.getAli());
|
||||
}else if (appPay.getWx()!=null){
|
||||
|
||||
IWXAPI wxapi = WXAPIFactory.createWXAPI(this, CommonAppContext.getInstance().getCurrentEnvironment().getWxAppId());
|
||||
PaymentUtil.payWxMiniProgram2(wxapi,appPay);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void onResp(BaseResp resp){
|
||||
if(resp.getType()== ConstantsAPI.COMMAND_PAY_BY_WX){
|
||||
Log.d(TAG,"onPayFinish,errCode="+resp.errCode);
|
||||
AlertDialog.Builder builder=new AlertDialog.Builder(this);
|
||||
builder.setTitle("");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
List<BindType.AllData> allData = new ArrayList<>();
|
||||
if (bindType.getAli().getIs_pay_open().equals("1")) {
|
||||
allData.add(bindType.getAli());
|
||||
}
|
||||
if (bindType.getWx().getIs_pay_open().equals("1")) {
|
||||
allData.add(bindType.getWx());
|
||||
}
|
||||
if (bindType.getBank().getIs_pay_open().equals("1")) {
|
||||
allData.add(bindType.getBank());
|
||||
}
|
||||
if (bindType.getAli_tl().getIs_pay_open().equals("1")) {
|
||||
allData.add(bindType.getAli_tl());
|
||||
}
|
||||
if (bindType.getWx_tl().getIs_pay_open().equals("1")) {
|
||||
allData.add(bindType.getWx_tl());
|
||||
}
|
||||
|
||||
bindTypeAdapter.setNewData(allData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.util.SparseArray;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.RevenueConacts;
|
||||
import com.example.modulevocal.databinding.ActivityRevenueBinding;
|
||||
import com.example.modulevocal.fragment.RevenueFragment;
|
||||
import com.example.modulevocal.presenter.RevenuePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.MyBagBean;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 金币收支、钻石收支,根据传递的type不同,显示不同的数据,type=1:金币收支,type=2:钻石收支
|
||||
*/
|
||||
public class RevenueActivity extends BaseMvpActivity<RevenuePresenter, ActivityRevenueBinding> implements RevenueConacts.View{
|
||||
private List<MyBagBean> list;
|
||||
private int type;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
type= Integer.parseInt(Objects.requireNonNull(getIntent().getStringExtra("type")));
|
||||
list=new ArrayList<>();
|
||||
if (type==1) {
|
||||
mBinding.topBar.setTitle("金币收支");
|
||||
list.add(new MyBagBean("金币收入", "1"));
|
||||
list.add(new MyBagBean("金币支出", "2"));
|
||||
}else {
|
||||
mBinding.topBar.setTitle("钻石收支");
|
||||
list.add(new MyBagBean("钻石收入", "1"));
|
||||
list.add(new MyBagBean("钻石支出", "2"));
|
||||
}
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(), list,type));
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
|
||||
// mBinding.slidingTabLayout.setOnTabSelectListener(new ViewPager.OnPageChangeListener() {
|
||||
// @Override
|
||||
// public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {}
|
||||
//
|
||||
// @Override
|
||||
// public void onPageSelected(int position) {
|
||||
// Fragment fragment = ((MyFragmentPagerAdapter)mBinding.viewPager.getAdapter()).getRegisteredFragment(position);
|
||||
// if (fragment instanceof RevenueFragment) {
|
||||
// ((RevenueFragment) fragment).refreshData(); // 主动刷新数据
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onPageScrollStateChanged(int state) {}
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_revenue;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RevenuePresenter bindPresenter() {
|
||||
return new RevenuePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRevenueData(List<RevenueBean> bean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<MyBagBean> list;
|
||||
private int type;
|
||||
private SparseArray<Fragment> registeredFragments = new SparseArray<>();
|
||||
|
||||
public MyFragmentPagerAdapter(FragmentManager fm, List<MyBagBean> list,int type) {
|
||||
super(fm);
|
||||
this.list = list;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
// String type = model.getMyBagType();
|
||||
Fragment fragment;
|
||||
|
||||
if (model.getMyBagTitle().contains("收入")) {
|
||||
fragment = RevenueFragment.newInstance(type+"", "1");
|
||||
} else {
|
||||
fragment = RevenueFragment.newInstance(type+"", "2");
|
||||
}
|
||||
|
||||
registeredFragments.put(position, fragment);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
Fragment fragment = (Fragment) super.instantiateItem(container, position);
|
||||
registeredFragments.put(position, fragment);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
registeredFragments.remove(position);
|
||||
super.destroyItem(container, position, object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return list.get(position).getMyBagTitle();
|
||||
}
|
||||
|
||||
public Fragment getRegisteredFragment(int position) {
|
||||
return registeredFragments.get(position);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.RoomAllowanceContacts;
|
||||
import com.example.modulevocal.databinding.ActivityRoomAllowanceBinding;
|
||||
import com.example.modulevocal.presenter.RoomAllowancePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CustomTopBar;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/8
|
||||
*@description: 房间补贴
|
||||
*/
|
||||
@Slf4j
|
||||
@Route(path = ARouteConstants.ROOM_ALLOWANCE, name = "补贴明细")
|
||||
public class RoomAllowanceActivity extends BaseMvpActivity<RoomAllowancePresenter, ActivityRoomAllowanceBinding> implements RoomAllowanceContacts.DeatilsView {
|
||||
public String roomId;
|
||||
|
||||
@Override
|
||||
protected RoomAllowancePresenter bindPresenter() {
|
||||
return new RoomAllowancePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getCharmList(roomId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_room_allowance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
initListener();
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
mBinding.topBar.addIntentListener(new CustomTopBar.OnCallBackRightIcon() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
// ARouter.getInstance().build(ARouteConstants.MY_ROOM_LIST).withString("from", "我的房间").navigation();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.topBar.addIntentListener2(new CustomTopBar.OnCallBackRightIcon2() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE_DETAIL).withString("from", "我的房间").withString("roomId",roomId).navigation();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.topBar.setRightText("历史记录");
|
||||
mBinding.topBar.setRightColor(Color.parseColor("#FF8ACC"));
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightSize(12);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void setList(RoomSubsidy list) {
|
||||
mBinding.tvLast.setText("累计流水:"+list.getLastweek().getTotal_transaction());
|
||||
mBinding.tvGrant2.setText("获得补贴:"+list.getThisweek().getSubsidy_amount());
|
||||
mBinding.tvThis.setText("本周流水:"+list.getThisweek().getTotal_transaction());
|
||||
mBinding.tvGrant3.setText("获得补贴:"+list.getThisweek().getSubsidy_amount());
|
||||
if (list.getLastweek().getStatus() == 1){
|
||||
mBinding.tvGrant.setText("已发放");
|
||||
mBinding.tvGrant.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
// mBinding.tvLast.setTextColor(getResources().getColor(R.color.color_FF999999));
|
||||
}else {
|
||||
mBinding.tvGrant.setText("未发放");
|
||||
mBinding.tvGrant.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_45d08c));
|
||||
}
|
||||
if (list.getThisweek().getStatus() == 1){
|
||||
mBinding.tvWeekGrant.setText("已发放");
|
||||
mBinding.tvWeekGrant.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
}else {
|
||||
mBinding.tvWeekGrant.setText("未发放");
|
||||
mBinding.tvWeekGrant.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_45d08c));
|
||||
}
|
||||
if (list.getExplain() != null&& !list.getExplain().equals("")){
|
||||
// mBinding.ivBg.loadUrl(BuildConfig.BASE_URL+list.getExplain());
|
||||
}else {
|
||||
mBinding.ivBg.setVisibility(GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHishoryList(List<RoomSubsidyDetails> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.RoomAllowanceDetailAdapter;
|
||||
import com.example.modulevocal.conacts.RoomAllowanceContacts;
|
||||
import com.example.modulevocal.databinding.ActivityRoomAllowanceDetailBinding;
|
||||
import com.example.modulevocal.presenter.RoomAllowancePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CustomTopBar;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/15
|
||||
*@description: 历史记录
|
||||
*/
|
||||
@Route(path = ARouteConstants.ROOM_ALLOWANCE_DETAIL,name = "历史补贴详情")
|
||||
public class RoomAllowanceDetailActivity extends BaseMvpActivity<RoomAllowancePresenter, ActivityRoomAllowanceDetailBinding> implements RoomAllowanceContacts.DeatilsView {
|
||||
public String roomId;
|
||||
private int currentPage = 1;
|
||||
private RoomAllowanceDetailAdapter adapter;
|
||||
@Override
|
||||
protected RoomAllowancePresenter bindPresenter() {
|
||||
return new RoomAllowancePresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getDetails(roomId,"1");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_room_allowance_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
initListener();
|
||||
adapter = new RoomAllowanceDetailAdapter();
|
||||
adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||
mBinding.recycleView.setAdapter(adapter);
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this));
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
currentPage++;
|
||||
MvpPre.getDetails(roomId, currentPage + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
currentPage = 1;
|
||||
MvpPre.getDetails(roomId, currentPage + "");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
mBinding.topBar.addIntentListener(new CustomTopBar.OnCallBackRightIcon() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
// ARouter.getInstance().build(ARouteConstants.MY_ROOM_LIST).withString("from", "我的房间").navigation();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void setList(RoomSubsidy list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHishoryList(List<RoomSubsidyDetails> list) {
|
||||
adapter.setNewData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.RoomDetailsAdapter;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.ActivityRoomDetailsBinding;
|
||||
import com.example.modulevocal.presenter.RoomDetailsPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.RoomDetails;
|
||||
import com.xscm.moduleutil.bean.details.BaseMultiItemEntity;
|
||||
import com.xscm.moduleutil.bean.details.RoomDeatailList;
|
||||
import com.xscm.moduleutil.bean.details.RoomDeatil;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CustomTopBar;
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/15
|
||||
* @description:房间明细
|
||||
*/
|
||||
@Route(path = ARouteConstants.MY_ROOM_DETAILS)
|
||||
public class RoomDetailsActivity extends BaseMvpActivity<RoomDetailsPresenter, ActivityRoomDetailsBinding> implements MyRoomListContacts.DeatilsView {
|
||||
@Autowired
|
||||
public String roomId;
|
||||
private BaseQuickAdapter<RoomDetails.RoomDetailsList.RoomDetail, BaseViewHolder> mAdapter;
|
||||
private int currentPage = 1;
|
||||
private RoomDetailsAdapter adapter;
|
||||
private String stime = "";
|
||||
private String etime = "";
|
||||
Set<String> loadedUserIds = new HashSet<>();
|
||||
Set<String> loadedUserIds2 = new HashSet<>();
|
||||
public int type;
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getCharmList(roomId, "", "", "1", type);
|
||||
mBinding.rl3.setOnClickListener(v -> {
|
||||
DoubleTimePickerBottomSheet dialog = new DoubleTimePickerBottomSheet();
|
||||
dialog.setOnTimeRangeSelectedListener((startDate, endDate) -> {
|
||||
// 处理选择的时间范围
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:mm", Locale.getDefault());
|
||||
Log.d("SelectedTime", "开始时间:" + sdf.format(startDate));
|
||||
// mBinding.tv2.setText(sdf.format(startDate));
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate));
|
||||
// mBinding.tv22.setText(sdf.format(endDate));
|
||||
|
||||
stime = sdf.format(startDate);
|
||||
etime = sdf.format(endDate);
|
||||
|
||||
MvpPre.getCharmList(roomId, stime, etime, currentPage + "", type);
|
||||
});
|
||||
dialog.show(getSupportFragmentManager(), "DoubleTimePicker");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_room_details;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RoomDetailsPresenter bindPresenter() {
|
||||
return new RoomDetailsPresenter((MyRoomListContacts.DeatilsView) this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
initListener();
|
||||
adapter = new RoomDetailsAdapter(null);
|
||||
adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
|
||||
mBinding.rv.setAdapter(adapter);
|
||||
mBinding.rv.setLayoutManager(new LinearLayoutManager(this));
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
currentPage++;
|
||||
MvpPre.getCharmList(roomId, stime, etime, currentPage + "", type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
currentPage = 1;
|
||||
MvpPre.getCharmList(roomId, stime, etime, currentPage + "", type);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initListener() {
|
||||
mBinding.topBar.addIntentListener(new CustomTopBar.OnCallBackRightIcon() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
// ARouter.getInstance().build(ARouteConstants.MY_ROOM_LIST).withString("from", "我的房间").navigation();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.topBar.addIntentListener2(new CustomTopBar.OnCallBackRightIcon2() {
|
||||
@Override
|
||||
public void onIntent() {
|
||||
// ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的房间").withString("roomId", roomId).navigation();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
// mBinding.topBar.setRightText("补贴明细");
|
||||
// mBinding.topBar.setRightColor(Color.parseColor("#FF8ACC"));
|
||||
// mBinding.topBar.setRightTxtVisible(true);
|
||||
// mBinding.topBar.setRightSize(12);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setList(RoomDetails list) {
|
||||
|
||||
mBinding.tv3.setText(list.getTotal_earning() + "");
|
||||
mBinding.tv5.setText(list.getTotal_amount() + "");
|
||||
if (list.getList() != null && !list.getList().isEmpty()) { // size() > 0 是多余的,因为 isEmpty() 已经检查了是否为空
|
||||
List<BaseMultiItemEntity> newData = new ArrayList<>();
|
||||
for (int i = 0; i < list.getList().size(); i++) {
|
||||
RoomDeatailList r = new RoomDeatailList();
|
||||
r.setTotal_price(list.getList().get(i).getTotal_price());
|
||||
r.setTotal_earning(list.getList().get(i).getTotal_earning());
|
||||
r.setTime(list.getList().get(i).getTime());
|
||||
r.setSticky(true);
|
||||
if (currentPage==1){
|
||||
loadedUserIds.clear();
|
||||
}
|
||||
// 确保不重复添加
|
||||
if (!loadedUserIds.contains(r.getTime())) {
|
||||
newData.add(r);
|
||||
loadedUserIds.add(r.getTime());
|
||||
}
|
||||
|
||||
List<RoomDeatil> roomDeatils = new ArrayList<>();
|
||||
for (int j = 0; j < list.getList().get(i).getList().size(); j++) {
|
||||
RoomDeatil d = new RoomDeatil();
|
||||
d.setSender_avatar(list.getList().get(i).getList().get(j).getSender_avatar());
|
||||
d.setSender_nickname(list.getList().get(i).getList().get(j).getSender_nickname());
|
||||
d.setReceive_nickname(list.getList().get(i).getList().get(j).getReceive_nickname());
|
||||
d.setGift_name(list.getList().get(i).getList().get(j).getGift_name());
|
||||
d.setNumber(list.getList().get(i).getList().get(j).getNumber());
|
||||
d.setTotal_price(list.getList().get(i).getList().get(j).getTotal_price());
|
||||
d.setTime(list.getList().get(i).getList().get(j).getTime());
|
||||
d.setEarning(list.getList().get(i).getList().get(j).getEarning());
|
||||
r.setSticky(false);
|
||||
roomDeatils.add(d);
|
||||
}
|
||||
|
||||
// 将 roomDeatils 中的所有 RoomDeatil 对象添加到 newData 中
|
||||
newData.addAll(roomDeatils);
|
||||
}
|
||||
|
||||
if (currentPage == 1) {
|
||||
adapter.setNewData(newData);
|
||||
} else {
|
||||
adapter.addData(newData);
|
||||
}
|
||||
|
||||
// 通知适配器数据已改变
|
||||
adapter.notifyDataSetChanged();
|
||||
// 重新布局
|
||||
mBinding.rv.requestLayout();
|
||||
|
||||
} else {
|
||||
if (currentPage == 1) {
|
||||
adapter.setNewData(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.FileUtils;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.SettingConacts;
|
||||
import com.example.modulevocal.databinding.ActivitySettingBinding;
|
||||
import com.example.modulevocal.presenter.SettingPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.dialog.RealNameDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.config.ConfigManager;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentEnum;
|
||||
import com.xscm.moduleutil.utils.config.EnvironmentPrefs;
|
||||
import com.xscm.moduleutil.widget.CommonAppConfig;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/8/14
|
||||
*@description: 设置
|
||||
*/
|
||||
public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivitySettingBinding> implements SettingConacts.View {
|
||||
|
||||
|
||||
protected void initData() {
|
||||
mBinding.tvBbh.setText(CommonAppConfig.getInstance().getVersion());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SettingPresenter bindPresenter() {
|
||||
return new SettingPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.topBar.setTitle("设置");
|
||||
mBinding.tvCache.setHint(FileUtils.getSize(getCacheDir()));
|
||||
mBinding.llYouth.setOnClickListener(this::onClick);
|
||||
mBinding.llNotification.setOnClickListener(this::onClick);
|
||||
mBinding.swit.setOnClickListener(this::onClick);
|
||||
mBinding.llHmd.setOnClickListener(this::onClick);
|
||||
mBinding.llSzmm.setOnClickListener(this::onClick);
|
||||
mBinding.llShb.setOnClickListener(this::onClick);
|
||||
mBinding.llSmrz.setOnClickListener(this::onClick);
|
||||
mBinding.llQhch.setOnClickListener(this::onClick);
|
||||
mBinding.llTcdl.setOnClickListener(this::onClick);
|
||||
mBinding.llZhxiao.setOnClickListener(this::onClick);
|
||||
mBinding.llGywm.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.ll_youth) {
|
||||
startActivity(new Intent(this, UnderageActivity.class));
|
||||
} else if (view.getId() == R.id.ll_notification) {
|
||||
startActivity(new Intent(this, NotificationActivity.class));
|
||||
} else if (view.getId() == R.id.ll_hmd) {
|
||||
Intent intent = new Intent(this, BlacklistActivity.class);
|
||||
intent.putExtra("type", 1);
|
||||
startActivity(intent);
|
||||
} else if (view.getId() == R.id.ll_szmm) {//设置密码
|
||||
startActivity(new Intent(this, ChangPassActivity.class));
|
||||
} else if (view.getId() == R.id.ll_shb) {
|
||||
startActivity(new Intent(this, PhoneReplacementActivity.class));
|
||||
} else if (view.getId() == R.id.ll_smrz) {//实名认证
|
||||
if (SpUtil.getRealName()) {
|
||||
startActivity(new Intent(this, RealDetailActivity.class));
|
||||
} else {
|
||||
RealNameDialog realNameDialog = new RealNameDialog(this);
|
||||
realNameDialog.show();
|
||||
realNameDialog.setOnDismissListener(dialog -> {
|
||||
dialog.dismiss();
|
||||
ARouter.getInstance().build(ARouteConstants.REAL_NAME_ACTIVITY2).navigation();
|
||||
// startActivity(new Intent(SettingActivity.this, RealName1Activity.class));
|
||||
});
|
||||
}
|
||||
} else if (view.getId() == R.id.ll_qhch) {
|
||||
new AlertDialog.Builder(this).setMessage("确认清理缓存?").setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
ToastUtils.showShort("开始清理...");
|
||||
FileUtils.deleteAllInDir(getCacheDir());
|
||||
FileUtils.deleteAllInDir(getExternalCacheDir());
|
||||
ToastUtils.showShort("缓存清理成功!");
|
||||
mBinding.tvCache.setHint(FileUtils.getSize(getCacheDir()));
|
||||
}
|
||||
}).setNegativeButton("取消", null).create().show();
|
||||
} else if (view.getId() == R.id.swit) {
|
||||
if (mBinding.swit.isChecked()) {
|
||||
ConfigManager.getInstance().switchEnvironment(EnvironmentEnum.PRODUCTION);
|
||||
EnvironmentEnum selectedEnv = EnvironmentEnum.PRODUCTION;
|
||||
EnvironmentPrefs prefs = new EnvironmentPrefs(this);
|
||||
prefs.setSelectedEnvironment(selectedEnv);
|
||||
} else {
|
||||
ConfigManager.getInstance().switchEnvironment(EnvironmentEnum.TEST);
|
||||
EnvironmentEnum selectedEnv = EnvironmentEnum.TEST;
|
||||
EnvironmentPrefs prefs = new EnvironmentPrefs(this);
|
||||
prefs.setSelectedEnvironment(selectedEnv);
|
||||
}
|
||||
} else if (view.getId() == R.id.ll_tcdl) {
|
||||
new AlertDialog.Builder(this).setMessage("确定要退出登录吗?")
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (MvpPre == null){
|
||||
MvpPre = bindPresenter();
|
||||
}
|
||||
MvpPre.clearLoginInfo();
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null).create().show();
|
||||
}else if (view.getId() == R.id.ll_zhxiao){
|
||||
new AlertDialog.Builder(this).setMessage("确定要注销账号吗?")
|
||||
.setMessage("注销后您当前的账户金币及钻石将无法找回,\n 30天内本账号将无法登陆,请谨慎操作!")
|
||||
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (MvpPre==null){
|
||||
MvpPre=bindPresenter();
|
||||
}
|
||||
MvpPre.cancel();
|
||||
}
|
||||
})
|
||||
.setNegativeButton("取消", null).create().show();
|
||||
}else if (view.getId() == R.id.ll_gywm){
|
||||
// Intent intent = new Intent(this, WebViewActivity.class);
|
||||
// intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/other/aboutUs?id=" + SpUtil.getToken());
|
||||
// startActivity(intent);
|
||||
|
||||
startActivity(new Intent(this, AboutUsActivity.class));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_setting;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clearLoginInfo(String s) {
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String s) {
|
||||
try {
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ActivityUnderageBinding;
|
||||
import com.example.modulevocal.presenter.UnderagePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
|
||||
public class UnderageActivity extends BaseMvpActivity<UnderagePresenter, ActivityUnderageBinding> {
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
mBinding.topBar.setTitle("未成年人模式");
|
||||
mBinding.text.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_underage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UnderagePresenter bindPresenter() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.example.moduletablayout.listener.CustomTabEntity;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.UserHomepageConacts;
|
||||
import com.example.modulevocal.databinding.ActivityUserHomepageBinding;
|
||||
import com.example.modulevocal.fragment.UserHomepageFragment;
|
||||
import com.example.modulevocal.presenter.UserHomepagePresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.XBannerData;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/4
|
||||
*@description: 用户主页
|
||||
*/
|
||||
@Route(path = ARouteConstants.USER_HOME_PAGE)
|
||||
public class UserHomepageActivity extends BaseMvpActivity<UserHomepagePresenter, ActivityUserHomepageBinding> implements UserHomepageConacts.View{
|
||||
@Autowired
|
||||
String userId;
|
||||
|
||||
@Autowired
|
||||
int type;//判断是从哪里进行的跳转
|
||||
|
||||
public String from;
|
||||
private ArrayList<CustomTabEntity> titles = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// userId=getIntent().getStringExtra("userId");
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getUserDetails(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_user_homepage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UserHomepagePresenter bindPresenter() {
|
||||
return new UserHomepagePresenter(this, this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserDetails(UserInfo data) {
|
||||
if (data.getUser_id()==SpUtil.getUserId()) {
|
||||
SpUtil.saveUserInfo(data);
|
||||
}
|
||||
List<String> homeBgimages = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(data.getHome_bgimages())){
|
||||
homeBgimages = Arrays.asList(data.getHome_bgimages().split(","));
|
||||
}else {
|
||||
homeBgimages.add(data.getAvatar());
|
||||
}
|
||||
List<XBannerData> xBannerData1 = new ArrayList<>();
|
||||
for (int i=0;i<homeBgimages.size();i++) {
|
||||
xBannerData1.add(new XBannerData(0, homeBgimages.get(i), ""));
|
||||
}
|
||||
mBinding.xbanner.setBannerData(com.xscm.moduleutil.R.layout.me_xbanner, xBannerData1);
|
||||
|
||||
mBinding.xbanner.loadImage((banner, model, view, position) -> {
|
||||
XBannerData xBannerData = (XBannerData) model;
|
||||
ImageView ivStart = view.findViewById(com.xscm.moduleutil.R.id.iv_voice_start);
|
||||
ImageView imageView = view.findViewById(R.id.iv_img);
|
||||
if (xBannerData.getType() == 1) {
|
||||
ivStart.setVisibility(View.VISIBLE);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
ImageLoader.loadImage(this, imageView, xBannerData.getVedioCover());
|
||||
} else {
|
||||
ivStart.setVisibility(View.GONE);
|
||||
ImageUtils.loadHeadCC(xBannerData.getUrl(), imageView);
|
||||
}
|
||||
});
|
||||
List<Fragment> fragments = new ArrayList<>();
|
||||
fragments.add(UserHomepageFragment.newInstance(data,type));
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(fragments, getSupportFragmentManager()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userGuanzSuccess(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.CountDownTimer;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.DigitsKeyListener;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.adapter.PayMethodAdapter;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityWithdrawalBinding;
|
||||
import com.example.modulevocal.presenter.WithdrawalPresenter;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/21
|
||||
* @description: 提现
|
||||
*/
|
||||
|
||||
@Route(path = ARouteConstants.WITHDRAWAL_ACTIVITY)
|
||||
public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, ActivityWithdrawalBinding> implements WithdrawalConacts.View {
|
||||
WalletBean walletBean;
|
||||
private PayMethodAdapter bindTypeAdapter;
|
||||
private BindType.AllData selectedItem;
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("提现");
|
||||
mBinding.topBar.setRightTxtVisible(true);
|
||||
mBinding.topBar.setRightText("提现记录");
|
||||
mBinding.topBar.setRightColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
mBinding.topBar.getTvRight().setOnClickListener(v -> {
|
||||
startActivity(new Intent(this, WithdrawalListActivity.class));
|
||||
});
|
||||
|
||||
mBinding.t5.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
mBinding.recycleView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
|
||||
bindTypeAdapter = new PayMethodAdapter(com.xscm.moduleutil.R.layout.item_bind_type);
|
||||
mBinding.recycleView.setAdapter(bindTypeAdapter);
|
||||
|
||||
bindTypeAdapter.setOnItemClickListener((adapter, view, position) -> {
|
||||
// 更新选中项
|
||||
bindTypeAdapter.setSelectedPosition(position);
|
||||
|
||||
// 获取当前选中的数据
|
||||
selectedItem = bindTypeAdapter.getItem(position);
|
||||
// 可以在这里处理选中逻辑,比如保存到变量或触发支付
|
||||
|
||||
});
|
||||
|
||||
mBinding.tvPayment.setOnClickListener(v -> {
|
||||
if (!mBinding.cbPrivacy.isChecked()) {
|
||||
ToastUtils.show("请先阅读就业协议并同意协议");
|
||||
return;
|
||||
}
|
||||
if (mBinding.etCustomAmount.getText().toString().isEmpty()) {
|
||||
ToastUtils.show("请输入提现金额");
|
||||
return;
|
||||
}
|
||||
if (selectedItem == null) {
|
||||
ToastUtils.show("请选择提现方式");
|
||||
return;
|
||||
}
|
||||
showSecondaryVerificationDialog();
|
||||
});
|
||||
|
||||
mBinding.t5.setOnClickListener(v -> {
|
||||
String earnings = truncateToFirstDecimalPlace(walletBean.getEarnings());
|
||||
mBinding.etCustomAmount.setText(earnings);
|
||||
});
|
||||
|
||||
mBinding.tvLhjy.setOnClickListener(v -> {
|
||||
ARouter.getInstance().build(ARouteConstants.H5).withString("url",walletBean.getUrl()).withString("title", walletBean.getTitle()).navigation();
|
||||
|
||||
});
|
||||
|
||||
TextInputEditText etCustomAmount = mBinding.etCustomAmount;
|
||||
|
||||
// 限制只能输入数字和小数点后一位
|
||||
etCustomAmount.setKeyListener(DigitsKeyListener.getInstance("0123456789."));
|
||||
etCustomAmount.setFilters(new InputFilter[]{(source, start, end, dest, dstart, dend) -> {
|
||||
// 防止输入负号
|
||||
if (source.toString().contains("-")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String newText = dest.toString().substring(0, dstart) + source.toString() + dest.toString().substring(dend);
|
||||
|
||||
// 检查小数点
|
||||
if (newText.contains(".")) {
|
||||
String[] splitResult = newText.split("\\.");
|
||||
if (splitResult.length > 1 && splitResult[1].length() > 1) {
|
||||
// 小数点后只能有一位
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
// 可选:限制最大长度
|
||||
if (newText.length() > 10) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return null;
|
||||
}});
|
||||
|
||||
// 可选:添加 TextWatcher 来监听输入内容变化
|
||||
etCustomAmount.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// 如果以小数点开头,自动补 0
|
||||
if (s.toString().startsWith(".")) {
|
||||
s.insert(0, "0");
|
||||
}
|
||||
// 如果以多个 0 开头,只保留一个
|
||||
if (s.toString().startsWith("0") && s.toString().length() > 1 && s.toString().charAt(1) != '.') {
|
||||
s.delete(0, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvPayment, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvPayment.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
private String truncateToFirstDecimalPlace(String value) {
|
||||
if (TextUtils.isEmpty(value)) return "0.0";
|
||||
|
||||
int dotIndex = value.indexOf('.');
|
||||
if (dotIndex == -1) {
|
||||
return value + ".0"; // 没有小数点,默认加 .0
|
||||
}
|
||||
|
||||
String integerPart = value.substring(0, dotIndex);
|
||||
String decimalPart = value.substring(dotIndex + 1);
|
||||
|
||||
if (decimalPart.length() >= 1) {
|
||||
return integerPart + "." + decimalPart.charAt(0); // 只取小数点后一位
|
||||
} else {
|
||||
return integerPart + ".0"; // 小数点后为空,默认加 0
|
||||
}
|
||||
}
|
||||
|
||||
private void showSecondaryVerificationDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
View dialogView = getLayoutInflater().inflate(R.layout.dialog_secondary_verification, null);
|
||||
builder.setView(dialogView);
|
||||
|
||||
final EditText etVerificationCode = dialogView.findViewById(R.id.ed_password);
|
||||
final ImageView tvGetCode = dialogView.findViewById(R.id.tv_get_code);
|
||||
final TextView tvCancel = dialogView.findViewById(R.id.tv_send_code);
|
||||
|
||||
final AlertDialog dialog = builder.create();
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
|
||||
tvCancel.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
MvpPre.sendCode(SpUtil.getUserBean().getMobile(), 6);
|
||||
ToastUtils.show("验证码已发送");
|
||||
tvCancel.setEnabled(false);
|
||||
startCountDown(tvCancel);
|
||||
}
|
||||
});
|
||||
|
||||
tvGetCode.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// 模拟发送验证码逻辑
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
// // 验证码输入完成时的处理
|
||||
// etVerificationCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
// @Override
|
||||
// public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
// String code = etVerificationCode.getText().toString().trim();
|
||||
// if (!TextUtils.isEmpty(code)) {
|
||||
// // 验证码验证逻辑
|
||||
// MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
// dialog.dismiss();
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// });
|
||||
|
||||
etVerificationCode.addTextChangedListener(new TextWatcher() {
|
||||
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
if (s.length() == 4) {
|
||||
String code = etVerificationCode.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(code)) {
|
||||
// 验证码验证逻辑
|
||||
MvpPre.withdrawal(mBinding.etCustomAmount.getText().toString(), selectedItem.getType(), code);
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void startCountDown(final TextView tvGetCode) {
|
||||
final int[] count = {60};
|
||||
tvGetCode.setText("重新发送(" + count[0] + ")");
|
||||
new CountDownTimer(60000, 1000) {
|
||||
public void onTick(long millisUntilFinished) {
|
||||
tvGetCode.setText("重新发送(" + (count[0]--) + ")");
|
||||
}
|
||||
|
||||
public void onFinish() {
|
||||
tvGetCode.setText("获取验证码");
|
||||
tvGetCode.setEnabled(true);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.wallet();
|
||||
MvpPre.bindType(SpUtil.getUserId() + "");
|
||||
MvpPre.getWalletConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_withdrawal;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WithdrawalPresenter bindPresenter() {
|
||||
return new WithdrawalPresenter(this, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
this.walletBean = walletBean;
|
||||
mBinding.tvJb.setText(walletBean.getEarnings());
|
||||
if (walletBean.getTitle() != null) {
|
||||
mBinding.tvLhjy.setText(walletBean.getTitle());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
List<BindType.AllData> allData = new ArrayList<>();
|
||||
if (bindType.getAli().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli());
|
||||
}
|
||||
if (bindType.getWx().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx());
|
||||
}
|
||||
if (bindType.getBank().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getBank());
|
||||
}
|
||||
if (bindType.getAli_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getAli_tl());
|
||||
}
|
||||
if (bindType.getWx_tl().getIs_with_draw_open().equals("1")) {
|
||||
allData.add(bindType.getWx_tl());
|
||||
}
|
||||
|
||||
bindTypeAdapter.setNewData(allData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWalletConfig(WalletConfig walletConfig) {
|
||||
mBinding.t3.setText("提现扣除服务费:" + walletConfig.getWithdrawal_service_fee() + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawal(String S) {
|
||||
ToastUtils.show(S);
|
||||
MvpPre.wallet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawalList(List<WithdrawalBean> list) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.example.modulevocal.activity;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.WithdrawalAdapter;
|
||||
import com.example.modulevocal.conacts.WithdrawalConacts;
|
||||
import com.example.modulevocal.databinding.ActivityWithdrawalListBinding;
|
||||
import com.example.modulevocal.presenter.WithdrawalPresenter;
|
||||
import com.xscm.moduleutil.activity.BaseMvpActivity;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 提现记录
|
||||
*/
|
||||
public class WithdrawalListActivity extends BaseMvpActivity<WithdrawalPresenter, ActivityWithdrawalListBinding> implements WithdrawalConacts.View{
|
||||
|
||||
private WithdrawalAdapter adapter;
|
||||
@Override
|
||||
protected void initData() {
|
||||
mBinding.topBar.setTitle("提现记录");
|
||||
MvpPre.withdrawalList("1","50","","");
|
||||
mBinding.rl3.setOnClickListener(v -> {
|
||||
DoubleTimePickerBottomSheet dialog = new DoubleTimePickerBottomSheet();
|
||||
dialog.setOnTimeRangeSelectedListener((startDate, endDate) -> {
|
||||
// 处理选择的时间范围
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:mm", Locale.getDefault());
|
||||
Log.d("SelectedTime", "开始时间:" + sdf.format(startDate));
|
||||
mBinding.tv2.setText(sdf.format(startDate));
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate));
|
||||
mBinding.tv22.setText(sdf.format(endDate));
|
||||
MvpPre.withdrawalList("1","50",mBinding.tv2.getText().toString(),mBinding.tv22.getText().toString());
|
||||
});
|
||||
dialog.show(getSupportFragmentManager(), "DoubleTimePicker");
|
||||
});
|
||||
|
||||
mBinding.revenueView.setLayoutManager(new LinearLayoutManager(this));
|
||||
adapter = new WithdrawalAdapter();
|
||||
mBinding.revenueView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_withdrawal_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WithdrawalPresenter bindPresenter() {
|
||||
return new WithdrawalPresenter(this,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wallet(WalletBean walletBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindType(BindType bindType) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWalletConfig(WalletConfig walletConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bind() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawal(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void withdrawalList(List<WithdrawalBean> list) {
|
||||
adapter.setNewData(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.img.FullScreenUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlbumPhotoAdapter extends BaseMultiItemQuickAdapter<AlbumBean.ImageList, BaseViewHolder> {
|
||||
private boolean isControlVisible = false;
|
||||
private List<Integer> selectedPositions = new ArrayList<>(); // 保存选中的 position
|
||||
|
||||
// private SparseBooleanArray selectedPositions = new SparseBooleanArray();
|
||||
public AlbumPhotoAdapter(List<AlbumBean.ImageList> data) {
|
||||
super(data);
|
||||
addItemType(1, R.layout.item_group);
|
||||
addItemType(2, R.layout.item_photo);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void showControl() {
|
||||
isControlVisible = true;
|
||||
notifyDataSetChanged(); // 刷新列表以更新 UI
|
||||
}
|
||||
|
||||
public void hideControl() {
|
||||
isControlVisible = false;
|
||||
notifyDataSetChanged(); // 刷新列表以更新 UI
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, AlbumBean.ImageList item) {
|
||||
|
||||
if (item.getItemType() == 1) {
|
||||
helper.setText(R.id.tv_date, item.getCreatetime());
|
||||
} else {
|
||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.iv_photo));
|
||||
helper.setVisible(R.id.tb_photo, isControlVisible);
|
||||
helper.setVisible(R.id.v_checkbox, isControlVisible);
|
||||
|
||||
View vCheckbox = helper.getView(R.id.v_checkbox);
|
||||
|
||||
vCheckbox.setSelected(item.isSelected());
|
||||
|
||||
vCheckbox.setOnClickListener(v -> {
|
||||
boolean isSelected = !item.isSelected(); // 切换当前状态
|
||||
item.setSelected(isSelected);
|
||||
vCheckbox.setSelected(isSelected);
|
||||
// notifyItemChanged(helper.getBindingAdapterPosition()); // 刷新整个列表确保状态正确
|
||||
});
|
||||
helper.getView(R.id.tb_photo).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean isSelected = !item.isSelected();
|
||||
item.setSelected(isSelected);
|
||||
vCheckbox.setSelected(isSelected);
|
||||
// notifyItemChanged(helper.getBindingAdapterPosition()); // 刷新整个列表确保状态正确
|
||||
}
|
||||
});
|
||||
|
||||
helper.getView(R.id.iv_photo).setOnClickListener(v -> {
|
||||
FullScreenUtil.showFullScreenDialog(mContext,helper.getPosition(),getImageList() );
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<String> getImageList(){
|
||||
List<String> stringList=new ArrayList<>();
|
||||
for (AlbumBean.ImageList item : getData()) {
|
||||
if (item.getItemType() == 2) {
|
||||
stringList.add(item.getImage());
|
||||
}
|
||||
}
|
||||
return stringList;
|
||||
}
|
||||
|
||||
public List<AlbumBean.ImageList> getSelectedItems() {
|
||||
List<AlbumBean.ImageList> selectedItems = new ArrayList<>();
|
||||
for (AlbumBean.ImageList item : getData()) {
|
||||
if (item.isSelected()) {
|
||||
selectedItems.add(item);
|
||||
}
|
||||
}
|
||||
return selectedItems;
|
||||
}
|
||||
|
||||
public String getSelectedPhotoIdsAsString() {
|
||||
List<AlbumBean.ImageList> selectedPhotos = getSelectedItems();
|
||||
List<String> idList = new ArrayList<>();
|
||||
|
||||
for (AlbumBean.ImageList photo : selectedPhotos) {
|
||||
idList.add(photo.getId()); // 将每个 id 添加进 list
|
||||
}
|
||||
|
||||
return TextUtils.join(",", idList); // 使用逗号拼接
|
||||
}
|
||||
|
||||
|
||||
public void clearSelections() {
|
||||
for (AlbumBean.ImageList item : getData()) {
|
||||
item.setSelected(false);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewRecycled(@NonNull BaseViewHolder holder) {
|
||||
super.onViewRecycled(holder);
|
||||
View vCheckbox = holder.getView(R.id.v_checkbox);
|
||||
if (vCheckbox instanceof CheckBox) {
|
||||
((CheckBox) vCheckbox).setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
|
||||
public class BindCardAdapter extends BaseQuickAdapter<BindType.AllData, BaseViewHolder> {
|
||||
|
||||
private int selectedPosition = -1; // -1 表示未选中
|
||||
|
||||
public BindCardAdapter(int layoutResId) {
|
||||
super(layoutResId);
|
||||
}
|
||||
|
||||
public void setSelectedPosition(int position) {
|
||||
selectedPosition = position;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public int getSelectedPosition() {
|
||||
return selectedPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, BindType.AllData item) {
|
||||
helper.setText(R.id.tv_name, item.getName());
|
||||
if (item.getIs_bind().equals("1")){
|
||||
helper.setText(R.id.tv_status, "已绑定").setTextColor(R.id.tv_status, getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_e2e2e2));
|
||||
}else {
|
||||
helper.setText(R.id.tv_status, "未绑定").setTextColor(R.id.tv_status, getContext().getResources().getColor(com.xscm.moduleutil.R.color.colorPrimary));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.BlackUserBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.MeHeadView;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/19
|
||||
*@description: 黑名单、关注、粉丝列表适配器
|
||||
*/
|
||||
public class BlackAdapter extends BaseQuickAdapter<BlackUserBean, BaseViewHolder> {
|
||||
|
||||
// 定义接口用于回调点击事件
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(BlackUserBean item);
|
||||
}
|
||||
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
|
||||
public BlackAdapter() {
|
||||
super(R.layout.item_black);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, BlackUserBean item) {
|
||||
MeHeadView headView = helper.getView(R.id.im_user);
|
||||
headView.setData(item.getAvatar(), "", item.getSex() + "");
|
||||
helper.setText(R.id.tv_nick_name, item.getNickname());
|
||||
TextView imageView= helper.getView(R.id.im_g);
|
||||
helper.setText(R.id.tv_oline, item.getIs_online() == 1 ? "[在线]" : "[离线]");
|
||||
// 根据 type 设置图片资源
|
||||
// 根据 type 和 status 设置图片资源
|
||||
imageView.setVisibility(View.VISIBLE);
|
||||
if (item.getType() == 0) { // 关注
|
||||
if (item.getIs_follow() == 0) {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.gz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
imageView.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
imageView.setText("关注");
|
||||
} else {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yigz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
imageView.setTextColor(Color.BLACK);
|
||||
imageView.setText("已关注");
|
||||
}
|
||||
} else if (item.getType() == 1) { // 黑名单
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yic);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#333333"), 34);
|
||||
imageView.setTextColor(Color.WHITE);
|
||||
imageView.setText("移除");
|
||||
} else if (item.getType() == 2) { // 粉丝
|
||||
if (item.getIs_follow() == 0) {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.hg);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
imageView.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
imageView.setText("回关");
|
||||
} else {
|
||||
// imageView.setImageResource(com.xscm.moduleutil.R.mipmap.yigz);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( imageView, Color.parseColor("#EFF2F8"), 34);
|
||||
imageView.setTextColor(Color.BLACK);
|
||||
imageView.setText("已关注");
|
||||
}
|
||||
}else if (item.getType() == 3){
|
||||
imageView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
imageView.setOnClickListener(v -> {
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(item);
|
||||
}
|
||||
});
|
||||
LinearLayout llContainer =helper.getView(R.id.ll_in);
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
headView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (item.getType() !=1){
|
||||
ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).withString("userId", item.getUser_id()+"").navigation();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChatRoomMyFollowAdapter extends BaseQuickAdapter<MyRoomBean, BaseViewHolder> {
|
||||
|
||||
private int index = -1;
|
||||
|
||||
public ChatRoomMyFollowAdapter() {
|
||||
super(R.layout.room_index_item_chatroom_my_foot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MyRoomBean item) {
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.iv_follow_bg));
|
||||
ImageUtils.loadHeadCC(item.getLabel_icon(), helper.getView(R.id.iv_type));
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
helper.setText(R.id.tv_id, "ID: " + item.getRoom_id());
|
||||
// helper.setText(R.id.tv_num, item.get());
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, helper.getView(R.id.iv_play));
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewData(@Nullable List<MyRoomBean> data) {
|
||||
index = -1;
|
||||
super.setNewData(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
/**
|
||||
* 历史记录
|
||||
*/
|
||||
public class ChatRoomMyFootAdapter extends BaseQuickAdapter<MyFootResp, BaseViewHolder> {
|
||||
|
||||
public ChatRoomMyFootAdapter() {
|
||||
super(R.layout.room_index_item_chatroom_my_foot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MyFootResp item) {
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.iv_follow_bg));
|
||||
// if (TextUtils.isEmpty(item.getLabel_icon())) {
|
||||
// helper.setGone(R.id.iv_room_labe, false);
|
||||
// } else {
|
||||
// helper.setGone(R.id.iv_room_labe, true);
|
||||
// ImageUtils.loadImageView(item.getLabel_icon(), helper.getView(R.id.iv_room_labe));
|
||||
// }
|
||||
if (item.getLabel_id().equals("23")){
|
||||
helper.setImageResource(R.id.iv_type, com.xscm.moduleutil.R.mipmap.diang_c);
|
||||
}else if (item.getLabel_id().equals("108")){
|
||||
helper.setImageResource(R.id.iv_type, com.xscm.moduleutil.R.mipmap.youxi);
|
||||
}else if (item.getLabel_id().equals("101")){
|
||||
helper.setImageResource(R.id.iv_type, com.xscm.moduleutil.R.mipmap.youxi);
|
||||
} else if (item.getLabel_id().equals("120")){//女神
|
||||
helper.setImageResource(R.id.iv_type, com.xscm.moduleutil.R.mipmap.nvshen);
|
||||
}else if (item.getLabel_id().equals("121")){//男神
|
||||
helper.setImageResource(R.id.iv_type, com.xscm.moduleutil.R.mipmap.nans);
|
||||
}
|
||||
// ImageUtils.loadGift(helper.getView(R.id.iv_hot), ImageUtils.ANIM);
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
// helper.setText(R.id.tv_id, "ID: " + item.getRoom_id());
|
||||
helper.setText(R.id.tv_num, item.getPopularity());
|
||||
ImageView iv = helper.getView(R.id.iv_play);
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv);
|
||||
// helper.setVisible(R.id.rl_lock, item.getLocked() == 1);
|
||||
// helper.setGone(R.id.tv_clean, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChatRoomMyManageAdapter extends BaseQuickAdapter<MyRoomBean, BaseViewHolder> {
|
||||
|
||||
private int index = -1;
|
||||
|
||||
public ChatRoomMyManageAdapter() {
|
||||
super(R.layout.room_index_item_chatroom_my_foot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MyRoomBean item) {
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), helper.getView(R.id.iv_follow_bg));
|
||||
ImageUtils.loadHeadCC(item.getLabel_icon(), helper.getView(R.id.iv_type));
|
||||
// ImageUtils.loadGift(helper.getView(R.id.iv_hot), ImageUtils.ANIM);
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
helper.setText(R.id.tv_id, "ID: " + item.getRoom_id());
|
||||
// helper.setText(R.id.tv_num, item.get());
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, helper.getView(R.id.iv_play));
|
||||
// }
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewData(@Nullable List<MyRoomBean> data) {
|
||||
index = -1;
|
||||
super.setNewData(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.GiftBoxRecordBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftBoxAdapter extends RecyclerView.Adapter<GiftBoxAdapter.GiftBoxViewHolder> {
|
||||
|
||||
private static final int TYPE_HEADER = 0;
|
||||
private static final int TYPE_ITEM = 1;
|
||||
|
||||
private List<GiftBoxRecordBean> giftBoxList;
|
||||
|
||||
public GiftBoxAdapter(List<GiftBoxRecordBean> giftBoxList) {
|
||||
this.giftBoxList = giftBoxList;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public GiftBoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view;
|
||||
if (viewType == TYPE_HEADER) {
|
||||
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_box, parent, false);
|
||||
// 设置标题可见
|
||||
view.findViewById(R.id.tv_label_time).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.tv_label_gift_name).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.tv_label_obtain).setVisibility(View.VISIBLE);
|
||||
// 隐藏数据项
|
||||
view.findViewById(R.id.tv_time).setVisibility(View.GONE);
|
||||
view.findViewById(R.id.tv_gift_name).setVisibility(View.GONE);
|
||||
view.findViewById(R.id.tv_obtain).setVisibility(View.GONE);
|
||||
} else {
|
||||
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_box, parent, false);
|
||||
// 设置数据项可见
|
||||
view.findViewById(R.id.tv_time).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.tv_gift_name).setVisibility(View.VISIBLE);
|
||||
view.findViewById(R.id.tv_obtain).setVisibility(View.VISIBLE);
|
||||
// 隐藏标题项
|
||||
view.findViewById(R.id.tv_label_time).setVisibility(View.GONE);
|
||||
view.findViewById(R.id.tv_label_gift_name).setVisibility(View.GONE);
|
||||
view.findViewById(R.id.tv_label_obtain).setVisibility(View.GONE);
|
||||
}
|
||||
return new GiftBoxViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull GiftBoxViewHolder holder, int position) {
|
||||
if (position == 0) {
|
||||
// 设置标题文本
|
||||
holder.tvLabelTime.setText("时间");
|
||||
holder.tvLabelGiftName.setText("礼盒名称");
|
||||
holder.tvLabelObtain.setText("获取");
|
||||
} else {
|
||||
GiftBoxRecordBean giftBox = giftBoxList.get(position - 1);
|
||||
holder.tvTime.setText(giftBox.getCreatetime());
|
||||
holder.tvGiftName.setText(giftBox.getGift_bag_name());
|
||||
holder.tvObtain.setText(giftBox.getGift_name());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftBoxList.size() + 1; // 加上标题项
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position == 0 ? TYPE_HEADER : TYPE_ITEM;
|
||||
}
|
||||
|
||||
static class GiftBoxViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvLabelTime;
|
||||
TextView tvLabelGiftName;
|
||||
TextView tvLabelObtain;
|
||||
TextView tvTime;
|
||||
TextView tvGiftName;
|
||||
TextView tvObtain;
|
||||
|
||||
GiftBoxViewHolder(View view) {
|
||||
super(view);
|
||||
tvLabelTime = view.findViewById(R.id.tv_label_time);
|
||||
tvLabelGiftName = view.findViewById(R.id.tv_label_gift_name);
|
||||
tvLabelObtain = view.findViewById(R.id.tv_label_obtain);
|
||||
tvTime = view.findViewById(R.id.tv_time);
|
||||
tvGiftName = view.findViewById(R.id.tv_gift_name);
|
||||
tvObtain = view.findViewById(R.id.tv_obtain);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class MyAlbumListAdapter extends BaseQuickAdapter<AlbumBean, BaseViewHolder> {
|
||||
private boolean b = false;
|
||||
private int longClickPos = -1;
|
||||
|
||||
public MyAlbumListAdapter() {
|
||||
super(R.layout.item_album_list);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, AlbumBean item) {
|
||||
|
||||
if (!"0".equals(item.getId())) {
|
||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.riv_album));
|
||||
helper.setVisible(R.id.tv_album_name, true);
|
||||
helper.setVisible(R.id.tv_album_count, true);
|
||||
if (!item.getPwd().isEmpty()){
|
||||
ImageUtils.loadBlurredImageWithDefault(item.getImage(), helper.getView(R.id.riv_album), com.xscm.moduleutil.R.mipmap.default_avatar, 25);
|
||||
helper.setVisible(R.id.iv_album_suo,true);
|
||||
}
|
||||
helper.setText(R.id.tv_album_name, item.getName());
|
||||
helper.setText(R.id.tv_album_count, item.getRead_num());
|
||||
} else {
|
||||
helper.setImageResource(R.id.riv_album, com.xscm.moduleutil.R.mipmap.create_album);
|
||||
helper.setVisible(R.id.tv_album_name, false);
|
||||
helper.setVisible(R.id.tv_album_count, false);
|
||||
helper.setVisible(R.id.iv_album_suo,false);
|
||||
}
|
||||
|
||||
helper.setVisible(R.id.riv_album, true);
|
||||
helper.addOnClickListener(R.id.riv_album);
|
||||
// helper.addOnLongClickListener(R.id.riv_album);
|
||||
}
|
||||
|
||||
|
||||
public void setDelete(boolean b) {
|
||||
this.b = b;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setLongClickPos(int pos) {
|
||||
this.longClickPos = pos;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public boolean getDelete() {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,481 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import static com.blankj.utilcode.util.ActivityUtils.getLauncherActivity;
|
||||
import static com.blankj.utilcode.util.ActivityUtils.startActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.xscm.moduleutil.RoomAutionTimeBean;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.bean.RoomData;
|
||||
import com.xscm.moduleutil.bean.RoomRelationBean;
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel;
|
||||
import com.xscm.moduleutil.bean.ViewItem;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.GifAvatarOvalView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MyCreateAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
|
||||
private List<ViewItem> viewItems = new ArrayList<>();
|
||||
private int selectedRelationPosition = -1;
|
||||
private int selectedTimePosition = -1;
|
||||
private int selectedGiftPosition = -1;
|
||||
|
||||
// public void submitList(List<ViewItem> items) {
|
||||
// viewItems.clear();
|
||||
// viewItems.addAll(items);
|
||||
// notifyDataSetChanged();
|
||||
// }
|
||||
|
||||
public void submitList(List<ViewItem> items) {
|
||||
if (items == null || items.isEmpty()) {
|
||||
viewItems.clear();
|
||||
notifyDataSetChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
List<ViewItem> filteredList = new ArrayList<>();
|
||||
for (ViewItem item : items) {
|
||||
int type = item.getType();
|
||||
Object data = item.getData();
|
||||
|
||||
// 判断是否为空数据
|
||||
boolean isValid = true;
|
||||
|
||||
switch (type) {
|
||||
case ViewItem.TYPE_TEXT:
|
||||
// 文本类型直接展示(字符串不会为 null)
|
||||
break;
|
||||
|
||||
case ViewItem.TYPE_RELATION:
|
||||
isValid = data instanceof MyRoomBean && ((MyRoomBean) data).getRoom_name() != null; // 假设你有一个 isValid() 方法判断是否为空
|
||||
break;
|
||||
|
||||
case ViewItem.TYPE_GIFT:
|
||||
isValid = data instanceof MyCpRoom && !TextUtils.isEmpty(((MyCpRoom) data).getRoom_name()); // 示例判断字段非空
|
||||
break;
|
||||
|
||||
case ViewItem.TYPE_IMAGE_SELECTION:
|
||||
isValid = data instanceof MyFootResp && !TextUtils.isEmpty(((MyFootResp) data).getRoom_name());
|
||||
break;
|
||||
|
||||
default:
|
||||
isValid = false; // 默认不展示未知类型
|
||||
break;
|
||||
}
|
||||
|
||||
if (isValid) {
|
||||
filteredList.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
viewItems.clear();
|
||||
viewItems.addAll(filteredList);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return viewItems.get(position).getType();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
switch (viewType) {
|
||||
case ViewItem.TYPE_TEXT:
|
||||
return new TextViewHolder(inflater.inflate(R.layout.room_li_bu, parent, false));
|
||||
case ViewItem.TYPE_RELATION:
|
||||
return new RelationViewHolder(inflater.inflate(R.layout.room_fragment_my_room_list, parent, false));
|
||||
case ViewItem.TYPE_GIFT:
|
||||
return new RelationViewTimHolder(inflater.inflate(R.layout.room_fragment_my_room_cp_list, parent, false));
|
||||
case ViewItem.TYPE_IMAGE_SELECTION:
|
||||
return new GiftViewHolder(inflater.inflate(R.layout.room_index_item_chatroom_my_foot, parent, false));
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown view type");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int position) {
|
||||
ViewItem item = viewItems.get(position);
|
||||
|
||||
switch (item.getType()) {
|
||||
case ViewItem.TYPE_TEXT:
|
||||
RoomData roomData = (RoomData) item.getData();
|
||||
((TextViewHolder) holder).bind((roomData));
|
||||
break;
|
||||
case ViewItem.TYPE_RELATION:
|
||||
MyRoomBean relationBean = (MyRoomBean) item.getData();
|
||||
((RelationViewHolder) holder).bind(relationBean);
|
||||
|
||||
break;
|
||||
case ViewItem.TYPE_IMAGE_SELECTION:
|
||||
MyFootResp myFootResp = (MyFootResp) item.getData();
|
||||
((GiftViewHolder) holder).bind(myFootResp);
|
||||
break;
|
||||
case ViewItem.TYPE_GIFT:
|
||||
|
||||
MyCpRoom roomAutionTimeBean = (MyCpRoom) item.getData();
|
||||
((RelationViewTimHolder) holder).bind(roomAutionTimeBean);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface OnItemSelectedListener {
|
||||
void onItemSelected(int viewType, int position);
|
||||
}
|
||||
|
||||
private OnItemSelectedListener listener;
|
||||
|
||||
public void setOnItemSelectedListener(OnItemSelectedListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public RoomRelationBean getSelectedRelation() {
|
||||
if (selectedRelationPosition != -1) {
|
||||
ViewItem item = viewItems.get(selectedRelationPosition);
|
||||
if (item.getData() instanceof RoomRelationBean) {
|
||||
return (RoomRelationBean) item.getData();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public RoomAutionTimeBean getSelectedTime() {
|
||||
if (selectedTimePosition != -1) {
|
||||
ViewItem item = viewItems.get(selectedTimePosition);
|
||||
if (item.getData() instanceof RoomAutionTimeBean) {
|
||||
return (RoomAutionTimeBean) item.getData();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public RoonGiftModel getSelectedGift() {
|
||||
if (selectedGiftPosition != -1) {
|
||||
ViewItem item = viewItems.get(selectedGiftPosition);
|
||||
if (item.getData() instanceof RoonGiftModel) {
|
||||
return (RoonGiftModel) item.getData();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 定义接口
|
||||
public interface OnImageClickListener {
|
||||
void onImageClick(View view, RoomData roomData);
|
||||
}
|
||||
|
||||
// 添加接口类型的变量
|
||||
private static OnImageClickListener onImageClickListener;
|
||||
|
||||
// 提供一个方法来设置接口变量
|
||||
public void setOnImageClickListener(OnImageClickListener listener) {
|
||||
this.onImageClickListener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return viewItems.size();
|
||||
}
|
||||
|
||||
static class TextViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView textView;
|
||||
ImageView imageView1,imageView2;
|
||||
|
||||
TextViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
textView = itemView.findViewById(R.id.tv_title);
|
||||
imageView1 = itemView.findViewById(R.id.iv_footprint);
|
||||
imageView2 = itemView.findViewById(R.id.iv_delete_foot);
|
||||
}
|
||||
|
||||
void bind(RoomData roomData) {
|
||||
textView.setText(roomData.getTitle());
|
||||
if (roomData.getTitleType()==0){
|
||||
imageView2.setVisibility(View.INVISIBLE);
|
||||
}else {
|
||||
imageView2.setVisibility(View.VISIBLE);
|
||||
imageView2.setImageResource(roomData.getTitleType());
|
||||
}
|
||||
imageView1.setImageResource(roomData.getTitleIcon());
|
||||
|
||||
imageView2.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (onImageClickListener != null) {
|
||||
onImageClickListener.onImageClick(view, roomData);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static class RelationViewHolder extends RecyclerView.ViewHolder {
|
||||
RoundedImageView riv;
|
||||
ImageView iv_play, im_sh;
|
||||
TextView tv_name;
|
||||
TextView tv_sy;
|
||||
TextView tv_user_id, tv_gz, tv_zx, tv_fw, rl_mx, tv_room_bt;
|
||||
ConstraintLayout cl_my_room_list;
|
||||
|
||||
RelationViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
riv = itemView.findViewById(R.id.riv);
|
||||
iv_play = itemView.findViewById(R.id.iv_play);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_sy = itemView.findViewById(R.id.tv_sy);
|
||||
tv_user_id = itemView.findViewById(R.id.tv_user_id);
|
||||
tv_gz = itemView.findViewById(R.id.tv_gz);
|
||||
tv_zx = itemView.findViewById(R.id.tv_zx);
|
||||
tv_fw = itemView.findViewById(R.id.tv_fw);
|
||||
rl_mx = itemView.findViewById(R.id.rl_mx);
|
||||
tv_room_bt = itemView.findViewById(R.id.tv_room_bt);
|
||||
im_sh = itemView.findViewById(R.id.im_sh);
|
||||
cl_my_room_list = itemView.findViewById(R.id.cl_my_room_list);
|
||||
}
|
||||
|
||||
void bind(MyRoomBean item) {
|
||||
|
||||
|
||||
|
||||
ImageUtils.loadImageView(item.getRoom_cover(), riv);
|
||||
if (item.getLabel_icon() != null) {
|
||||
ImageUtils.loadImageView(item.getLabel_icon(), iv_play);
|
||||
}
|
||||
tv_name.setText(item.getRoom_name());
|
||||
tv_sy.setText(item.getToday_profit() + "");
|
||||
tv_user_id.setText("ID: " + item.getRoom_number());
|
||||
|
||||
String concernText = "关注:" + item.getFollow_num();
|
||||
SpannableString spannableString = new SpannableString(concernText);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(itemView.getContext(), R.color.black)), 2, concernText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
tv_gz.setText(spannableString);
|
||||
|
||||
|
||||
String concernText1 = "在线:" + item.getOnline_num();
|
||||
SpannableString spannableString1 = new SpannableString(concernText1);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString1.setSpan(new ForegroundColorSpan(ContextCompat.getColor(itemView.getContext(), R.color.black)), 2, concernText1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
tv_zx.setText(spannableString1);
|
||||
|
||||
String concernText2 = "访问:" + item.getVisit_num();
|
||||
SpannableString spannableString2 = new SpannableString(concernText2);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString2.setSpan(new ForegroundColorSpan(ContextCompat.getColor(itemView.getContext(), R.color.black)), 2, concernText2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
tv_fw.setText(spannableString2);
|
||||
|
||||
rl_mx.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: 跳转到房间详情页面
|
||||
if (item.getApply_status().equals("1")){
|
||||
queren(itemView.getContext());
|
||||
return;
|
||||
}
|
||||
// startActivity(new Intent(getContext(), RoomDetailsActivity.class));
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM_DETAILS).withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
cl_my_room_list.setOnClickListener(new View.OnClickListener() {//跳转房间
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (item.getApply_status().equals("1")){
|
||||
queren(itemView.getContext());
|
||||
return;
|
||||
}
|
||||
// TODO: 跳转到房间
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
tv_room_bt.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {//房间补贴
|
||||
if (item.getApply_status().equals("1")){
|
||||
queren(itemView.getContext());
|
||||
return;
|
||||
}
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_ALLOWANCE).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
|
||||
if (item.getApply_status().equals("2")){
|
||||
im_sh.setVisibility(View.GONE);
|
||||
}else if (item.getApply_status().equals("1")){
|
||||
im_sh.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(rl_mx, itemView.getContext().getColor(com.xscm.moduleutil.R.color.color6c49e25) , 53);
|
||||
rl_mx.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tv_room_bt, itemView.getContext().getColor(com.xscm.moduleutil.R.color.colorCDEB52E), 53);
|
||||
tv_room_bt.setTextColor(ContextCompat.getColor(itemView.getContext(), com.xscm.moduleutil.R.color.colorC58600) );
|
||||
}
|
||||
}
|
||||
private static void queren(Context context) {
|
||||
// 创建并显示确认对话框
|
||||
new ConfirmDialog(context,
|
||||
"温馨提示",
|
||||
"您创建的房间正在审核中,请耐心等待或联系人工客服解决处理",
|
||||
"知道了",
|
||||
"",
|
||||
v -> {
|
||||
// 点击“确认”按钮时执行删除操作
|
||||
},
|
||||
v -> {
|
||||
// 点击“取消”按钮时什么都不做
|
||||
}, false, 0).show();
|
||||
}
|
||||
|
||||
static class RelationViewTimHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
ConstraintLayout cl_my_room_list;
|
||||
GifAvatarOvalView user_avatar1, user_avatar2;
|
||||
TextView tv_gx, tv_name, tv_sy, tv_user_id, room_head_top2, room_head_top3, rl_mx, tv_time;
|
||||
ImageView iv_play;
|
||||
|
||||
RelationViewTimHolder(View itemView) {
|
||||
super(itemView);
|
||||
cl_my_room_list = itemView.findViewById(R.id.cl_my_room_list);
|
||||
user_avatar1 = itemView.findViewById(R.id.user_avatar1);
|
||||
user_avatar2 = itemView.findViewById(R.id.user_avatar2);
|
||||
tv_gx = itemView.findViewById(R.id.tv_gx);
|
||||
iv_play = itemView.findViewById(R.id.iv_play);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_sy = itemView.findViewById(R.id.tv_sy);
|
||||
tv_user_id = itemView.findViewById(R.id.tv_user_id);
|
||||
room_head_top2 = itemView.findViewById(R.id.room_head_top2);
|
||||
room_head_top3 = itemView.findViewById(R.id.room_head_top3);
|
||||
rl_mx = itemView.findViewById(R.id.rl_mx);
|
||||
tv_time = itemView.findViewById(R.id.tv_time);
|
||||
}
|
||||
|
||||
void bind(MyCpRoom item) {
|
||||
ImageUtils.loadImageView(item.getUser1_avatar(), user_avatar1);
|
||||
ImageUtils.loadImageView(item.getUser2_avatar(), user_avatar2);
|
||||
tv_gx.setText(item.getRelation());
|
||||
tv_name.setText(item.getRoom_name());
|
||||
tv_sy.setText(item.getEarnings() + "");
|
||||
tv_user_id.setText("ID: " + item.getRoom_number());
|
||||
// room_head_top2.setText();
|
||||
tv_time.setText(formatTimestampToDaysHours(Long.parseLong(item.getEnd_time())));
|
||||
rl_mx.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: 跳转到房间详情页面
|
||||
|
||||
// startActivity(new Intent(getContext(), RoomDetailsActivity.class));
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM_DETAILS).withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
cl_my_room_list.setOnClickListener(new View.OnClickListener() {//跳转房间
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: 跳转到房间
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(rl_mx, itemView.getContext().getColor(com.xscm.moduleutil.R.color.color6c49e25) , 53);
|
||||
rl_mx.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
}
|
||||
}
|
||||
public static String formatTimestampToDaysHours(long timestamp) {
|
||||
// 获取当前时间戳(秒)
|
||||
long currentTimestamp = System.currentTimeMillis() / 1000;
|
||||
|
||||
// 计算时间差(秒)
|
||||
long timeDifferenceSeconds = Math.abs(currentTimestamp - timestamp);
|
||||
|
||||
// 转换为天数和小时数
|
||||
long days = timeDifferenceSeconds / (24 * 60 * 60);
|
||||
long remainingSecondsAfterDays = timeDifferenceSeconds % (24 * 60 * 60);
|
||||
long hours = remainingSecondsAfterDays / (60 * 60);
|
||||
|
||||
return days + "天 " + hours + "小时";
|
||||
}
|
||||
|
||||
static class GiftViewHolder extends RecyclerView.ViewHolder {
|
||||
RoundedImageView iv_follow_bg;
|
||||
ImageView iv_type, iv_play;
|
||||
TextView tv_name, tv_num;
|
||||
ConstraintLayout rl_root;
|
||||
|
||||
GiftViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
iv_follow_bg = itemView.findViewById(R.id.iv_follow_bg);
|
||||
iv_type = itemView.findViewById(R.id.iv_type);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
iv_play = itemView.findViewById(R.id.iv_play);
|
||||
tv_num = itemView.findViewById(R.id.tv_num);
|
||||
rl_root = itemView.findViewById(R.id.rl_root);
|
||||
}
|
||||
|
||||
void bind(MyFootResp item) {
|
||||
ImageUtils.loadHeadCC(item.getRoom_cover(), iv_follow_bg);
|
||||
// if (item.getLabel_id().equals("23")){
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.diang_c);
|
||||
// }else if (item.getLabel_id().equals("108")){
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.youxi);
|
||||
// }else if (item.getLabel_id().equals("101")){
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.youxi);
|
||||
// } else if (item.getLabel_id().equals("120")){//女神
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nvshen);
|
||||
// }else if (item.getLabel_id().equals("121")){//男神
|
||||
// helper.setImageResource(R.id.iv_type, com.qxcm.moduleutil.R.mipmap.nans);
|
||||
// }
|
||||
|
||||
ImageUtils.loadHeadCC(item.getLabel_icon(), iv_type);
|
||||
|
||||
tv_name.setText(item.getRoom_name());
|
||||
tv_num.setText(item.getHot_value());
|
||||
|
||||
ImageUtils.loadRes(com.xscm.moduleutil.R.drawable.voice_play, iv_play);
|
||||
rl_root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
import com.xscm.moduleutil.utils.TimeUtils;
|
||||
|
||||
public class RevenueAdapter extends BaseQuickAdapter<RevenueBean, BaseViewHolder> {
|
||||
public RevenueAdapter() {
|
||||
super(R.layout.item_revenue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RevenueBean item) {
|
||||
if (item!=null && item.getCreatetime()!=null) {
|
||||
String time = TimeUtils.getDateToStringNoZ(Long.parseLong(item.getCreatetime()) * 1000L);
|
||||
helper.setText(R.id.tv_time, time);
|
||||
helper.setText(R.id.tv_name, item.getRemarks());
|
||||
helper.setText(R.id.tv_jb, item.getChange_value());
|
||||
|
||||
if (item.getType()==2){
|
||||
helper.getView(R.id.im_ty).setBackgroundResource(com.xscm.moduleutil.R.mipmap.gift_t);
|
||||
}else if (item.getType()==1){
|
||||
helper.getView(R.id.im_ty).setBackgroundResource(com.xscm.moduleutil.R.mipmap.jinb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomAllowanceDetailAdapter extends BaseQuickAdapter<RoomSubsidyDetails, BaseViewHolder> {
|
||||
public RoomAllowanceDetailAdapter() {
|
||||
super(R.layout.room_index_item_subsidy);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, RoomSubsidyDetails item) {
|
||||
helper.setText(R.id.tv_data, item.getStart_time() + "-" + item.getEnd_time());
|
||||
helper.setText(R.id.tv_lj, item.getTotal_transaction());
|
||||
helper.setText(R.id.tv_bt, item.getSubsidy_amount());
|
||||
TextView tv_status = helper.getView(R.id.tv_status);
|
||||
if (item.getStatus().equals("1")) {
|
||||
tv_status.setText("已发放");
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
} else {
|
||||
tv_status.setText("未发放");
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_45d08c));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNewData(@Nullable List<RoomSubsidyDetails> data) {
|
||||
super.setNewData(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.details.BaseMultiItemEntity;
|
||||
import com.xscm.moduleutil.bean.details.RoomDeatailList;
|
||||
import com.xscm.moduleutil.bean.details.RoomDeatil;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.widget.GifAvatarOvalView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class RoomDetailsAdapter extends BaseMultiItemQuickAdapter<BaseMultiItemEntity, BaseViewHolder> {
|
||||
private static final int TYPE_DATE_HEADER = 1;
|
||||
private static final int TYPE_GIFT_ITEM = 2;
|
||||
|
||||
public RoomDetailsAdapter(List<BaseMultiItemEntity> data) {
|
||||
super(data);
|
||||
addItemType(BaseMultiItemEntity.TYPE_A, R.layout.item_date_header);
|
||||
addItemType(BaseMultiItemEntity.TYPE_B, R.layout.room_details_list);
|
||||
// 开启吸顶功能
|
||||
enableLoadMoreEndClick(false); // 禁用加载更多点击事件,防止冲突
|
||||
setEnableLoadMore(false); // 禁用加载更多功能,防止冲突
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, BaseMultiItemEntity item) {
|
||||
switch (helper.getItemViewType()) {
|
||||
case TYPE_DATE_HEADER:
|
||||
|
||||
RoomDeatailList roomDetailList = (RoomDeatailList) item;
|
||||
helper.setText(R.id.tv6, roomDetailList.getTime());
|
||||
helper.setText(R.id.tv8, roomDetailList.getTotal_earning() + "");
|
||||
helper.setText(R.id.tve, roomDetailList.getTotal_price() + "");
|
||||
break;
|
||||
case TYPE_GIFT_ITEM:
|
||||
RoomDeatil item1 = (RoomDeatil) item;
|
||||
GifAvatarOvalView avatarView = helper.getView(R.id.riv);
|
||||
TextView tvName = helper.getView(R.id.tv_name);
|
||||
TextView tv2 = helper.getView(R.id.tv_2);
|
||||
TextView tv3 = helper.getView(R.id.tv_3);
|
||||
TextView tv_go_to_room = helper.getView(R.id.tv_go_to_room);
|
||||
ImageUtils.loadImageView(item1.getSender_avatar(), avatarView);
|
||||
tvName.setText(item1.getSender_nickname());
|
||||
tv2.setText(item1.getReceive_nickname());
|
||||
tv3.setText(item1.getGift_name() + "x" + item1.getNumber());
|
||||
tv_go_to_room.setText(item1.getTotal_price() + "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSticky(RoomDeatailList item) {
|
||||
// 返回是否为吸顶项的逻辑
|
||||
return item.isSticky();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/6
|
||||
*@description:相册单选弹框适配器
|
||||
*/
|
||||
public class SingleChoiceAdapter extends BaseQuickAdapter<AlbumBean, BaseViewHolder> {
|
||||
/**
|
||||
* -- GETTER --
|
||||
* 获取当前选中位置
|
||||
*/
|
||||
private int selectedPosition = -1; // 默认未选中
|
||||
|
||||
public SingleChoiceAdapter() {
|
||||
super(R.layout.item_multi_select_t);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, AlbumBean item) {
|
||||
int position1 = helper.getAdapterPosition();
|
||||
|
||||
boolean isSelected = (position1 == selectedPosition);
|
||||
TextView tv_album_name1 = helper.getView(R.id.tv_album_name1);
|
||||
tv_album_name1.setText(item.getName());
|
||||
helper.setText(R.id.tv_album_count1, "浏览数:"+item.getRead_num());
|
||||
|
||||
ImageUtils.loadHeadCC(item.getImage(), helper.getView(R.id.iv_photo1));
|
||||
helper.getView(R.id.v_checkbox).setSelected(isSelected); // 使用 CheckBox.setChecked()
|
||||
|
||||
// 设置点击事件
|
||||
helper.itemView.setOnClickListener(v -> {
|
||||
int pos = helper.getAdapterPosition();
|
||||
if (pos != RecyclerView.NO_POSITION) {
|
||||
if (selectedPosition == pos) {
|
||||
selectedPosition = -1; // 如果已选中,则取消
|
||||
} else {
|
||||
selectedPosition = pos; // 更新为新的选中项
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
|
||||
helper.getView(R.id.v_checkbox).setOnClickListener(v -> {
|
||||
int pos = helper.getAdapterPosition();
|
||||
if (pos != RecyclerView.NO_POSITION) {
|
||||
if (selectedPosition == pos) {
|
||||
selectedPosition = -1;
|
||||
} else {
|
||||
selectedPosition = pos;
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前选中的条目
|
||||
*/
|
||||
public AlbumBean getSelectedItem() {
|
||||
if (selectedPosition == -1 || selectedPosition >= getData().size()) return null;
|
||||
return getData().get(selectedPosition);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class TaskBoxAdapter extends BaseQuickAdapter<GiftBoxBean.GiftBean, BaseViewHolder> {
|
||||
public TaskBoxAdapter() {
|
||||
super(R.layout.item_task_box);
|
||||
}
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int position);
|
||||
}
|
||||
private OnItemClickListener onItemClickListener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.onItemClickListener = listener;
|
||||
}
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBoxBean.GiftBean item) {
|
||||
int position = helper.getLayoutPosition(); // 获取当前位置
|
||||
|
||||
View itemView = helper.itemView; // 获取整个 item 的根布局
|
||||
TextView giftName = helper.getView(R.id.tv_type_name);
|
||||
TextView giftTitle = helper.getView(R.id.tv_title);
|
||||
giftName.setText(item.getName());
|
||||
giftTitle.setText(item.getTitle());
|
||||
ImageUtils.loadHeadCC(item.getIcon(), helper.getView(R.id.task_box));
|
||||
if (position == 0) {
|
||||
itemView.setBackgroundColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_FCE4ED)); // 红色
|
||||
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_E24171));
|
||||
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_E24171);
|
||||
// helper.setImageDrawable(R.id.task_box, mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.task_cj));
|
||||
|
||||
|
||||
} else if (position == 1) {
|
||||
itemView.setBackgroundColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_FDE8AE)); // 黄色
|
||||
giftName.setTextColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_F35F07));
|
||||
setSpannableText(giftTitle, "最高可获得%d金币", Integer.parseInt(item.getHighest_gain()),com.xscm.moduleutil.R.color.color_F35F07);
|
||||
// helper.setImageDrawable(R.id.task_box, mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.task_gj));
|
||||
|
||||
} else {
|
||||
// 其他 item 恢复默认背景(可选)
|
||||
itemView.setBackground(null);
|
||||
}
|
||||
|
||||
helper.setText(R.id.tv_jb, "满"+item.getMeet()+"金币");
|
||||
double progress = Double.parseDouble(item.getUnlock_progress()!=null?item.getUnlock_progress():"0.00");
|
||||
long progressNum = (long) (progress * 1000);
|
||||
LinearProgressIndicator progressIndicator= helper.getView(R.id.progress_indicator);
|
||||
progressIndicator.setProgress(Integer.parseInt(String.valueOf(progressNum)));
|
||||
|
||||
double unlock_num = Double.parseDouble(item.getUnlock_progress()!=null?item.getUnlock_progress():"0.00");
|
||||
long unlock_num_long = (long) (unlock_num * 1000);
|
||||
|
||||
helper.setText(R.id.tv_jb_num, Integer.parseInt(String.valueOf(unlock_num_long))/10 + "%");
|
||||
if (position==0){
|
||||
progressIndicator.setIndicatorColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_E24171));
|
||||
}else {
|
||||
progressIndicator.setIndicatorColor(mContext.getResources().getColor(com.xscm.moduleutil.R.color.color_F35F07));
|
||||
|
||||
}
|
||||
helper.setText(R.id.iv_unlock, item.getStatus_str());
|
||||
View unlockView = helper.getView(R.id.iv_unlock);
|
||||
if (item.getStatus().equals("0")){
|
||||
// helper.setImageDrawable(R.id.iv_unlock, mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.not_unlocked));
|
||||
unlockView.setClickable(false);
|
||||
unlockView.setEnabled(false);
|
||||
// 可选:改变颜色或透明度来视觉反馈
|
||||
unlockView.setAlpha(0.5f); // 半透明表示不可点击
|
||||
}else if (item.getStatus().equals("1")){
|
||||
unlockView.setClickable(true);
|
||||
unlockView.setEnabled(true);
|
||||
unlockView.setAlpha(1.0f); // 恢复正常显示
|
||||
}else if (item.getStatus().equals("2")){
|
||||
unlockView.setClickable(false);
|
||||
unlockView.setEnabled(false);
|
||||
}
|
||||
else {
|
||||
// helper.setImageDrawable(R.id.iv_unlock, mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.unlocked));
|
||||
|
||||
unlockView.setClickable(false);
|
||||
unlockView.setEnabled(false);
|
||||
// 可选:改变颜色或透明度来视觉反馈
|
||||
unlockView.setAlpha(0.5f); // 半透明表示不可点击
|
||||
}
|
||||
|
||||
helper.getView(R.id.iv_unlock).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
int position = helper.getLayoutPosition();
|
||||
onItemClickListener.onItemClick(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 设置带部分颜色的文本
|
||||
private void setSpannableText(TextView textView, String format, int number,int color) {
|
||||
String fullText = String.format(format, number);
|
||||
SpannableString spannableString = new SpannableString(fullText);
|
||||
|
||||
// 找到数字的位置
|
||||
String numberStr = String.valueOf(number);
|
||||
int startIndex = fullText.indexOf(numberStr);
|
||||
int endIndex = startIndex + numberStr.length();
|
||||
|
||||
if (startIndex >= 0) {
|
||||
// 设置数字为红色
|
||||
spannableString.setSpan(
|
||||
new ForegroundColorSpan(ContextCompat.getColor(mContext,color)), // 使用你定义的颜色
|
||||
startIndex,
|
||||
endIndex,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
}
|
||||
|
||||
textView.setText(spannableString);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/7/12
|
||||
*@description: 每日任务
|
||||
*/
|
||||
public class TaskDataAdapter extends BaseQuickAdapter<GiftBoxBean.TaskDataBean.DailyTasksBean, BaseViewHolder> {
|
||||
public TaskDataAdapter() {
|
||||
super(R.layout.item_task_data);
|
||||
}
|
||||
|
||||
public interface ItemClickLitener{
|
||||
void onItemClick(View view, int position,GiftBoxBean.TaskDataBean.DailyTasksBean item);
|
||||
}
|
||||
private ItemClickLitener mItemClickLitener;
|
||||
public void setItemClickLitener(ItemClickLitener mItemClickLitener) {
|
||||
this.mItemClickLitener = mItemClickLitener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
TextView textView=helper.getView(R.id.task_type);
|
||||
// if (item.getTaskType().equals("1")){
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_lock));
|
||||
// }else if (item.getTaskType().equals("2")){
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_wc));
|
||||
// } else if (item.getTaskType().equals("3")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_sl));
|
||||
// }else if (item.getTaskType().equals("4")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_yq));
|
||||
// }else if (item.getTaskType().equals("5")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.go_cz));
|
||||
// }else if (item.getTaskType().equals("6")) {
|
||||
// textView.setBackground(mContext.getResources().getDrawable(com.qxcm.moduleutil.R.mipmap.ylq));
|
||||
// }
|
||||
|
||||
textView.setText(item.getTask_type_str().equals("去完成")?"未完成": (item.getTask_type_str().equals("领取金币")?"待领取":item.getTask_type_str()));
|
||||
ImageUtils.loadHeadCC(item.getIcon(), helper.getView(R.id.task_pic));
|
||||
helper.setText(R.id.task_name, item.getTask_name())
|
||||
.setText(R.id.task_jb_number, "+"+item.getGold_reward());
|
||||
helper.getView(R.id.task_type).setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (mItemClickLitener!= null){
|
||||
mItemClickLitener.onItemClick(view, helper.getLayoutPosition(), item);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.bean.TaskItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TaskSectionAdapter extends RecyclerView.Adapter<TaskSectionAdapter.SectionViewHolder> {
|
||||
|
||||
private List<TaskItem> sections;
|
||||
|
||||
public TaskSectionAdapter(List<TaskItem> sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
// 定义点击事件接口
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(TaskItem taskItem, GiftBoxBean.TaskDataBean.DailyTasksBean item);
|
||||
}
|
||||
|
||||
private OnItemClickListener listener;
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public SectionViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_task_header, parent, false);
|
||||
return new SectionViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull SectionViewHolder holder, int position) {
|
||||
TaskItem section = sections.get(position);
|
||||
holder.title.setText(section.title);
|
||||
|
||||
TaskDataAdapter adapter = new TaskDataAdapter();
|
||||
holder.recyclerView.setLayoutManager(new LinearLayoutManager(holder.itemView.getContext()));
|
||||
holder.recyclerView.setAdapter(adapter);
|
||||
adapter.setNewData(section.tasks);
|
||||
if (position==2){
|
||||
holder.view.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
holder.view.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
adapter.setItemClickLitener(new TaskDataAdapter.ItemClickLitener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position, GiftBoxBean.TaskDataBean.DailyTasksBean item) {
|
||||
if (listener!= null) {
|
||||
listener.onItemClick(section,item);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return sections.size();
|
||||
}
|
||||
|
||||
static class SectionViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView title;
|
||||
RecyclerView recyclerView;
|
||||
View view;
|
||||
|
||||
public SectionViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
title = itemView.findViewById(R.id.tv_title);
|
||||
recyclerView = itemView.findViewById(R.id.rv_task_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(itemView.getContext()));
|
||||
view = itemView.findViewById(R.id.v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.CombinedGiftBean;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author lxj$
|
||||
* @Time 2025年8月1日00:09:34$ $
|
||||
* @Description 礼物墙中赠送用户显示的adapter$
|
||||
*/
|
||||
public class TopUsersAdapter extends BaseQuickAdapter<CombinedGiftBean.TopUsers, BaseViewHolder> {
|
||||
|
||||
public TopUsersAdapter(List<CombinedGiftBean.TopUsers> topUsersList) {
|
||||
super(R.layout.item_top_user, topUsersList);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, CombinedGiftBean.TopUsers item) {
|
||||
ImageLoader.loadImage(mContext, helper.getView(R.id.riv_user_avatar), item.getAvatar());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.CombinedGiftBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageLoader;
|
||||
|
||||
public class UserGiftWallAdapter extends BaseQuickAdapter<CombinedGiftBean, BaseViewHolder> {
|
||||
|
||||
|
||||
public UserGiftWallAdapter() {
|
||||
super(R.layout.me_item_user_gift_wall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, CombinedGiftBean item) {
|
||||
helper.setText(R.id.tv_gift_name, item.getGift_name());
|
||||
helper.setText(R.id.tv_gift_price, item.getGift_price());
|
||||
ImageLoader.loadImage(mContext, helper.getView(R.id.iv_gift_pic), item.getBase_image());
|
||||
TextView tv_number = helper.getView(R.id.tv_number);
|
||||
if (item.is_liang()) {
|
||||
helper.getView(R.id.cl_iv_down_on).setBackgroundColor(Color.parseColor("#E6E6E6"));
|
||||
float[] corners = {0f, 4f, 0f, 4f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(tv_number, ColorManager.getInstance().getPrimaryColorInt(), corners);
|
||||
tv_number.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
// 点亮的礼物显示高亮和送礼物的用户
|
||||
helper.setText(R.id.tv_number, "x" + item.getTotal_count());
|
||||
helper.setVisible(R.id.tv_number, true);
|
||||
// helper.setVisible(R.id.riv_user_head, true);
|
||||
helper.setVisible(R.id.iv_gift_pic_overlay, false);
|
||||
// 显示送礼物的用户列表
|
||||
RecyclerView recyclerView = helper.getView(R.id.rv_gift_user_list);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
TopUsersAdapter topUsersAdapter = new TopUsersAdapter(item.getTop_users());
|
||||
recyclerView.setAdapter(topUsersAdapter);
|
||||
} else {
|
||||
// 未点亮的礼物只显示图片、名称和金额,不高亮
|
||||
helper.setVisible(R.id.tv_number, false);
|
||||
// helper.setVisible(R.id.riv_user_head, false);
|
||||
helper.setVisible(R.id.iv_gift_pic_overlay, true);
|
||||
// 隐藏送礼物的用户列表
|
||||
helper.setVisible(R.id.rv_gift_user_list, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class UserPhotoWallAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
|
||||
private boolean b = false;
|
||||
private int longClickPos = -1;
|
||||
public static final String ADD_PHOTO = "ADD_PHOTO";
|
||||
|
||||
|
||||
public UserPhotoWallAdapter() {
|
||||
super(R.layout.me_item_user_photo_wall);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, String item) {
|
||||
|
||||
if (item.equals(ADD_PHOTO)) {
|
||||
helper.setVisible(R.id.iv_close, false);
|
||||
// 显示加号图片
|
||||
helper.setImageResource(com.xscm.moduleutil.R.id.riv_user_head, com.xscm.moduleutil.R.mipmap.add_img);
|
||||
} else {
|
||||
helper.setVisible(R.id.iv_close, true);
|
||||
ImageUtils.loadCenterCrop(item, helper.getView(com.xscm.moduleutil.R.id.riv_user_head));
|
||||
}
|
||||
// if (helper.getAdapterPosition() == 5) {
|
||||
// helper.setVisible(R.id.riv_user_head, false);
|
||||
// helper.setVisible(R.id.iv_close, false);
|
||||
// } else {
|
||||
// helper.setVisible(R.id.riv_user_head, true);
|
||||
// if (!"0".equals(item.getId())) {
|
||||
// ImageUtils.loadCenterCrop(item.getUrl(), helper.getView(R.id.riv_user_head));
|
||||
// if (longClickPos == helper.getAdapterPosition()) {
|
||||
// helper.setVisible(R.id.iv_close, true);
|
||||
// } else {
|
||||
// helper.setVisible(R.id.iv_close, false);
|
||||
// }
|
||||
// } else {
|
||||
// helper.setImageResource(R.id.riv_user_head, com.qxcm.moduleutil.R.mipmap.add_img);
|
||||
// helper.setGone(R.id.iv_close, false);
|
||||
// }
|
||||
// }
|
||||
helper.addOnClickListener(R.id.iv_close);
|
||||
helper.addOnClickListener(R.id.riv_user_head);
|
||||
helper.addOnLongClickListener(R.id.riv_user_head);
|
||||
}
|
||||
|
||||
|
||||
public void setDelete(boolean b) {
|
||||
this.b = b;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void setLongClickPos(int pos) {
|
||||
this.longClickPos = pos;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public boolean getDelete() {
|
||||
return b;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.modulevocal.adapter;
|
||||
|
||||
import static com.xscm.moduleutil.utils.UtilConfig.getContext;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
|
||||
public class WithdrawalAdapter extends BaseQuickAdapter<WithdrawalBean, BaseViewHolder> {
|
||||
public WithdrawalAdapter() {
|
||||
super(R.layout.item_withdrawal);
|
||||
}
|
||||
|
||||
@SuppressLint("ResourceType")
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, WithdrawalBean item) {
|
||||
if (item != null ) {
|
||||
TextView tv_status = helper.getView(R.id.tv_status);
|
||||
helper.setText(R.id.tv_time, item.getCreatetime());
|
||||
helper.setText(R.id.tv_name, item.getName());
|
||||
helper.setText(R.id.tv_jb, item.getMoney());
|
||||
tv_status.setText(item.getStatus_str());
|
||||
if (item.getStatus().equals("1")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_0DFFB9));
|
||||
}else if (item.getStatus().equals("2")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
}else if (item.getStatus().equals("3")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_ff8acc));
|
||||
}else if (item.getStatus().equals("4")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_68A5FF));
|
||||
}else if (item.getStatus().equals("5")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_ff8acc));
|
||||
}else if (item.getStatus().equals("6")){
|
||||
tv_status.setTextColor(getContext().getResources().getColor(com.xscm.moduleutil.R.color.color_FF999999));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class AlbumDetailConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getAlbumDetail(AlbumBean albumBean);
|
||||
|
||||
void upLoadSuccess(String url, int type, int index, int total);
|
||||
|
||||
void upAddAlbum();
|
||||
|
||||
void getAlbumList(List<AlbumBean> data);
|
||||
|
||||
void moveAlbum();
|
||||
|
||||
void deleteAlbum();
|
||||
void likeAlbum();
|
||||
|
||||
}
|
||||
public interface IMePre extends IPresenter {
|
||||
void getAlbumDetail(String albumId,String pwd,String page,String page_limit);
|
||||
|
||||
void uploadFile(File file, int type, int index, int sice);
|
||||
|
||||
void upAddAlbum(String album_id,String images,String content);
|
||||
|
||||
void getAlbumList(String page, String page_limit, String userId);
|
||||
|
||||
void moveAlbum(String id,String new_album_id);
|
||||
|
||||
void deleteAlbumImage(String id);
|
||||
|
||||
void likeAlbum(String albumId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.BlackUserBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlacklistConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getUserFollowList(List<BlackUserBean> list, String type);
|
||||
|
||||
void userGuanzSuccess(String s);
|
||||
void removeBlackList();
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void getUserFollowList(String type, String page, String page_limit);
|
||||
|
||||
void userGuanz(String userId,String type);
|
||||
|
||||
void removeBlackList(String userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BriefIntroductionConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getUserTagListSuccess(List<UserTagBean> data);
|
||||
void editUserInfoSuccess(String s);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void getUserTagList();
|
||||
void editUserInfo(String nickname,String birthday,String sex,String avatar,String images,String profile,String tag_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
public class ChangeNicknameConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void editUserInfoSuccess(String s);
|
||||
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void editUserInfo(String nickname,String birthday,String sex,String avatar,String images,String profile,String tag_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
public final class ChangePasswordConactos {
|
||||
public interface View extends IView<Activity> {
|
||||
void sendCodeSuccess1(String phoneNumber);
|
||||
void sendCodeSuccess(String s);
|
||||
}
|
||||
|
||||
public interface ICreatedPre extends IPresenter {
|
||||
void sendCode(String phoneNumber, String type);
|
||||
|
||||
void changePassword(String new_password,String mobile,String code,String userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public final class CreatedRoomConactos {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void checkTxtSuccess(String result);
|
||||
|
||||
void addUserRoomSuccess(String roomId);
|
||||
|
||||
|
||||
void upLoadSuccess(String url, int type);
|
||||
|
||||
void suijiRoomName(String s);
|
||||
|
||||
void editRoom();
|
||||
}
|
||||
|
||||
|
||||
public interface ICreatedRoomPre extends IPresenter {
|
||||
void checkTxt(String room_name,String room_cover,String room_intro);
|
||||
|
||||
void addUserRoom(String roomName, String labelId,String cover_picture);
|
||||
|
||||
void roomLabel(String from);
|
||||
|
||||
void uploadFile(File file, int type);
|
||||
|
||||
void roomName();
|
||||
|
||||
void editRoom(String room_id, String room_name, String room_cover, String room_intro,String room_background_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
|
||||
public class CurrencyExchangeConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void exchangeCoin(String earnings_num);
|
||||
|
||||
void wallet(WalletBean walletBean);
|
||||
void getWalletConfig(WalletConfig walletConfig);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void exchangeCoin(String earnings_num);
|
||||
|
||||
void wallet();
|
||||
|
||||
void getWalletConfig();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftBoxBean;
|
||||
import com.xscm.moduleutil.bean.GiftName;
|
||||
|
||||
public class DailyTasksConacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setGiftBox(GiftBoxBean giftBoxBean);
|
||||
|
||||
void dailyTasksOpenBox(GiftName giftName);
|
||||
|
||||
void dailyTasksComplete();
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
|
||||
void tasksLihen();
|
||||
|
||||
void dailyTasksOpenBox(String gift_box_id);
|
||||
|
||||
void dailyTasksReceive(String task_id);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.HeatedBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class EditUserConactos {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
void getUserHomeSuccess(UserInfo userInfo);
|
||||
|
||||
void editUserInfoSuccess(String s);
|
||||
|
||||
void topicList(List<HeatedBean> list);
|
||||
void upLoadSuccess(String url, int type, int index, int total);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void topicList(String page, String page_limit);
|
||||
|
||||
void uploadFile(File file, int type,int index,int sice);
|
||||
|
||||
void getUserHome(String user_id);
|
||||
|
||||
void editUserInfo(String nickname,String birthday,String sex,String avatar,String images,String profile,String tag_id);
|
||||
|
||||
void editUserBg(String images);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftBoxRecordBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class GiftBoxRecordConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void dailyTasksBoxRecord(List<GiftBoxRecordBean> giftBoxRecordBeans);
|
||||
}
|
||||
public interface IMePre extends IPresenter {
|
||||
void dailyTasksBoxRecord();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
|
||||
|
||||
public final class MeConacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void myInfoSuccess(UserInfo data);
|
||||
|
||||
void serviceSuccess(String data);
|
||||
|
||||
void hideSkill(boolean hideSkill);
|
||||
|
||||
// void isFirstRecharge(EntranceCheckBean entranceCheckBean);
|
||||
|
||||
// void setMemberList(GuardMemberBean guardMemberBean);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void getMyInfo();
|
||||
|
||||
void serviceUser();
|
||||
|
||||
void getNameAuthResult(int type);
|
||||
|
||||
void getGuildInfo();
|
||||
|
||||
void entranceCheckFirstRecharge();
|
||||
|
||||
void getMemberList(String userId, int page);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class MyAlbumConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getAlbumList(List<AlbumBean> data);
|
||||
|
||||
void upLoadSuccess(String url, int type);
|
||||
|
||||
void sendCodeSuccess();
|
||||
|
||||
void deleteAlbum();
|
||||
|
||||
void editAlbum();
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void getAlbumList(String page, String page_limit, String userId);
|
||||
|
||||
void uploadFile(File file, int type);
|
||||
|
||||
void createAlbum(String name,String pwd,String image);
|
||||
|
||||
void deleteAlbum(String albumId);
|
||||
|
||||
void editAlbum(String albumId,String name,String pwd,String image);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyBagConacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void packIncome(List<MyBagDataBean> myBagDataBean);
|
||||
void packOutcome(List<MyBagDataBean> myBagDataBean);
|
||||
void giftPack(List<GiftPackBean> giftPackBean);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void packIncome(String page,String page_limit);
|
||||
void packOutcome(String page,String page_limit);
|
||||
void giftPack();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
|
||||
public final class MyMoneyConactos {
|
||||
public interface View extends IView<Activity> {
|
||||
void wallet(WalletBean walletBean);
|
||||
void bindType(BindType bindType);
|
||||
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
|
||||
void wallet();
|
||||
|
||||
void bindType(String userId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.bean.RoomDetails;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class MyRoomListContacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setMyInfo(MyRoomBean myRoom);
|
||||
|
||||
void setList(List<MyRoomBean> list, int type);
|
||||
|
||||
void delfootSuccess();
|
||||
|
||||
void setMyFootData(List<MyFootResp> data,int page);
|
||||
void finishRefresh();
|
||||
|
||||
void setManageData(List<ManageRoomResp> data);
|
||||
|
||||
void setAttentionListData(List<AttentionResp> attentionResps);
|
||||
|
||||
void myCpRoom(List<MyCpRoom> list);
|
||||
}
|
||||
|
||||
public interface IRankingListPre extends IPresenter {
|
||||
void getCharmList( int type,String page);
|
||||
|
||||
void getWealthList( int type);
|
||||
|
||||
void getRoomList( int type);
|
||||
void getNameAuthResult(int type);
|
||||
|
||||
void delfoot();
|
||||
|
||||
void getMyFoot(int page);
|
||||
|
||||
void getManageLists();
|
||||
|
||||
void getAttentionList();
|
||||
|
||||
void myCpRoom();
|
||||
}
|
||||
|
||||
public interface DeatilsView extends IView<Activity> {
|
||||
|
||||
void setList(RoomDetails list);
|
||||
void finishRefresh();
|
||||
|
||||
}
|
||||
|
||||
public interface DeatilsListPre extends IPresenter {
|
||||
void getCharmList(String room_id, String stime, String etime, String p,int type);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.PersonaltyBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PersonalityConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void getPersonaltyList(List<PersonaltyBean> personaltyBean);
|
||||
|
||||
}
|
||||
public interface IMePre extends IPresenter {
|
||||
void getPersonaltyList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
|
||||
public class PhoneReplacementConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void sendCodeSuccess1(String phoneNumber);
|
||||
|
||||
void sendCodeSuccess(String s);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void sendCode(String phoneNumber, String type);
|
||||
|
||||
void mobileView(String mobile, String new_mobile, String sms_code,String type);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
|
||||
public class RealDetailConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void realNameInfo(RealNameBean realNameBean);
|
||||
}
|
||||
|
||||
public interface IRechargePre extends IPresenter {
|
||||
void realNameInfo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RealNameBean;
|
||||
|
||||
public class RealNameConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void realNameSuccess(RealNameBean msg);
|
||||
|
||||
void sendCodeSuccess();
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void realName(String real_name, String card_number);
|
||||
|
||||
void realNameResult(String orderNo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.AppPay;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.RechargeBean;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RechargeConactos {
|
||||
public interface View extends IView<Activity> {
|
||||
void setRechargeData(List<RechargeBean> rechargeData);
|
||||
|
||||
void wallet(WalletBean walletBean);
|
||||
|
||||
void appPay(AppPay appPay);
|
||||
|
||||
void bindType(BindType bindType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public interface IRechargePre extends IPresenter {
|
||||
|
||||
void recharge();//可选充值金额列表
|
||||
|
||||
void wallet();
|
||||
|
||||
void appPay(String user_id,String money,String coin,String type);
|
||||
|
||||
void bindType(String userId);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RevenueConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void saveRevenueData(List<RevenueBean> bean);
|
||||
|
||||
void finishRefreshLoadMore();
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidy;
|
||||
import com.xscm.moduleutil.bean.RoomSubsidyDetails;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RoomAllowanceContacts {
|
||||
|
||||
public interface DeatilsView extends IView<Activity> {
|
||||
void setList(RoomSubsidy list);
|
||||
|
||||
void setHishoryList(List<RoomSubsidyDetails> list);
|
||||
void finishRefresh();
|
||||
}
|
||||
|
||||
public interface DeatilsListPre extends IPresenter {
|
||||
void getCharmList(String room_id);
|
||||
|
||||
void getDetails(String room_id, String page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
public class SettingConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void clearLoginInfo(String s);
|
||||
void cancel(String s);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void clearLoginInfo();
|
||||
|
||||
void cancel();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
|
||||
public class UnderageConacts {
|
||||
public interface View extends IView<Activity> {
|
||||
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.GiftUserWallBean;
|
||||
|
||||
public final class UserGiftWallConacts {
|
||||
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setGiftWall(GiftUserWallBean data);
|
||||
}
|
||||
|
||||
|
||||
public interface IUserGiftWallPre extends IPresenter {
|
||||
void giftWall(String userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UserHomepageConacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void setUserDetails(UserInfo data);
|
||||
void setCircleList(List<CircleListBean> list);
|
||||
|
||||
void userGuanzSuccess(String s);
|
||||
void setLikeZone();
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
|
||||
void getUserDetails(String userId);//获取用户数据
|
||||
|
||||
void getCircleList(String user_id,String page,String page_limit);
|
||||
|
||||
void userGuanz(String userId,String type);
|
||||
void deleteZone(String zone_id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.example.modulevocal.conacts;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.BindType;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.bean.WalletConfig;
|
||||
import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class WithdrawalConacts {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void wallet(WalletBean walletBean);
|
||||
void bindType(BindType bindType);
|
||||
|
||||
void getWalletConfig(WalletConfig walletConfig);
|
||||
void bind();
|
||||
|
||||
void withdrawal(String s);
|
||||
void withdrawalList(List<WithdrawalBean> list);
|
||||
}
|
||||
|
||||
public interface IMePre extends IPresenter {
|
||||
void wallet();
|
||||
void bindType(String userId);
|
||||
|
||||
void getWalletConfig();
|
||||
|
||||
void bind(String userId,String type,String alipayAccount,String bank_card_number,String bank_card,String open_bank);
|
||||
|
||||
void sendCode(String phoneNumber,int type);
|
||||
|
||||
void withdrawal(String number,String type,String sms_code);
|
||||
|
||||
void withdrawalList(String page,String page_limit,String search_stime,String search_etime);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.UserHomepageConacts;
|
||||
import com.example.modulevocal.databinding.FragmentCirleListBinding;
|
||||
import com.example.modulevocal.presenter.UserHomepagePresenter;
|
||||
import com.xscm.moduleutil.adapter.CirleListAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.dialog.RewardGiftDialogFragment;
|
||||
import com.xscm.moduleutil.widget.dialog.ShareDialog;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/6/4
|
||||
*@description: 个人主页动态
|
||||
*/
|
||||
public class CirleListFragment extends BaseMvpFragment<UserHomepagePresenter, FragmentCirleListBinding> implements UserHomepageConacts.View{
|
||||
private int page;
|
||||
private String userId;
|
||||
public static CirleListFragment newInstance(String userId) {
|
||||
CirleListFragment fragment = new CirleListFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("userId", userId);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
userId = arguments.getString("userId");
|
||||
}
|
||||
private CirleListAdapter cirleListAdapter;
|
||||
|
||||
|
||||
@Override
|
||||
protected UserHomepagePresenter bindPresenter() {
|
||||
return new UserHomepagePresenter(this,getSelfActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getCircleList(userId,"1","10");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
cirleListAdapter = new CirleListAdapter(CirleListAdapter.PAGE_SEARCH);
|
||||
mBinding.recyclerView.setAdapter(cirleListAdapter);
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getCircleList(userId,page + "", "10");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
MvpPre.getCircleList(userId,page + "", "10");
|
||||
}
|
||||
});
|
||||
|
||||
cirleListAdapter.setOnItemClickListener(new CirleListAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onDianzanClick(CircleListBean item) {
|
||||
// MvpPre.likeZone(item.getId() + "");
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
if (position != -1) {
|
||||
// 更新点赞状态
|
||||
item.setIs_like(item.getIs_like() == 1 ? 0 : 1);
|
||||
// 局部刷新
|
||||
cirleListAdapter.updateLikeStatusOnly(position, item.getIs_like());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHeadImageClick(CircleListBean item) {
|
||||
// ARouter.getInstance().build(ARouteConstants.USER_HOME_PAGE).navigation();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onZsClick(CircleListBean item) {
|
||||
int position = cirleListAdapter.getData().indexOf(item);
|
||||
RewardGiftDialogFragment.show(String.valueOf(item.getId()),item.getUser_id()+"",position, getChildFragmentManager());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDiandianClick(CircleListBean item) {
|
||||
ShareDialog shareDialog = new ShareDialog(getContext(), item.getContent(),item.getShare_url(),item.getId()+"",1,item.getUser_id()+"", item);
|
||||
shareDialog.setOnShareDataListener(new ShareDialog.OnShareDataListener() {
|
||||
|
||||
@Override
|
||||
public void onShareDataLoaded(String id) {
|
||||
MvpPre.deleteZone(id);
|
||||
}
|
||||
});
|
||||
shareDialog.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPinglunClick(CircleListBean item) {
|
||||
ARouter.getInstance().build(ARouteConstants.DYNAMIC_DETAIL).withString("zone_id", item.getId() + "").navigation();
|
||||
// Intent intent = new Intent(getActivity(), DynamicDetailActivity.class);
|
||||
// intent.putExtra("zone_id", item.getId() + "");
|
||||
// startActivity(intent);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRelaClick(CircleListBean item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGensui(CircleListBean item) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("form","首页热门列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_cirle_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserDetails(UserInfo data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
cirleListAdapter.setNewData(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userGuanzSuccess(String s) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.activity.CreateAlbumActivity;
|
||||
import com.example.modulevocal.adapter.MyAlbumListAdapter;
|
||||
import com.example.modulevocal.conacts.MyAlbumConacts;
|
||||
import com.example.modulevocal.databinding.FragmentMyAlbumBinding;
|
||||
import com.example.modulevocal.presenter.MyAlbumPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/5/29
|
||||
* @description: 我的相册
|
||||
*/
|
||||
public class MyAlbumFragment extends BaseMvpFragment<MyAlbumPresenter, FragmentMyAlbumBinding> implements MyAlbumConacts.View {
|
||||
|
||||
private MyAlbumListAdapter mAdapter;
|
||||
private String userId;
|
||||
|
||||
public static MyAlbumFragment newInstance(String userId) {
|
||||
MyAlbumFragment fragment = new MyAlbumFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("userId", userId);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@NonNull Context context) {
|
||||
super.onAttach(context);
|
||||
userId = getArguments().getString("userId");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyAlbumPresenter bindPresenter() {
|
||||
return new MyAlbumPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getAlbumList("1", "10",userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mAdapter = new MyAlbumListAdapter();
|
||||
mBinding.dyImageRecyc.setLayoutManager(new GridLayoutManager(getActivity(), 2));
|
||||
mBinding.dyImageRecyc.setAdapter(mAdapter);
|
||||
mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
|
||||
@Override
|
||||
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
AlbumBean item = mAdapter.getItem(position);
|
||||
if ("0".equals(item.getId())) {
|
||||
startActivity(new Intent(getActivity(), CreateAlbumActivity.class));
|
||||
}
|
||||
else {
|
||||
if (!TextUtils.isEmpty(item.getPwd())) {
|
||||
if (userId.equals(SpUtil.getUserId() + "")){
|
||||
onPasswordCorrect(item);
|
||||
}else {
|
||||
showPasswordInputDialog(item);
|
||||
}
|
||||
} else {
|
||||
ARouter.getInstance().build(ARouteConstants.USER_ALBUM_DETAIL).withString("albumId", item.getId()).withString("pwd", item.getPwd()).withString("target_fragment",ARouteConstants.FRAGMENT_ALBUM).navigation();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
List<AlbumBean> list = new ArrayList<>();
|
||||
if (userId.equals(SpUtil.getUserId()+"")){
|
||||
AlbumBean albumBean = new AlbumBean();
|
||||
albumBean.setId("0");
|
||||
list.add(albumBean);
|
||||
mAdapter.setNewData(list);
|
||||
}
|
||||
}
|
||||
@SuppressLint({"MissingInflatedId", "LocalSuppress"})
|
||||
private void showPasswordInputDialog(AlbumBean item) {
|
||||
// 创建弹出框视图
|
||||
View dialogView = LayoutInflater.from(getActivity()).inflate(com.xscm.moduleutil.R.layout.dialog_input_password, null);
|
||||
|
||||
// 获取弹出框中的控件
|
||||
final EditText etPassword = dialogView.findViewById(com.xscm.moduleutil.R.id.ed_album_password);
|
||||
TextView btnCancel = dialogView.findViewById(com.xscm.moduleutil.R.id.tv_cancel);
|
||||
TextView btnConfirm = dialogView.findViewById(com.xscm.moduleutil.R.id.tv_confirm);
|
||||
|
||||
// 创建并显示弹出框
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setView(dialogView);
|
||||
final AlertDialog alertDialog = builder.create();
|
||||
alertDialog.show();
|
||||
|
||||
// 取消按钮点击事件
|
||||
btnCancel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
// 确认按钮点击事件
|
||||
btnConfirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String password = etPassword.getText().toString().trim();
|
||||
if (!TextUtils.isEmpty(password)) {
|
||||
// 验证密码(这里只是一个示例,实际应调用相应的方法验证密码)
|
||||
if (item.getPwd().equals(password)) {
|
||||
alertDialog.dismiss();
|
||||
// 密码正确后的操作
|
||||
onPasswordCorrect(item);
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "密码错误", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "请输入密码", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 密码正确后的操作方法(示例)
|
||||
private void onPasswordCorrect(AlbumBean item) {
|
||||
// 密码正确后的具体操作
|
||||
ARouter.getInstance().build(ARouteConstants.USER_ALBUM_DETAIL).withString("albumId", item.getId()).withString("pwd", item.getPwd()).navigation();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_my_album;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAlbumList(List<AlbumBean> data) {
|
||||
if (userId.equals(SpUtil.getUserId()+"")){
|
||||
AlbumBean albumBean = new AlbumBean();
|
||||
albumBean.setId("0");
|
||||
data.add(0,albumBean);
|
||||
}
|
||||
mAdapter.setNewData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upLoadSuccess(String url, int type) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCodeSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAlbum() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editAlbum() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.ChatRoomMyFootAdapter;
|
||||
import com.example.modulevocal.adapter.MyCreateAdapter;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.RoomFragmentMyCreateBinding;
|
||||
import com.example.modulevocal.presenter.MyRoomPresenter;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.bean.RoomData;
|
||||
import com.xscm.moduleutil.bean.ViewItem;
|
||||
import com.xscm.moduleutil.widget.dialog.CommonDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我创建的房间列表和足迹列表
|
||||
*/
|
||||
public class MyCreateFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragmentMyCreateBinding> implements MyRoomListContacts.View {
|
||||
public static final int TYPE_CREATE = 0;
|
||||
public static final int TYPE_HOST = 1;
|
||||
private int type;
|
||||
private BaseQuickAdapter<MyRoomBean, BaseViewHolder> mAdapter;
|
||||
private int page = 1;
|
||||
private ChatRoomMyFootAdapter mChatRoomMyFootAdapter;
|
||||
|
||||
private MyCreateAdapter adapter;
|
||||
|
||||
private List<ViewItem> viewItems = new ArrayList<>();
|
||||
|
||||
public static MyCreateFragment newInstance(int type) {
|
||||
MyCreateFragment fragment = new MyCreateFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyRoomPresenter bindPresenter() {
|
||||
return new MyRoomPresenter(this, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getInt("type", MyCreateFragment.TYPE_CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
viewItems = new ArrayList<>();
|
||||
MvpPre.getCharmList(0,page+"");//我创建的
|
||||
|
||||
}
|
||||
|
||||
private void showDelFootDialog() {
|
||||
if (isAdded() && getActivity() != null) {
|
||||
CommonDialog commonDialog = new CommonDialog(getActivity());
|
||||
commonDialog.setContent("确认清空您的足迹吗?");
|
||||
commonDialog.setmOnClickListener(new CommonDialog.OnClickListener() {
|
||||
@Override
|
||||
public void onLeftClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightClick() {
|
||||
MvpPre.delfoot();
|
||||
}
|
||||
});
|
||||
commonDialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(requireContext(), 2); // 最大支持 4 列
|
||||
mBinding.rvMyRoomList.setLayoutManager(layoutManager);
|
||||
mBinding.rvMyRoomList.setAdapter(adapter = new MyCreateAdapter());
|
||||
|
||||
// 设置 SpanSizeLookup 控制不同 item 占据的列数
|
||||
layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
|
||||
@Override
|
||||
public int getSpanSize(int position) {
|
||||
int viewType = adapter.getItemViewType(position);
|
||||
switch (viewType) {
|
||||
case ViewItem.TYPE_TEXT:
|
||||
case ViewItem.TYPE_RELATION:
|
||||
case ViewItem.TYPE_GIFT:
|
||||
return 2; // 占满一行
|
||||
case ViewItem.TYPE_IMAGE_SELECTION:
|
||||
return 1; // 每行两个
|
||||
default:
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
});
|
||||
// mBinding.rvMyRoomList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
// adapter.bindToRecyclerView(mBinding.rvMyRoomList);
|
||||
|
||||
adapter.setOnImageClickListener(new MyCreateAdapter.OnImageClickListener() {
|
||||
|
||||
@Override
|
||||
public void onImageClick(View view, RoomData roomData) {
|
||||
showDelFootDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_fragment_my_create;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyInfo(MyRoomBean myRoom) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<MyRoomBean> 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delfootSuccess() {
|
||||
page = 1;
|
||||
// MvpPre.getMyFoot(page);
|
||||
viewItems = new ArrayList<>();
|
||||
MvpPre.getCharmList(0,page+"");//我创建的
|
||||
ToastUtils.show("清空足迹成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setMyFootData(List<MyFootResp> 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));
|
||||
for (MyFootResp item : data) {
|
||||
viewItems.add(new ViewItem(ViewItem.TYPE_IMAGE_SELECTION, item));
|
||||
}
|
||||
}
|
||||
adapter.submitList(viewItems);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManageData(List<ManageRoomResp> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttentionListData(List<AttentionResp> attentionResps) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
if (list != null) {
|
||||
RoomData roomData = new RoomData("我的电影房", com.xscm.moduleutil.R.mipmap.diany, 0);
|
||||
viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, roomData));
|
||||
for (MyCpRoom item : list) {
|
||||
viewItems.add(new ViewItem(ViewItem.TYPE_GIFT, item));
|
||||
}
|
||||
}
|
||||
MvpPre.getMyFoot(1);
|
||||
adapter.submitList(viewItems);
|
||||
}
|
||||
|
||||
|
||||
// private void upList(){
|
||||
// if (roomAuctionABean != null) {
|
||||
// // 添加文本项
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, ""));
|
||||
//
|
||||
// // 添加关系列表
|
||||
// for (RoomRelationBean bean : roomAuctionABean.getRoomRelationBeanList()) {
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_RELATION, bean));
|
||||
// }
|
||||
//
|
||||
// if (type.equals("2")){
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择时长"));
|
||||
// for (RoomAutionTimeBean bean : getDefaultTimeOptions()) {
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_IMAGE_SELECTION, bean));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_TEXT, "选择礼物"));
|
||||
// // 添加礼物列表
|
||||
// for (RoonGiftModel bean : roomAuctionABean.getRoomGiftBeanList()) {
|
||||
// viewItems.add(new ViewItem(ViewItem.TYPE_GIFT, bean));
|
||||
// }
|
||||
//
|
||||
// adapter.submitList(viewItems);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.ChatRoomMyFollowAdapter;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.RoomFragmentMyFollowBinding;
|
||||
import com.example.modulevocal.presenter.MyRoomPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*我的关注房间
|
||||
*/
|
||||
public class MyFollowFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragmentMyFollowBinding> implements MyRoomListContacts.View {
|
||||
public static final int TYPE_GZ = 3;
|
||||
private int type;
|
||||
private ChatRoomMyFollowAdapter followAdapter;
|
||||
private int page = 1;
|
||||
|
||||
public static MyFollowFragment newInstance(int type) {
|
||||
MyFollowFragment fragment = new MyFollowFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyRoomPresenter bindPresenter() {
|
||||
return new MyRoomPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getInt("type", MyFollowFragment.TYPE_GZ);
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
// if (type == MyFollowFragment.TYPE_GZ) {
|
||||
MvpPre.getCharmList(3,page+"");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.recycleView.setLayoutManager(new GridLayoutManager(getContext(),2));
|
||||
mBinding.recycleView.setAdapter(followAdapter = new ChatRoomMyFollowAdapter());
|
||||
followAdapter.bindToRecyclerView(mBinding.recycleView);
|
||||
CommonEmptyView commonEmptyView = new CommonEmptyView(getContext());
|
||||
commonEmptyView.setEmptyText("亲亲,你还没管理任何房间哦~赶快动起来吧!");
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC));
|
||||
followAdapter.setEmptyView(commonEmptyView);
|
||||
|
||||
followAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
MyRoomBean item = followAdapter.getItem(position);
|
||||
if (item != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "历史记录列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getCharmList(3,page+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.getCharmList(3,page+"");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_fragment_my_follow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyInfo(MyRoomBean myRoom) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<MyRoomBean> list, int type) {
|
||||
if (page==1){
|
||||
if (list!=null){
|
||||
followAdapter.setNewData(list);
|
||||
}
|
||||
}else {
|
||||
if (list!=null) {
|
||||
followAdapter.addData(list);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delfootSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyFootData(List<MyFootResp> data, int page) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManageData(List<ManageRoomResp> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttentionListData(List<AttentionResp> attentionResps) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.ChatRoomMyManageAdapter;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.RoomFragmentMyManageBinding;
|
||||
import com.example.modulevocal.presenter.MyRoomPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.widget.CommonEmptyView;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 我管理的房间
|
||||
*/
|
||||
public class MyManageFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragmentMyManageBinding> implements MyRoomListContacts.View {
|
||||
|
||||
public static final int TYPE_GL = 2;
|
||||
public static final int TYPE_GZ = 3;
|
||||
private int type;
|
||||
private ChatRoomMyManageAdapter manageAdapter;
|
||||
private int page = 1;
|
||||
|
||||
public static MyManageFragment newInstance(int type) {
|
||||
MyManageFragment fragment = new MyManageFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyRoomPresenter bindPresenter() {
|
||||
return new MyRoomPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getInt("type", MyManageFragment.TYPE_GL);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// if (type == MyManageFragment.TYPE_GL) {
|
||||
MvpPre.getCharmList(2,page+"");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.recycleView.setLayoutManager(new GridLayoutManager(getContext(),2));
|
||||
mBinding.recycleView.setAdapter(manageAdapter = new ChatRoomMyManageAdapter());
|
||||
manageAdapter.bindToRecyclerView(mBinding.recycleView);
|
||||
CommonEmptyView commonEmptyView = new CommonEmptyView(getContext());
|
||||
commonEmptyView.setEmptyText("亲亲,你还没管理任何房间哦~赶快动起来吧!");
|
||||
commonEmptyView.setTextColor(getResources().getColor(com.xscm.moduleutil.R.color.color_FFBDBDBC));
|
||||
manageAdapter.setEmptyView(commonEmptyView);
|
||||
manageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
|
||||
MyRoomBean item = manageAdapter.getItem(position);
|
||||
if (item != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("form", "历史记录列表").withString("roomId", item.getRoom_id()).navigation();
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getCharmList(2,page+"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.getCharmList(2,page+"");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_fragment_my_manage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyInfo(MyRoomBean myRoom) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<MyRoomBean> list, int type) {
|
||||
if (page==1) {
|
||||
if (list!=null) {
|
||||
manageAdapter.setNewData(list);
|
||||
}
|
||||
}else {
|
||||
if (list!=null) {
|
||||
manageAdapter.addData(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delfootSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyFootData(List<MyFootResp> data, int page) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManageData(List<ManageRoomResp> data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttentionListData(List<AttentionResp> attentionResps) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyRoomListContacts;
|
||||
import com.example.modulevocal.databinding.RoomFragmentMyRoomListListBinding;
|
||||
import com.example.modulevocal.presenter.MyRoomPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.AttentionResp;
|
||||
import com.xscm.moduleutil.bean.ManageRoomResp;
|
||||
import com.xscm.moduleutil.bean.MyCpRoom;
|
||||
import com.xscm.moduleutil.bean.MyFootResp;
|
||||
import com.xscm.moduleutil.bean.MyRoomBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A fragment representing a list of Items.
|
||||
* 我主持的房间列表
|
||||
*/
|
||||
public class MyRoomListFragment extends BaseMvpFragment<MyRoomPresenter, RoomFragmentMyRoomListListBinding> implements MyRoomListContacts.View {
|
||||
|
||||
public static final int TYPE_CREATE = 0;
|
||||
public static final int TYPE_HOST = 1;
|
||||
private int type;
|
||||
private BaseQuickAdapter<MyRoomBean, BaseViewHolder> mAdapter;
|
||||
private int page = 1;
|
||||
|
||||
// TODO: Customize parameter initialization
|
||||
@SuppressWarnings("unused")
|
||||
public static MyRoomListFragment newInstance(int type) {
|
||||
MyRoomListFragment fragment = new MyRoomListFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MyRoomPresenter bindPresenter() {
|
||||
return new MyRoomPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
// EventBus.getDefault().register(this);
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getInt("type", MyRoomListFragment.TYPE_CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getCharmList(1, page + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mBinding.rvMyRoomList.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
mAdapter = new BaseQuickAdapter<MyRoomBean, BaseViewHolder>(R.layout.room_fragment_my_room_list, null) {
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MyRoomBean item) {
|
||||
if (item.getRoom_cover() == null || item.getRoom_cover().equals("")) {
|
||||
helper.setImageResource(R.id.riv, com.xscm.moduleutil.R.mipmap.default_avatar);
|
||||
} else {
|
||||
ImageUtils.loadImageView(item.getRoom_cover(), helper.getView(R.id.riv));
|
||||
}
|
||||
if (item.getLabel_icon() != null) {
|
||||
ImageUtils.loadImageView(item.getLabel_icon(), helper.getView(R.id.iv_play));
|
||||
}
|
||||
|
||||
helper.setText(R.id.tv_name, item.getRoom_name());
|
||||
helper.setText(R.id.tv_sy, item.getToday_income() != null ? item.getToday_income() + "" : "0");
|
||||
helper.setText(R.id.tv_user_id, "ID: " + item.getRoom_number());
|
||||
if (type == MyRoomListFragment.TYPE_CREATE) {
|
||||
helper.setText(R.id.tv_bl, "今日收益");
|
||||
} else if (type == MyRoomListFragment.TYPE_HOST) {
|
||||
helper.setText(R.id.tv_bl, "收益分成比例: " + item.getRatio() + "%");
|
||||
}
|
||||
helper.getView(R.id.tv_room_bt).setVisibility(View.GONE);
|
||||
helper.getView(R.id.im_sh).setVisibility(View.GONE);
|
||||
|
||||
String concernText = "关注:" + item.getFollow_num();
|
||||
SpannableString spannableString = new SpannableString(concernText);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), android.R.color.black)), 2, concernText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
helper.setText(R.id.tv_gz, spannableString);
|
||||
|
||||
String concernText1 = "在线:" + item.getOnline_num();
|
||||
SpannableString spannableString1 = new SpannableString(concernText1);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString1.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), android.R.color.black)), 2, concernText1.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
helper.setText(R.id.tv_zx, spannableString1);
|
||||
|
||||
String concernText2 = "访问:" + item.getVisit_num();
|
||||
SpannableString spannableString2 = new SpannableString(concernText2);
|
||||
// 设置关注数字部分的颜色为黑色
|
||||
spannableString2.setSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), android.R.color.black)), 2, concernText2.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
helper.setText(R.id.tv_fw, spannableString2);
|
||||
TextView rl_mx = helper.getView(R.id.rl_mx);
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(rl_mx, helper.itemView.getContext().getColor(com.xscm.moduleutil.R.color.color6c49e25) , 53);
|
||||
rl_mx.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
helper.getView(R.id.rl_mx).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO: 跳转到房间详情页面
|
||||
ARouter.getInstance().build(ARouteConstants.MY_ROOM_DETAILS).withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
helper.getView(R.id.cl_my_room_list).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
|
||||
// TODO: 跳转到房间详情页面
|
||||
// ARouter.getInstance().build(ARouteConstants.LIVE_ROOM).withString("from", "我的界面").withString("roomId", item.getRoom_id() + "").navigation();
|
||||
}
|
||||
});
|
||||
// switch (helper.getLayoutPosition() % 3) {
|
||||
// case 0:
|
||||
// helper.getView(R.id.cl_my_room_list).setBackgroundResource(com.qxcm.moduleutil.R.mipmap.my_cr_room1);
|
||||
// break;
|
||||
// case 1:
|
||||
// helper.getView(R.id.cl_my_room_list).setBackgroundResource(com.qxcm.moduleutil.R.mipmap.my_croom2);
|
||||
// break;
|
||||
// case 2:
|
||||
// helper.getView(R.id.cl_my_room_list).setBackgroundResource(com.qxcm.moduleutil.R.mipmap.my_croom3);
|
||||
// break;
|
||||
// }
|
||||
|
||||
}
|
||||
};
|
||||
mBinding.rvMyRoomList.setAdapter(mAdapter);
|
||||
mAdapter.bindToRecyclerView(mBinding.rvMyRoomList);
|
||||
|
||||
mBinding.smartRefreshLayout.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||
page++;
|
||||
MvpPre.getCharmList(1, page + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
page = 1;
|
||||
MvpPre.getCharmList(1, page + "");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.room_fragment_my_room_list_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyInfo(MyRoomBean myRoom) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setList(List<MyRoomBean> list, int type) {
|
||||
if (page == 1) {
|
||||
// TODO: 刷新列表
|
||||
if (list==null || list.size() == 0) {
|
||||
mBinding.rvMyRoomList.setVisibility(View.GONE);
|
||||
mBinding.tvNoData.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.rvMyRoomList.setVisibility(View.VISIBLE);
|
||||
mBinding.tvNoData.setVisibility(View.GONE);
|
||||
mAdapter.setNewData(list);
|
||||
}
|
||||
}else {
|
||||
if (list!=null) {
|
||||
mAdapter.addData(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delfootSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMyFootData(List<MyFootResp> data, int page) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefresh() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setManageData(List<ManageRoomResp> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttentionListData(List<AttentionResp> attentionResps) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myCpRoom(List<MyCpRoom> list) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.adapter.RevenueAdapter;
|
||||
import com.example.modulevocal.conacts.RevenueConacts;
|
||||
import com.example.modulevocal.databinding.FragmentRevenueBinding;
|
||||
import com.example.modulevocal.presenter.RevenuePresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.RevenueBean;
|
||||
import com.xscm.moduleutil.widget.DoubleTimePickerBottomSheet;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/5/27
|
||||
*@description: 收支展示的页面,根据type展示收入和支出,根据revenueType展示钻石还是金币
|
||||
*/
|
||||
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;
|
||||
@Override
|
||||
protected RevenuePresenter bindPresenter() {
|
||||
return new RevenuePresenter(this,getActivity());
|
||||
}
|
||||
|
||||
public static RevenueFragment newInstance(String type, String revenueType) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString("type", type);
|
||||
args.putString("revenueType", revenueType);
|
||||
RevenueFragment fragment = new RevenueFragment();
|
||||
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getString("type");
|
||||
revenueType = arguments.getString("revenueType");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!isLoaded) {
|
||||
loadData(); // 首次加载
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void refreshData() {
|
||||
isLoaded = false;
|
||||
loadData();
|
||||
}
|
||||
|
||||
private void loadData() {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// MvpPre.getRevenueData("1","50",type,"","",revenueType);
|
||||
|
||||
mBinding.rl3.setOnClickListener(v -> {
|
||||
DoubleTimePickerBottomSheet dialog = new DoubleTimePickerBottomSheet();
|
||||
dialog.setOnTimeRangeSelectedListener((startDate, endDate) -> {
|
||||
// 处理选择的时间范围
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:mm", Locale.getDefault());
|
||||
Log.d("SelectedTime", "开始时间:" + sdf.format(startDate));
|
||||
mBinding.tv2.setText(sdf.format(startDate));
|
||||
Log.d("SelectedTime", "结束时间:" + sdf.format(endDate));
|
||||
mBinding.tv22.setText(sdf.format(endDate));
|
||||
MvpPre.getRevenueData("1","50",type,mBinding.tv2.getText().toString(),mBinding.tv22.getText().toString(),revenueType);
|
||||
});
|
||||
dialog.show(getParentFragmentManager(), "DoubleTimePicker");
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.revenueView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
adapter = new RevenueAdapter();
|
||||
mBinding.revenueView.setAdapter(adapter);
|
||||
|
||||
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,revenueType);
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"",endDate,type);
|
||||
}
|
||||
}
|
||||
|
||||
// MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||
// EventBus.getDefault().post(new BannerRefreshEvent());
|
||||
page = 1;
|
||||
// MvpPre.getRevenueData(page+"","50",revenueType,"","",type);
|
||||
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,revenueType);
|
||||
}else {
|
||||
MvpPre.getRevenueData(page+"","50",revenueType,"",endDate,type);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_revenue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveRevenueData(List<RevenueBean> bean) {
|
||||
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) {
|
||||
adapter.setNewData(list);
|
||||
}else {
|
||||
adapter.addData(list);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// adapter.setNewData(new ArrayList<>());
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finishRefreshLoadMore() {
|
||||
mBinding.smartRefreshLayout.finishRefresh();
|
||||
mBinding.smartRefreshLayout.finishLoadMore();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.activity.UserHomepageActivity;
|
||||
import com.example.modulevocal.adapter.UserGiftWallAdapter;
|
||||
import com.example.modulevocal.conacts.UserGiftWallConacts;
|
||||
import com.example.modulevocal.databinding.MeFagmentUserGiftWallBinding;
|
||||
import com.example.modulevocal.presenter.UserGiftWallPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CombinedGiftBean;
|
||||
import com.xscm.moduleutil.bean.GiftUserWallBean;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridLayoutManager;
|
||||
import com.xscm.moduleutil.widget.pagerecyclerview.PagerGridSnapHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物墙
|
||||
*/
|
||||
public class UserGiftWallFragment extends BaseMvpFragment<UserGiftWallPresenter, MeFagmentUserGiftWallBinding> implements UserGiftWallConacts.View {
|
||||
|
||||
|
||||
public String userId;
|
||||
|
||||
private UserGiftWallAdapter mUserGiftWallAdapter;
|
||||
private UserHomepageActivity homePageInfoActivity;
|
||||
|
||||
|
||||
public static UserGiftWallFragment newInstance(String userId) {
|
||||
UserGiftWallFragment fragment = new UserGiftWallFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("userId", userId);
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UserGiftWallPresenter bindPresenter() {
|
||||
return new UserGiftWallPresenter(this, getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
userId = getArguments().getString("userId");
|
||||
MvpPre.giftWall(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
// 根据屏幕密度调整行数和列数
|
||||
int rows, columns;
|
||||
float density = getResources().getDisplayMetrics().density;
|
||||
|
||||
if (density <= 2.0) { // 低密度屏幕(如mdpi, hdpi)
|
||||
rows = 4;
|
||||
columns = 2;
|
||||
} else if (density <= 3.0) { // 中密度屏幕(如xhdpi)
|
||||
rows = 5;
|
||||
columns = 3;
|
||||
} else { // 高密度屏幕(如xxhdpi, xxxhdpi)
|
||||
rows = 6;
|
||||
columns = 4;
|
||||
}
|
||||
|
||||
mUserGiftWallAdapter = new UserGiftWallAdapter();
|
||||
PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
mBinding.recyclerView.setOnFlingListener(null);
|
||||
// 设置滚动辅助工具
|
||||
PagerGridSnapHelper pageSnapHelper = new PagerGridSnapHelper();
|
||||
pageSnapHelper.attachToRecyclerView(mBinding.recyclerView);
|
||||
mBinding.recyclerView.setAdapter(mUserGiftWallAdapter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.me_fagment_user_gift_wall;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setGiftWall(GiftUserWallBean data) {
|
||||
// mUserGiftWallAdapter.setNewData(data);
|
||||
// mBinding.slGiftWall.setVisibility(View.VISIBLE);
|
||||
|
||||
List<CombinedGiftBean> combinedList = new ArrayList<>();
|
||||
|
||||
// 添加点亮的礼物
|
||||
for (GiftUserWallBean.GiftWallBean liangGift : data.getLiang()) {
|
||||
CombinedGiftBean combinedGift = new CombinedGiftBean();
|
||||
combinedGift.setGift_id(liangGift.getGift_id());
|
||||
combinedGift.setGift_price(liangGift.getGift_price());
|
||||
combinedGift.setGift_name(liangGift.getGift_name());
|
||||
combinedGift.setBase_image(liangGift.getBase_image());
|
||||
combinedGift.setTotal_count(liangGift.getTotal_count());
|
||||
combinedGift.setTop_users(liangGift.getTop_users());
|
||||
combinedGift.setTop_users_count(liangGift.getTop_users_count());
|
||||
combinedGift.set_liang(true);
|
||||
combinedList.add(combinedGift);
|
||||
}
|
||||
|
||||
// 添加未点亮的礼物
|
||||
for (GiftUserWallBean.GiftWallBean noLiangGift : data.getNo_liang()) {
|
||||
CombinedGiftBean combinedGift = new CombinedGiftBean();
|
||||
combinedGift.setGift_id(noLiangGift.getGift_id());
|
||||
combinedGift.setGift_price(noLiangGift.getGift_price());
|
||||
combinedGift.setGift_name(noLiangGift.getGift_name());
|
||||
combinedGift.setBase_image(noLiangGift.getBase_image());
|
||||
combinedGift.set_liang(false);
|
||||
combinedList.add(combinedGift);
|
||||
}
|
||||
|
||||
mUserGiftWallAdapter.setNewData(combinedList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.UserHomepageConacts;
|
||||
import com.example.modulevocal.databinding.FragmentUserHompageBinding;
|
||||
import com.example.modulevocal.presenter.UserHomepagePresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.CircleListBean;
|
||||
import com.xscm.moduleutil.bean.MyBagBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.bean.UserTagBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.tencent.imsdk.v2.V2TIMConversation;
|
||||
import com.tencent.qcloud.tuicore.TUIConstants;
|
||||
import com.tencent.qcloud.tuikit.tuichat.classicui.page.TUIC2CChatActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author qx
|
||||
* @data 2025/6/4
|
||||
* @description: 用户主页
|
||||
*/
|
||||
public class UserHomepageFragment extends BaseMvpFragment<UserHomepagePresenter, FragmentUserHompageBinding> implements UserHomepageConacts.View {
|
||||
private List<MyBagBean> list;
|
||||
private String userId;
|
||||
private UserInfo userInfo;
|
||||
private BaseQuickAdapter<UserTagBean, BaseViewHolder> adapter;
|
||||
private List<UserTagBean> userTagBeans = new ArrayList<>();
|
||||
private int type;
|
||||
|
||||
@Override
|
||||
public void setUserDetails(UserInfo data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCircleList(List<CircleListBean> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userGuanzSuccess(String s) {
|
||||
if (userInfo.getIs_follow() == 1) {
|
||||
userInfo.setIs_follow(0);
|
||||
// SpUtil.saveUserInfo(userInfo);
|
||||
} else {
|
||||
userInfo.setIs_follow(1);
|
||||
// SpUtil.saveUserInfo(userInfo);
|
||||
}
|
||||
refreshView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
|
||||
public static UserHomepageFragment newInstance(UserInfo userInfo, int type) {
|
||||
UserHomepageFragment fragment = new UserHomepageFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putSerializable("userInfo", userInfo);
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
userInfo = (UserInfo) arguments.getSerializable("userInfo");
|
||||
type = arguments.getInt("type");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected UserHomepagePresenter bindPresenter() {
|
||||
return new UserHomepagePresenter(this, getSelfActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (userInfo == null) {
|
||||
userInfo = SpUtil.getUserInfo();
|
||||
}
|
||||
list = new ArrayList<>();
|
||||
list.add(new MyBagBean("动态", "1"));
|
||||
list.add(new MyBagBean("礼物墙", "2"));
|
||||
list.add(new MyBagBean("我的相册", "3"));
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), list, userInfo.getUser_id()+""));
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
if (type == 1) {
|
||||
mBinding.slidingTabLayout.setCurrentTab(1);
|
||||
} else {
|
||||
mBinding.slidingTabLayout.setCurrentTab(0);
|
||||
}
|
||||
mBinding.headerInfo.rivUserHead.setData(userInfo.getAvatar(), "", userInfo.getSex() + "");
|
||||
mBinding.headerInfo.tvNickName.setText(userInfo.getNickname());
|
||||
mBinding.headerInfo.tvUserId.setText(userInfo.getUser_code());
|
||||
mBinding.headerInfo.tvAge.setText(userInfo.getAge() + "岁");
|
||||
mBinding.headerInfo.tvJj.setText(userInfo.getProfile());
|
||||
LinearLayout llContainer = mBinding.headerInfo.llImageContainer;
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
|
||||
List<String> images = userInfo.getIcon(); // 获取图片列表
|
||||
|
||||
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_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); // 右边距
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView);
|
||||
|
||||
llContainer.addView(imageView);
|
||||
}
|
||||
}
|
||||
mBinding.headerInfo.recycleView2.setLayoutManager(new GridLayoutManager(getContext(), 3));
|
||||
|
||||
adapter = new BaseQuickAdapter<UserTagBean, BaseViewHolder>(R.layout.item_tag, userTagBeans) {
|
||||
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, UserTagBean item) {
|
||||
helper.setText(R.id.tv, item.getTag_name());
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
mBinding.headerInfo.recycleView2.setAdapter(adapter);
|
||||
if (userInfo != null) {
|
||||
|
||||
if (userInfo.getTag_list() != null && !userInfo.getTag_list().isEmpty()) {
|
||||
adapter.setNewData(userInfo.getTag_list());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mBinding.headerInfo.tvGz.setOnClickListener(this::onClick);
|
||||
mBinding.headerInfo.tvGsSx.setOnClickListener(this::onClick);
|
||||
refreshView();
|
||||
try {
|
||||
if (userInfo.getGuild()==null || userInfo.getGuild().isEmpty()){
|
||||
mBinding.headerInfo.tvGH.setText("所属公会:无");
|
||||
}else {
|
||||
mBinding.headerInfo.tvGH.setText("所属公会:"+userInfo.getGuild());
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
mBinding.headerInfo.tvGH.setText("所属公会:无");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void refreshView() {
|
||||
if (SpUtil.getUserId() == userInfo.getUser_id()) {
|
||||
mBinding.headerInfo.tvGsSx.setVisibility(View.GONE);
|
||||
mBinding.headerInfo.tvGz.setVisibility(View.GONE);
|
||||
} else {
|
||||
mBinding.headerInfo.tvGsSx.setVisibility(View.VISIBLE);
|
||||
mBinding.headerInfo.tvGz.setVisibility(View.VISIBLE);
|
||||
if (userInfo.getIs_follow() == 1) {
|
||||
// mBinding.headerInfo.tvGz.setBackground(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.yigz));
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( mBinding.headerInfo.tvGz, ContextCompat.getColor(getContext(), com.xscm.moduleutil.R.color.EFF2F8), 34);
|
||||
mBinding.headerInfo.tvGz.setTextColor(Color.BLACK);
|
||||
mBinding.headerInfo.tvGz.setText("已关注");
|
||||
} else {
|
||||
// mBinding.headerInfo.tvGz.setBackground(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.gz));
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( mBinding.headerInfo.tvGz, ColorManager.getInstance().getPrimaryColorInt(), 34);
|
||||
mBinding.headerInfo.tvGz.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.headerInfo.tvGz.setText("关注");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (userInfo.getRoom_id() == null || userInfo.getRoom_id().equals("0")) {
|
||||
mBinding.headerInfo.tvGsSx.setBackground(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.six));
|
||||
} else {
|
||||
mBinding.headerInfo.tvGsSx.setBackground(getResources().getDrawable(com.xscm.moduleutil.R.mipmap.gsui));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void onClick(View view) {
|
||||
if (view.getId() == R.id.tv_gz) {
|
||||
MvpPre.userGuanz(userInfo.getUser_id() + "", "1");
|
||||
} else if (view.getId() == R.id.tv_gs_sx) {
|
||||
if (userInfo.getRoom_id() == null || userInfo.getRoom_id().equals("0")) {
|
||||
Intent intent = new Intent(getActivity(), TUIC2CChatActivity.class);
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_ID, "u" + userInfo.getUser_id());
|
||||
intent.putExtra(TUIConstants.TUIChat.CHAT_TYPE, V2TIMConversation.V2TIM_C2C);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_DETAILS).withString("roomId", userInfo.getRoom_id()).navigation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.constraintLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_user_hompage;
|
||||
}
|
||||
|
||||
private static class MyFragmentPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
private List<MyBagBean> list;
|
||||
private String userId;
|
||||
|
||||
|
||||
public MyFragmentPagerAdapter(FragmentManager fm, List<MyBagBean> list, String userId) {
|
||||
super(fm);
|
||||
this.list = list;
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
if ("1".equals(model.getMyBagType())) {
|
||||
return CirleListFragment.newInstance(userId);
|
||||
} else if ("2".equals(model.getMyBagType())) {
|
||||
return UserGiftWallFragment.newInstance(userId);
|
||||
} else {
|
||||
return MyAlbumFragment.newInstance(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
MyBagBean model = list.get(position);
|
||||
return model.getMyBagTitle();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
package com.example.modulevocal.fragment;
|
||||
|
||||
import static android.content.Context.CLIPBOARD_SERVICE;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.activity.BlacklistActivity;
|
||||
import com.example.modulevocal.activity.DailyTasksActivity;
|
||||
import com.example.modulevocal.activity.EditUserInfoActivity;
|
||||
import com.example.modulevocal.activity.MyBagActivity;
|
||||
import com.example.modulevocal.activity.MyMoneyActivity;
|
||||
import com.example.modulevocal.activity.MyRoomActivity;
|
||||
import com.example.modulevocal.activity.PersonalityActivity;
|
||||
import com.example.modulevocal.activity.SettingActivity;
|
||||
import com.example.modulevocal.activity.UserHomepageActivity;
|
||||
import com.example.modulevocal.conacts.MeConacts;
|
||||
import com.example.modulevocal.databinding.FragmentVocalRangeBinding;
|
||||
import com.example.modulevocal.presenter.MePresenter;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 音域--我的
|
||||
*/
|
||||
public class VocalRangeFragment extends BaseMvpFragment<MePresenter, FragmentVocalRangeBinding> implements MeConacts.View {
|
||||
|
||||
// private MyInfoResp mMyInfoResp;
|
||||
private UserInfo userInfo;
|
||||
|
||||
public static VocalRangeFragment newInstance() {
|
||||
return new VocalRangeFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MePresenter bindPresenter() {
|
||||
return new MePresenter(this, getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (!hidden) {
|
||||
// MvpPre.getMyInfo();
|
||||
// MvpPre.getMemberList(SpUtils.getUserId(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// MvpPre.entranceCheckFirstRecharge();
|
||||
// userBean= SpUtil.getUserInfo();
|
||||
// mBinding.rivUserHead.setData(userBean.getAvatar(), "", String.valueOf(userBean.getSex()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.llVisit.setOnClickListener(this::onClick);
|
||||
mBinding.llFollow.setOnClickListener(this::onClick);
|
||||
mBinding.llFans.setOnClickListener(this::onClick);
|
||||
mBinding.llFriends.setOnClickListener(this::onClick);
|
||||
mBinding.tvNickName.setOnClickListener(this::onClick);
|
||||
// mBinding.tvMyRoom.setOnClickListener(this::onClick);
|
||||
// mBinding.tvMySc.setOnClickListener(this::onClick);
|
||||
mBinding.tvMyBb.setOnClickListener(this::onClick);
|
||||
mBinding.rivUserHead.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyUnion.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyLv.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyCertification.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyCustom.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyHelp.setOnClickListener(this::onClick);
|
||||
mBinding.ivSz.setOnClickListener(this::onClick);
|
||||
mBinding.beautifulViewCopy.setOnClickListener(this::onClick);
|
||||
// mBinding.meMyShare.setOnClickListener(this::onClick);
|
||||
mBinding.tvHome.setOnClickListener(this::onClick);
|
||||
mBinding.meDressUp.setOnClickListener(this::onClick);
|
||||
mBinding.tvMyWallet.setOnClickListener(this::onClick);
|
||||
mBinding.meDaily.setOnClickListener(this::onClick);
|
||||
mBinding.meMyGuild.setOnClickListener(this::onClick);
|
||||
mBinding.tvMyShopping.setOnClickListener(this::onClick);
|
||||
mBinding.imMyRoom.setOnClickListener(this::onClick);
|
||||
mBinding.meMyDan.setOnClickListener(this::onClick);
|
||||
mBinding.ivHb.setOnClickListener(this::onClick);
|
||||
mBinding.ivKf.setOnClickListener(this::onClick);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MvpPre.getMyInfo();
|
||||
// MvpPre.getMemberList(SpUtils.getUserId(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_vocal_range;
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
int id = view.getId();
|
||||
if (id == R.id.ll_visit) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_VISIT).navigation();
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.C0104);
|
||||
} else if (id == R.id.ll_follow) {//关注
|
||||
Intent intent=new Intent(getContext(), BlacklistActivity.class);
|
||||
intent.putExtra("type",0);
|
||||
startActivity(intent);
|
||||
}else if (id==R.id.me_my_guild){
|
||||
Intent intent=new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", " https://vespa.qxmier.com/web/index.html#/pages/union/index?id="+SpUtil.getToken());
|
||||
intent.putExtra("title", "公会");
|
||||
startActivity(intent);
|
||||
}else if (id==R.id.tv_my_shopping){
|
||||
Intent intent=new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/prop/propMall?id="+SpUtil.getToken());
|
||||
intent.putExtra("title", "道具商城");
|
||||
startActivity(intent);
|
||||
}
|
||||
else if (id == R.id.ll_fans) {//粉丝
|
||||
Intent intent=new Intent(getContext(), BlacklistActivity.class);
|
||||
intent.putExtra("type",2);
|
||||
startActivity(intent);
|
||||
} else if (id == R.id.ll_friends) {//访客
|
||||
if (userInfo.getCharm_level()>=20){
|
||||
Intent intent=new Intent(getContext(), BlacklistActivity.class);
|
||||
intent.putExtra("type",3);
|
||||
startActivity(intent);
|
||||
}else {
|
||||
ToastUtils.showShort("需要魅力等级20以上才能查看");
|
||||
}
|
||||
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_MY_FRIENDS).withInt("type", 0).navigation();
|
||||
// AppLogUtil.reportAppLog(AppLogEvent.C0112);
|
||||
}
|
||||
else if (id == R.id.im_my_room) {
|
||||
//我的房间
|
||||
startActivity(new Intent(getContext(), MyRoomActivity.class));
|
||||
} else if (id == R.id.tv_nick_name || id == R.id.tv_home) {//编辑信息
|
||||
startActivity(new Intent(getContext(), EditUserInfoActivity.class));
|
||||
}else if (id == R.id.tv_my_wallet){//钱包
|
||||
startActivity(new Intent(getContext(), MyMoneyActivity.class));
|
||||
}else if (id == R.id.riv_user_head ){//用户主页
|
||||
Intent intent = new Intent(getContext(), UserHomepageActivity.class);
|
||||
intent.putExtra("userId",SpUtil.getUserId()+"");
|
||||
startActivity(intent);
|
||||
}
|
||||
// else if (id == R.id.me_my_lv) {
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_GRADEACTIVITY).withString("from", "我的界面").withInt("type", 1).navigation();
|
||||
// } else if (id == R.id.tv_my_sc) {
|
||||
// //装扮商城
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_SHOP).withString("from", "我的界面").navigation();
|
||||
// }
|
||||
else if (id == R.id.me_dress_up){//个性装扮
|
||||
startActivity(new Intent(getContext(), PersonalityActivity.class));
|
||||
}
|
||||
else if (id == R.id.tv_my_bb) {
|
||||
//我的背包
|
||||
startActivity(new Intent(getContext(), MyBagActivity.class));
|
||||
} else if (id==R.id.me_daily) {//每日任务
|
||||
startActivity(new Intent(getContext(), DailyTasksActivity.class));
|
||||
}
|
||||
else if (id == R.id.iv_sz) {//设置
|
||||
startActivity(new Intent(getContext(), SettingActivity.class));
|
||||
}else if (id == R.id.me_my_dan){//等级
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/other/grade?id=" + SpUtil.getToken());
|
||||
intent.putExtra("title", "等级");
|
||||
startActivity(intent);
|
||||
}else if (id == R.id.iv_kf){//反馈
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", "https://vespa.qxmier.com/web/index.html#/pages/feedback/help?id=" + SpUtil.getToken());
|
||||
// intent.putExtra("url", "http://192.168.110.17:8080/web/index.html#/pages/feedback/help?id=" + SpUtil.getToken());
|
||||
intent.putExtra("title", "反馈");
|
||||
startActivity(intent);
|
||||
}else if (id == R.id.iv_hb){//邀请
|
||||
Intent intent = new Intent(getContext(), WebViewActivity.class);
|
||||
intent.putExtra("url", " https://vespa.qxmier.com/web/index.html#/pages/other/income?id=" + SpUtil.getToken());
|
||||
intent.putExtra("title", "邀请");
|
||||
startActivity(intent);
|
||||
}else if (id==R.id.beautiful_view_copy){
|
||||
copyComment(mBinding.beautifulView.getText().toString());
|
||||
}
|
||||
}
|
||||
private void copyComment(String content) {
|
||||
// 获取剪贴板管理器
|
||||
ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText("Copied Text", content);
|
||||
|
||||
// 设置剪贴板数据
|
||||
clipboard.setPrimaryClip(clip);
|
||||
com.hjq.toast.ToastUtils.show("复制成功");
|
||||
// 可选:通知用户文本已复制
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查看用户主页(我的空间)
|
||||
*/
|
||||
public void userOnclick(View view) {
|
||||
//我的空间
|
||||
// if (mMyInfoResp != null) {
|
||||
// ARouter.getInstance().build(ARouteConstants.NEW_HOME_PAGE).withString("userId", mMyInfoResp.getUser_id()).navigation();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public void myInfoSuccess(MyInfoResp data) {
|
||||
// this.mMyInfoResp = data;
|
||||
// SpUtils.saveUserId(data.getUser_id());
|
||||
// SpUtils.saveMyRoomId(data.getRoom_id());
|
||||
// mBinding.tvNickName.setText(data.getNickname());
|
||||
// mBinding.tvFollow.setText(data.getFollow_count());
|
||||
// mBinding.tvFans.setText(data.getFans_count());
|
||||
// mBinding.tvFriends.setText(data.getFriend_count());
|
||||
// mBinding.tvVisit.setText(data.getVisit_count());
|
||||
// mBinding.beautifulView.setText("ID:"+data.getUser_code());
|
||||
// mBinding.beautifulViewCopy.setOnClickListener(v->copyUserId(data.getUser_code()));
|
||||
// mBinding.rivUserHead.setData(data.getHead_picture(), data.getRank_info().getPicture(), data.getSex());
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void myInfoSuccess(UserInfo data) {
|
||||
SpUtil.saveUserInfo(data);
|
||||
this.userInfo = data;
|
||||
mBinding.rivUserHead.setData(data.getAvatar(), data.getDress(), String.valueOf(data.getSex()));
|
||||
mBinding.tvNickName.setText(data.getNickname());
|
||||
mBinding.beautifulView.setText("ID:"+data.getUser_code());
|
||||
mBinding.tvFollow.setText(data.getFollow_num()+"");
|
||||
mBinding.tvFans.setText(data.getFans_num()+"");
|
||||
mBinding.tvFriends.setText(data.getLook_me_num()+"");
|
||||
if (data.getAuth()==1){
|
||||
SpUtil.setRealName(true);
|
||||
}else {
|
||||
SpUtil.setRealName(false);
|
||||
}
|
||||
|
||||
LinearLayout llContainer = mBinding.llImageContainer;
|
||||
llContainer.removeAllViews(); // 清空旧的 ImageView
|
||||
|
||||
List<String> images = data.getIcon(); // 获取图片列表
|
||||
|
||||
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_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); // 右边距
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
|
||||
// 使用 Glide 加载图片
|
||||
ImageUtils.loadHeadCC(url, imageView);
|
||||
|
||||
llContainer.addView(imageView);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serviceSuccess(String data) {
|
||||
try {
|
||||
String qqUrl = "mqqwpa://im/chat?chat_type=wpa&uin=" + data + "&version=1";
|
||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(qqUrl)));
|
||||
} catch (Exception e) {
|
||||
// ToastUtils.show("请先安装QQ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideSkill(boolean hideSkill) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 首充有礼显示
|
||||
*/
|
||||
// @Override
|
||||
// public void isFirstRecharge(EntranceCheckBean entranceCheckBean) {
|
||||
//// if (entranceCheckBean != null) {
|
||||
//// mBinding.ivFirstCharge.setVisibility(entranceCheckBean.isAllow_show() ? View.VISIBLE : View.GONE);
|
||||
//// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取守护数
|
||||
*/
|
||||
// @Override
|
||||
// public void setMemberList(GuardMemberBean guardMemberBean) {
|
||||
//// if (guardMemberBean != null) {
|
||||
//// mBinding.tvGuardNum.setText(guardMemberBean.getHead().getTotal_number());
|
||||
//// }
|
||||
// }
|
||||
|
||||
private void copyUserId(CharSequence content) {
|
||||
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(CLIPBOARD_SERVICE);
|
||||
if (clipboard != null) {
|
||||
clipboard.setPrimaryClip(ClipData.newPlainText(null, content));
|
||||
// ToastUtils.show("已复制到粘贴板");
|
||||
}
|
||||
}
|
||||
|
||||
// private List<MeItemBean> initItems() {
|
||||
// List<MeItemBean> items = new ArrayList<>();
|
||||
// // 成为大神
|
||||
// MeItemBean skill = new MeItemBean(true, true);
|
||||
// skill.setIcon(R.mipmap.me_icon_cwds);
|
||||
// skill.setName("成为大神");
|
||||
// skill.setType("skill");
|
||||
// items.add(skill);
|
||||
// // 我的订单
|
||||
//// MeItemBean order = new MeItemBean(true, false);
|
||||
//// order.setIcon(R.mipmap.me_icon_wddd);
|
||||
//// order.setName("我的订单");
|
||||
//// order.setType("order");
|
||||
//// items.add(order);
|
||||
//// // 评价订单
|
||||
//// MeItemBean pjOrder = new MeItemBean(true, false);
|
||||
//// pjOrder.setIcon(R.mipmap.me_icon_pjdd);
|
||||
//// pjOrder.setName("评价订单");
|
||||
//// pjOrder.setType("pjOrder");
|
||||
//// items.add(pjOrder);
|
||||
// // 我的等级
|
||||
// MeItemBean wdDengji = new MeItemBean(true, true);
|
||||
// wdDengji.setIcon(R.mipmap.me_icon_wddj);
|
||||
// wdDengji.setName("我的等级");
|
||||
// wdDengji.setType("wdDengji");
|
||||
// items.add(wdDengji);
|
||||
// // 我的公会
|
||||
// MeItemBean wdGonghui = new MeItemBean(true, true);
|
||||
// wdGonghui.setIcon(R.mipmap.me_icon_wdgh);
|
||||
// wdGonghui.setName("我的公会");
|
||||
// wdGonghui.setType("wdGonghui");
|
||||
// items.add(wdGonghui);
|
||||
//// // 邀请有礼
|
||||
//// MeItemBean yqYouli = new MeItemBean(true, true);
|
||||
//// yqYouli.setIcon(R.mipmap.me_icon_yqyl);
|
||||
//// yqYouli.setName("邀请有礼");
|
||||
//// yqYouli.setType("yqYouli");
|
||||
//// items.add(yqYouli);
|
||||
// // 实名认证
|
||||
// MeItemBean verified = new MeItemBean(false, true);
|
||||
// verified.setIcon(R.mipmap.me_icon_smrz);
|
||||
// verified.setName("实名认证");
|
||||
// verified.setType("verified");
|
||||
// items.add(verified);
|
||||
//
|
||||
// return items;
|
||||
// }
|
||||
|
||||
// private List<MeItemBean> initItems2() {
|
||||
// List<MeItemBean> items = new ArrayList<>();
|
||||
// // 在线客服
|
||||
// MeItemBean customerService = new MeItemBean(true, true);
|
||||
// customerService.setType("customer_service");
|
||||
// customerService.setName("在线客服");
|
||||
// customerService.setIcon(R.mipmap.me_icon_service);
|
||||
// items.add(customerService);
|
||||
// // 帮助中心
|
||||
// MeItemBean helpCenter = new MeItemBean(true, true);
|
||||
// helpCenter.setType("help_center");
|
||||
// helpCenter.setName("帮助中心");
|
||||
// helpCenter.setIcon(R.mipmap.me_icon_help);
|
||||
// items.add(helpCenter);
|
||||
// // 设置
|
||||
// MeItemBean settings = new MeItemBean(false, true);
|
||||
// settings.setType("settings");
|
||||
// settings.setName("设置");
|
||||
// settings.setIcon(R.mipmap.me_icon_setting);
|
||||
// items.add(settings);
|
||||
//
|
||||
// return items;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 关闭首充入口
|
||||
*/
|
||||
// @Subscribe(threadMode = ThreadMode.MAIN)
|
||||
// public void closeFirstCharge(CloseFirstChargeEvent closeFirstChargeEvent) {
|
||||
//// mBinding.ivFirstCharge.setVisibility(View.GONE);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
// EventBus.getDefault().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
// EventBus.getDefault().unregister(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.example.modulevocal.fragment.mybag;
|
||||
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class MyBagAdapter extends BaseQuickAdapter<GiftPackBean, BaseViewHolder> {
|
||||
public MyBagAdapter() {
|
||||
super(R.layout.item_my_bag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, GiftPackBean item) {
|
||||
ImageUtils.loadHeadCC(item.getBase_image(), helper.getView(R.id.iv_img));
|
||||
helper.setText(R.id.integral, "x"+item.getNum())
|
||||
.setText(R.id.tv_name_period, item.getGift_name()).setText(R.id.tv_gift_price, item.getGift_price());
|
||||
TextView integral = helper.getView(R.id.integral);
|
||||
float[] corners = {0f, 4f, 0f, 4f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( integral, ColorManager.getInstance().getPrimaryColorInt(), corners);
|
||||
integral.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.example.modulevocal.fragment.mybag;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyBagConacts;
|
||||
import com.example.modulevocal.databinding.FragmentMyBagBinding;
|
||||
import com.example.modulevocal.presenter.MyBagPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyBagFragment extends BaseMvpFragment<MyBagPresenter, FragmentMyBagBinding> implements MyBagConacts.View{
|
||||
MyBagAdapter mAdapter;
|
||||
private List<ZhuangBanShangChengBean> zhuangBanShangChengBeanList;
|
||||
private String type;
|
||||
|
||||
public static MyBagFragment newInstance(String type) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("type", type);
|
||||
MyBagFragment fragment = new MyBagFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
protected MyBagPresenter bindPresenter() {
|
||||
return new MyBagPresenter(this,getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// zhuangBanShangChengBeanList=new ArrayList<>();
|
||||
// for (int i = 0; i < 6; i++) {
|
||||
// ZhuangBanShangChengBean zhuangBanShangChengBean=new ZhuangBanShangChengBean();
|
||||
// zhuangBanShangChengBean.setTitle("标题"+i);
|
||||
// zhuangBanShangChengBean.setIntegral("积分"+i);
|
||||
// zhuangBanShangChengBean.setPeriod(i);
|
||||
// zhuangBanShangChengBean.setType("类型"+i);
|
||||
// zhuangBanShangChengBean.setBase_image("");
|
||||
// zhuangBanShangChengBeanList.add(zhuangBanShangChengBean);
|
||||
// }
|
||||
MvpPre.giftPack();
|
||||
|
||||
|
||||
mAdapter=new MyBagAdapter();
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
|
||||
mBinding.rvMyBag.setLayoutManager(gridLayoutManager);
|
||||
mBinding.rvMyBag.setAdapter(mAdapter);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getString("type", "2");
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_my_bag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packIncome(List<MyBagDataBean> myBagDataBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packOutcome(List<MyBagDataBean> myBagDataBean) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||
mAdapter.setNewData(giftPackBean);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.example.modulevocal.fragment.mybag;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
|
||||
public class MyBagListAdapter extends BaseQuickAdapter<MyBagDataBean, BaseViewHolder> {
|
||||
public MyBagListAdapter() {
|
||||
super(R.layout.item_my_bag_data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, MyBagDataBean item) {
|
||||
helper.setText(R.id.tv_title, item.getTitle());
|
||||
helper.setText(R.id.tv_time, item.getTime());
|
||||
helper.setText(R.id.tv_gift_name, item.getGiftName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.example.modulevocal.fragment.mybag;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.conacts.MyBagConacts;
|
||||
import com.example.modulevocal.databinding.FragmentMyBagListBinding;
|
||||
import com.example.modulevocal.presenter.MyBagPresenter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
import com.xscm.moduleutil.bean.MyBagDataBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MyBagListFragment extends BaseMvpFragment<MyBagPresenter, FragmentMyBagListBinding> implements MyBagConacts.View{
|
||||
MyBagListAdapter mAdapter;
|
||||
private String type;
|
||||
List<MyBagDataBean> myBagDataBeanList;
|
||||
|
||||
public static MyBagListFragment newInstance(String type) {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putString("type", type);
|
||||
MyBagListFragment fragment = new MyBagListFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
protected MyBagPresenter bindPresenter() {
|
||||
return new MyBagPresenter(this,getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getString("type", "2");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (type.equals("1")){
|
||||
|
||||
}else if (type.equals("2")){
|
||||
MvpPre.packIncome("1","30");
|
||||
}else if (type.equals("3")){
|
||||
MvpPre.packOutcome("1","30");
|
||||
}
|
||||
|
||||
mAdapter=new MyBagListAdapter();
|
||||
|
||||
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mBinding.recyclerView.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_my_bag_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packIncome(List<MyBagDataBean> myBagDataBean) {
|
||||
if (myBagDataBeanList!=null) {
|
||||
myBagDataBeanList.addAll(myBagDataBean);
|
||||
mAdapter.setNewData(myBagDataBeanList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void packOutcome(List<MyBagDataBean> myBagDataBean) {
|
||||
mAdapter.setNewData(myBagDataBean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void giftPack(List<GiftPackBean> giftPackBean) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.example.modulevocal.fragment.zhuangb;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.example.modulevocal.R;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.utils.ImageUtils;
|
||||
|
||||
public class ZhuangBanShangChengAdapter extends BaseQuickAdapter<ZhuangBanShangChengBean, BaseViewHolder> {
|
||||
public ZhuangBanShangChengAdapter() {
|
||||
super(R.layout.item_zhuangbanschangcheng_list);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder helper, ZhuangBanShangChengBean item) {
|
||||
if (item == null) {
|
||||
|
||||
} else {
|
||||
helper.addOnClickListener(R.id.zb_bg_ll);
|
||||
if (item.getBase_image().equals("")) {
|
||||
helper.getView(R.id.integral).setVisibility(View.GONE);
|
||||
} else {
|
||||
ImageUtils.loadHeadCC(item.getBase_image(), helper.getView(R.id.iv_img));
|
||||
}
|
||||
|
||||
TextView tv_integral = helper.getView(R.id.integral);
|
||||
float[] corners = {0f, 4f, 0f, 4f};
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground( tv_integral, ColorManager.getInstance().getPrimaryColorInt(), corners);
|
||||
tv_integral.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
helper.setText(R.id.integral, item.getRemaining_day())
|
||||
.setText(R.id.tv_name_period, item.getTitle());
|
||||
// .setText(R.id.tv_time, "(有效期${item.period}天)")
|
||||
if (item.isIs_select()) {
|
||||
helper.getView(R.id.zb_bg).setBackgroundResource(com.xscm.moduleutil.R.mipmap.sect_true);
|
||||
helper.getView(R.id.tv_name_period).setSelected(true);
|
||||
helper.getView(R.id.integral).setSelected(true);
|
||||
|
||||
|
||||
} else {
|
||||
helper.getView(R.id.zb_bg).setBackgroundResource(com.xscm.moduleutil.R.mipmap.sect_false);
|
||||
helper.getView(R.id.tv_name_period).setSelected(false);
|
||||
helper.getView(R.id.integral).setSelected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.example.modulevocal.fragment.zhuangb;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ZhuangBanShangChengConactos {
|
||||
|
||||
public interface View extends IView<Activity> {
|
||||
void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans);
|
||||
|
||||
void setUserDecorate();
|
||||
|
||||
void cancelUserDecorate();
|
||||
}
|
||||
|
||||
public interface ICreatedRoomPre extends IPresenter {
|
||||
void getDecorateList(String type);
|
||||
|
||||
void setUserDecorate(String udid);
|
||||
|
||||
void cancelUserDecorate(String type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.example.modulevocal.fragment.zhuangb;
|
||||
|
||||
import static com.xscm.moduleutil.utils.ImageLoader.loadImage;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
|
||||
import com.example.modulevocal.R;
|
||||
import com.example.modulevocal.databinding.ZhuangbanRecyclerviewNorefBinding;
|
||||
import com.example.modulevocal.fragment.MyRoomListFragment;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
import com.xscm.moduleutil.utils.ColorManager;
|
||||
import com.xscm.moduleutil.widget.AvatarFrameView;
|
||||
import com.tencent.qgame.animplayer.AnimView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ZhuangBanShangChengFragment extends BaseMvpFragment<ZhuangBanShangChengPresenter, ZhuangbanRecyclerviewNorefBinding> implements ZhuangBanShangChengConactos.View {
|
||||
|
||||
private int type;
|
||||
private List<ZhuangBanShangChengBean> zhuangBanShangChengBeanList;
|
||||
|
||||
int pSelect = -1;
|
||||
private String did;
|
||||
ZhuangBanShangChengAdapter adapter;
|
||||
AvatarFrameView imageBg;
|
||||
AnimView item_animview;
|
||||
@Override
|
||||
protected ZhuangBanShangChengPresenter bindPresenter() {
|
||||
return new ZhuangBanShangChengPresenter(this, getActivity());
|
||||
}
|
||||
|
||||
public static ZhuangBanShangChengFragment newInstance(int type) {
|
||||
ZhuangBanShangChengFragment fragment = new ZhuangBanShangChengFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("type", type);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
public void initArgs(Bundle arguments) {
|
||||
super.initArgs(arguments);
|
||||
type = arguments.getInt("type", MyRoomListFragment.TYPE_CREATE);
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getDecorateList(type+"");
|
||||
// //这里根据传递的type进行数据查询
|
||||
// zhuangBanShangChengBeanList=new ArrayList<>();
|
||||
// for (int i = 0; i < 10; i++) {
|
||||
// ZhuangBanShangChengBean zhuangBanShangChengBean=new ZhuangBanShangChengBean();
|
||||
// zhuangBanShangChengBean.setTitle("标题"+i);
|
||||
// zhuangBanShangChengBean.setIntegral("积分"+i);
|
||||
// zhuangBanShangChengBean.setPeriod(i);
|
||||
// zhuangBanShangChengBean.setType("类型"+i);
|
||||
// zhuangBanShangChengBean.setBase_image("");
|
||||
// zhuangBanShangChengBeanList.add(zhuangBanShangChengBean);
|
||||
// }
|
||||
|
||||
imageBg = (AvatarFrameView) getActivity().findViewById(R.id.image_headPortrait);
|
||||
item_animview = (AnimView) getActivity().findViewById(R.id.item_animview);
|
||||
adapter = new ZhuangBanShangChengAdapter();
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(), 3);
|
||||
mBinding.recyclerView.setLayoutManager(gridLayoutManager);
|
||||
mBinding.recyclerView.setAdapter(adapter);
|
||||
|
||||
adapter.setOnItemChildClickListener((adapter1, view, position) -> {
|
||||
List<ZhuangBanShangChengBean> list = (List<ZhuangBanShangChengBean>) adapter1.getData();
|
||||
|
||||
if (pSelect != -1 && pSelect != position) {
|
||||
list.get(pSelect).setIs_select(false);
|
||||
list.get(position).setIs_select(true);
|
||||
pSelect = position;
|
||||
did = list.get(position).getUdid();
|
||||
mBinding.ll.setVisibility(View.VISIBLE);
|
||||
|
||||
if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
|
||||
// imageBg.playSVGA(list.get(position).getPlay_image());
|
||||
imageBg.setSource(list.get(position).getPlay_image(),1);
|
||||
} else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
|
||||
// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image()));
|
||||
imageBg.setSource(list.get(position).getPlay_image(),1);
|
||||
}
|
||||
} else if (pSelect != -1 && pSelect == position) {
|
||||
list.get(position).setIs_select(false);
|
||||
pSelect = -1;
|
||||
mBinding.ll.setVisibility(View.GONE);
|
||||
} else {
|
||||
list.get(position).setIs_select(true);
|
||||
did = list.get(position).getUdid();
|
||||
pSelect = position;
|
||||
mBinding.ll.setVisibility(View.VISIBLE);
|
||||
|
||||
// loadImage(getContext(),imageBg, list.get(position).getPlay_image());
|
||||
// ImageUtils.loadDecorationAvatar(list.get(position).getPlay_image(), imageBg);
|
||||
// imageBg.load(list.get(position).getPlay_image());
|
||||
if ("svga".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
|
||||
imageBg.setSource(list.get(position).getPlay_image(),1);
|
||||
// imageBg.playSVGA(list.get(position).getPlay_image());
|
||||
} else if ("mp4".equalsIgnoreCase(getFileExtension(list.get(position).getPlay_image()))) {
|
||||
imageBg.setSource(list.get(position).getPlay_image(), 1);
|
||||
// imageBg.playMP4(Uri.parse(list.get(position).getPlay_image()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
adapter1.setNewData(list);
|
||||
adapter1.notifyDataSetChanged();
|
||||
});
|
||||
adapter.setNewData(zhuangBanShangChengBeanList);
|
||||
|
||||
}
|
||||
private String getFileExtension(String url) {
|
||||
if (url == null || url.isEmpty()) return "";
|
||||
int dotIndex = url.lastIndexOf(".");
|
||||
if (dotIndex > 0 && dotIndex < url.length() - 1) {
|
||||
return url.substring(dotIndex + 1).toLowerCase(); // 返回 "mp4", "svga" 等
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
mBinding.zhuangbanBuy.setOnClickListener(v -> {
|
||||
if (did == null || did.isEmpty()){
|
||||
MvpPre.cancelUserDecorate(type+"");
|
||||
}else {
|
||||
MvpPre.setUserDecorate(did);
|
||||
}
|
||||
});
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.zhuangbanBuy, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.zhuangbanBuy.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.zhuangban_recyclerview_noref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDecorateList(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans) {
|
||||
ZhuangBanShangChengBean zhuangBanShangChengBean = new ZhuangBanShangChengBean();
|
||||
zhuangBanShangChengBean.setTitle("默认头像");
|
||||
zhuangBanShangChengBean.setBase_image("");
|
||||
zhuangBanShangChengBeans.add(0,zhuangBanShangChengBean);
|
||||
adapter.setNewData(zhuangBanShangChengBeans);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserDecorate() {
|
||||
Toast.makeText(getSelfActivity(), "设置成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelUserDecorate() {
|
||||
ToastUtils.show("取消成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.example.modulevocal.fragment.zhuangb;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class ZhuangBanShangChengPresenter extends BasePresenter<ZhuangBanShangChengConactos.View> implements ZhuangBanShangChengConactos.ICreatedRoomPre {
|
||||
public ZhuangBanShangChengPresenter(ZhuangBanShangChengConactos.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDecorateList(String type) {
|
||||
api.getDecorateList(type, new BaseObserver<List<ZhuangBanShangChengBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<ZhuangBanShangChengBean> zhuangBanShangChengBeans) {
|
||||
MvpRef.get().getDecorateList(zhuangBanShangChengBeans);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserDecorate(String udid) {
|
||||
api.setUserDecorate(udid, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().setUserDecorate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelUserDecorate(String type) {
|
||||
api.cancelUserDecorate(type, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().cancelUserDecorate();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.example.modulevocal.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulevocal.conacts.AlbumDetailConacts;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.bean.AlbumBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.utils.oss.OSSOperUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class AlbumDetailPresenter extends BasePresenter<AlbumDetailConacts.View> implements AlbumDetailConacts.IMePre {
|
||||
public AlbumDetailPresenter(AlbumDetailConacts.View view, Context context) {
|
||||
super(view, context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAlbumDetail(String albumId, String pwd, String page, String page_limit) {
|
||||
api.getAlbumDetail(albumId, pwd, page, page_limit, new BaseObserver<AlbumBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(AlbumBean albumBean) {
|
||||
MvpRef.get().getAlbumDetail(albumBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void batchUploadFiles(List<File> files, int type) {
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
uploadFile(files.get(i), type, i, files.size());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadFile(File file, int type, int index, int size) {
|
||||
MvpRef.get().showLoadings("上传中...");
|
||||
String url = OSSOperUtils.getPath(file, type);
|
||||
OSSOperUtils.newInstance().putObjectMethod(url, file.getPath(), new OSSOperUtils.OssCallback() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
if (isViewAttach()) {
|
||||
MvpRef.get().disLoadings();
|
||||
MvpRef.get().upLoadSuccess(OSSOperUtils.AliYunOSSURLFile + url, type, index, size);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFail() {
|
||||
if (isViewAttach()) {
|
||||
ToastUtils.show("上传失败");
|
||||
MvpRef.get().disLoadings();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upAddAlbum(String album_id, String images, String content) {
|
||||
api.upAddAlbum(album_id, images, content, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().upAddAlbum();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAlbumList(String page, String page_limit, String userId) {
|
||||
api.getAlbumList(page, page_limit, userId, new BaseObserver<List<AlbumBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<AlbumBean> albumBeans) {
|
||||
MvpRef.get().getAlbumList(albumBeans);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveAlbum(String id, String new_album_id) {
|
||||
api.moveAlbum(id, new_album_id, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().moveAlbum();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAlbumImage(String id) {
|
||||
api.deleteAlbum(id,1, new BaseObserver<String>() {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().deleteAlbum();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void likeAlbum(String albumId) {
|
||||
api.likeAlbum(albumId, new BaseObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
addDisposable(d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(String s) {
|
||||
MvpRef.get().likeAlbum();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user