修改BUG
This commit is contained in:
@@ -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 + "");
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user