修改BUG

This commit is contained in:
2025-09-02 23:03:08 +08:00
parent fe4ff5655a
commit 101eb87e5f
94 changed files with 2147 additions and 2203 deletions

View File

@@ -8,6 +8,7 @@ import android.graphics.Color;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -256,25 +257,30 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
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);
View btnCancel = dialog.findViewById(com.xscm.moduleutil.R.id.btn_cancel);
View btnConfirm = dialog.findViewById(com.xscm.moduleutil.R.id.btn_confirm);
TextView tvTitle = dialog.findViewById(com.xscm.moduleutil.R.id.tv_title);
tvTitle.setText("选择相册");
assert recyclerView != null;
recyclerView.setLayoutManager(new GridLayoutManager(this,4));
SingleChoiceAdapter sadapter = new SingleChoiceAdapter();
recyclerView.setAdapter(sadapter);
sadapter.setNewData(data);
btnCancel.setOnClickListener(v -> dialog.dismiss());
// 添加空值检查以提高代码健壮性
if (btnCancel != null) {
btnCancel.setOnClickListener(v -> dialog.dismiss());
}
if (btnConfirm != null) {
btnConfirm.setOnClickListener(v -> {
AlbumBean selectedItem = sadapter.getSelectedItem();
btnConfirm.setOnClickListener(v -> {
AlbumBean selectedItem = sadapter.getSelectedItem();
if (selectedItem != null) {
MvpPre.moveAlbum(adapter.getSelectedPhotoIdsAsString(), selectedItem.getId());
}
dialog.dismiss();
});
if (selectedItem != null) {
MvpPre.moveAlbum(adapter.getSelectedPhotoIdsAsString(), selectedItem.getId());
}
dialog.dismiss();
});
}
dialog.show();
}
@@ -317,7 +323,11 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
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 + "");
if (Integer.parseInt(albumBean.getLike_num())==0){
mBinding.dyComment.setText("0");
}else {
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 + "");

View File

@@ -89,6 +89,10 @@ public class WithdrawalActivity extends BaseMvpActivity<WithdrawalPresenter, Act
ToastUtils.show("请选择提现方式");
return;
}
if (mBinding.etCustomAmount.getText().toString().equals("0")|| mBinding.etCustomAmount.getText().toString().equals("") || mBinding.etCustomAmount.getText().toString().isEmpty()){
ToastUtils.show("提现金额不能为0");
return;
}
showSecondaryVerificationDialog();
});

View File

@@ -65,7 +65,8 @@ public class UserGiftWallFragment extends BaseMvpFragment<UserGiftWallPresenter,
rows = 6;
columns = 4;
}
rows = 6;
columns = 4;
mUserGiftWallAdapter = new UserGiftWallAdapter();
PagerGridLayoutManager layoutManager = new PagerGridLayoutManager(rows, columns, PagerGridLayoutManager.VERTICAL);
mBinding.recyclerView.setLayoutManager(layoutManager);

View File

@@ -10,13 +10,16 @@ import com.xscm.moduleutil.presenter.BasePresenter;
import com.xscm.moduleutil.utils.oss.OSSOperUtils;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.List;
import io.reactivex.disposables.Disposable;
public class AlbumDetailPresenter extends BasePresenter<AlbumDetailConacts.View> implements AlbumDetailConacts.IMePre {
private AlbumDetailConacts.View mView;
public AlbumDetailPresenter(AlbumDetailConacts.View view, Context context) {
super(view, context);
this.mView = view;
}
@Override
@@ -89,6 +92,9 @@ public class AlbumDetailPresenter extends BasePresenter<AlbumDetailConacts.View>
@Override
public void onNext(List<AlbumBean> albumBeans) {
if (MvpRef==null){
MvpRef=new WeakReference<>(mView);
}
MvpRef.get().getAlbumList(albumBeans);
}
});

View File

@@ -10,23 +10,24 @@
</data>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<com.xscm.moduleutil.widget.CustomTopBar
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" />
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/top_bar"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_12"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>