修復圖片刪除不了

This commit is contained in:
hch 2024-03-22 17:55:50 +08:00
parent 4d4d3d1bae
commit 9427fb8aaa
2 changed files with 4 additions and 2 deletions

View File

@ -188,6 +188,7 @@ public class ActiveImageAdapter extends RecyclerView.Adapter {
void setData(ActiveImageBean bean, int position) { void setData(ActiveImageBean bean, int position) {
itemView.setTag(position); itemView.setTag(position);
del.setTag(position);
if (bean.getImageFile() == null) { if (bean.getImageFile() == null) {
mImg.setImageDrawable(null); mImg.setImageDrawable(null);
if (mIconAdd.getVisibility() != View.VISIBLE) { if (mIconAdd.getVisibility() != View.VISIBLE) {

View File

@ -198,12 +198,13 @@ public class CommunitySendActivity extends AbsActivity {
activeImageAdapter.setActionListener(new ActiveImageAdapter.ActionListener() { activeImageAdapter.setActionListener(new ActiveImageAdapter.ActionListener() {
@Override @Override
public void onAddClick() { public void onAddClick() {
openImageChooserActivity();
} }
@Override @Override
public void onItemClick(int position) { public void onItemClick(int position) {
activeImageAdapter.deleteItem(position);
activeImageAdapter.notifyItemRemoved(position);
} }
@Override @Override