fix [消息设置,删除已经上传的图片之后,×依然存在]

This commit is contained in:
zlzw 2024-03-25 10:09:28 +08:00
parent dd582c10c7
commit 463e7b9040

View File

@ -315,6 +315,7 @@ public class MessageHiConfigActivity extends AbsActivity {
private void setImage(View view) { private void setImage(View view) {
MessageHiBean bean = (MessageHiBean) view.getTag(); MessageHiBean bean = (MessageHiBean) view.getTag();
if (bean == null) { if (bean == null) {
ViewUtils.findViewById(view, R.id.img_close).setVisibility(View.GONE);
ViewUtils.findViewById(view, R.id.img_img, ImageView.class).setImageResource(R.mipmap.ic_message_hi_config_image_add); ViewUtils.findViewById(view, R.id.img_img, ImageView.class).setImageResource(R.mipmap.ic_message_hi_config_image_add);
view.setOnClickListener(v -> { view.setOnClickListener(v -> {
uploadImage(view); uploadImage(view);
@ -342,12 +343,11 @@ public class MessageHiConfigActivity extends AbsActivity {
onSuccessToUrl(file, new OnItemClickListener<String>() { onSuccessToUrl(file, new OnItemClickListener<String>() {
@Override @Override
public void onItemClick(String url, int position) { public void onItemClick(String url, int position) {
loading.dismiss();
if (position == -1) { if (position == -1) {
loading.dismiss();
ToastUtil.show("连接超时"); ToastUtil.show("连接超时");
return; return;
} }
loading.dismiss();
MessageHiBean item = new MessageHiBean(); MessageHiBean item = new MessageHiBean();
item.setContent(url); item.setContent(url);
item.setType(MessageHiBean.TYPE_IMAGE); item.setType(MessageHiBean.TYPE_IMAGE);
@ -361,7 +361,7 @@ public class MessageHiConfigActivity extends AbsActivity {
@Override @Override
public void onFailure() { public void onFailure() {
super.onFailure(); super.onFailure();
if(loading!=null){ if (loading != null) {
loading.dismiss(); loading.dismiss();
} }
} }